XSpear 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +63 -53
- data/README.md +3 -1
- data/lib/XSpear.rb +56 -0
- data/lib/XSpear/XSpearRepoter.rb +8 -0
- data/lib/XSpear/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04f26c164cd4c7570977a05e5f81d3a9592ea6d7ece5cda306430b6a798b43c1
|
4
|
+
data.tar.gz: d8fc3996277015dd5b0ea0976274c137500c206d4ffdb07f1a707f98ac56b60b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c240f65c655a99058a0c8bb761cf59fc1f5c66c4a5ad5b9734a4bf28ecd2c855df3b3c7fd22b97d0326be3f8ce34359f7548b8c19138121cc6b019b85120a9f4
|
7
|
+
data.tar.gz: 1e919c4c91804ac1299c4d3bfbfd7bfeb4413bc44c95612abe4e7179a411ce225c42bccacaf0d912910f55636888d67d8ef66284a28ac1f756d3db3595bda76d
|
data/.idea/workspace.xml
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<project version="4">
|
3
3
|
<component name="ChangeListManager">
|
4
|
-
<list default="true" id="4ee2e581-45d7-4c90-b6a1-e92e4b5829dd" name="Default Changelist" comment="(1.1.
|
4
|
+
<list default="true" id="4ee2e581-45d7-4c90-b6a1-e92e4b5829dd" name="Default Changelist" comment="(1.1.1) Add reporter method">
|
5
5
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
6
6
|
<change beforePath="$PROJECT_DIR$/lib/XSpear.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/XSpear.rb" afterDir="false" />
|
7
7
|
<change beforePath="$PROJECT_DIR$/lib/XSpear/XSpearRepoter.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/XSpear/XSpearRepoter.rb" afterDir="false" />
|
8
|
-
<change beforePath="$PROJECT_DIR$/lib/XSpear/banner.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/XSpear/banner.rb" afterDir="false" />
|
9
|
-
<change beforePath="$PROJECT_DIR$/lib/XSpear/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/XSpear/version.rb" afterDir="false" />
|
10
8
|
</list>
|
11
9
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
12
10
|
<option name="SHOW_DIALOG" value="false" />
|
@@ -19,37 +17,34 @@
|
|
19
17
|
</component>
|
20
18
|
<component name="FileEditorManager">
|
21
19
|
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
22
|
-
<file pinned="false" current-in-tab="false">
|
23
|
-
<entry file="file://$PROJECT_DIR$/README.md">
|
24
|
-
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
25
|
-
<state split_layout="SPLIT">
|
26
|
-
<first_editor relative-caret-position="1648">
|
27
|
-
<caret line="189" column="13" selection-start-line="189" selection-start-column="13" selection-end-line="189" selection-end-column="13" />
|
28
|
-
</first_editor>
|
29
|
-
<second_editor />
|
30
|
-
</state>
|
31
|
-
</provider>
|
32
|
-
</entry>
|
33
|
-
</file>
|
34
20
|
<file pinned="false" current-in-tab="false">
|
35
21
|
<entry file="file://$PROJECT_DIR$/spec/XSpear_spec.rb">
|
36
22
|
<provider selected="true" editor-type-id="text-editor" />
|
37
23
|
</entry>
|
38
24
|
</file>
|
39
|
-
<file pinned="false" current-in-tab="
|
25
|
+
<file pinned="false" current-in-tab="true">
|
40
26
|
<entry file="file://$PROJECT_DIR$/lib/XSpear.rb">
|
41
27
|
<provider selected="true" editor-type-id="text-editor">
|
42
|
-
<state relative-caret-position="
|
43
|
-
<caret line="
|
28
|
+
<state relative-caret-position="399">
|
29
|
+
<caret line="112" selection-start-line="112" selection-end-line="112" />
|
44
30
|
</state>
|
45
31
|
</provider>
|
46
32
|
</entry>
|
47
33
|
</file>
|
48
|
-
<file pinned="false" current-in-tab="
|
34
|
+
<file pinned="false" current-in-tab="false">
|
35
|
+
<entry file="file://$USER_HOME$/.rvm/rubies/ruby-2.4.6/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb">
|
36
|
+
<provider selected="true" editor-type-id="text-editor">
|
37
|
+
<state relative-caret-position="207">
|
38
|
+
<caret line="53" selection-start-line="53" selection-end-line="53" />
|
39
|
+
</state>
|
40
|
+
</provider>
|
41
|
+
</entry>
|
42
|
+
</file>
|
43
|
+
<file pinned="false" current-in-tab="false">
|
49
44
|
<entry file="file://$PROJECT_DIR$/lib/XSpear/XSpearRepoter.rb">
|
50
45
|
<provider selected="true" editor-type-id="text-editor">
|
51
|
-
<state relative-caret-position="
|
52
|
-
<caret line="
|
46
|
+
<state relative-caret-position="457">
|
47
|
+
<caret line="54" column="10" selection-start-line="54" selection-start-column="10" selection-end-line="54" selection-end-column="10" />
|
53
48
|
</state>
|
54
49
|
</provider>
|
55
50
|
</entry>
|
@@ -113,9 +108,9 @@
|
|
113
108
|
<option value="$PROJECT_DIR$/exe/XSpear" />
|
114
109
|
<option value="$PROJECT_DIR$/README.md" />
|
115
110
|
<option value="$PROJECT_DIR$/lib/XSpear/version.rb" />
|
116
|
-
<option value="$PROJECT_DIR$/lib/XSpear.rb" />
|
117
111
|
<option value="$PROJECT_DIR$/lib/XSpear/banner.rb" />
|
118
112
|
<option value="$PROJECT_DIR$/lib/XSpear/XSpearRepoter.rb" />
|
113
|
+
<option value="$PROJECT_DIR$/lib/XSpear.rb" />
|
119
114
|
</list>
|
120
115
|
</option>
|
121
116
|
</component>
|
@@ -229,7 +224,8 @@
|
|
229
224
|
<workItem from="1563638656518" duration="4985000" />
|
230
225
|
<workItem from="1563809961097" duration="4237000" />
|
231
226
|
<workItem from="1563893538891" duration="11917000" />
|
232
|
-
<workItem from="1564151699165" duration="
|
227
|
+
<workItem from="1564151699165" duration="2494000" />
|
228
|
+
<workItem from="1564413097342" duration="2893000" />
|
233
229
|
</task>
|
234
230
|
<task id="LOCAL-00001" summary="init update">
|
235
231
|
<created>1562945899597</created>
|
@@ -567,16 +563,23 @@
|
|
567
563
|
<option name="project" value="LOCAL" />
|
568
564
|
<updated>1564152655489</updated>
|
569
565
|
</task>
|
570
|
-
<
|
566
|
+
<task id="LOCAL-00049" summary="(1.1.0) Releases 1.1.0 / Fixed bug, modify report format, etc..">
|
567
|
+
<created>1564154233169</created>
|
568
|
+
<option name="number" value="00049" />
|
569
|
+
<option name="presentableId" value="LOCAL-00049" />
|
570
|
+
<option name="project" value="LOCAL" />
|
571
|
+
<updated>1564154233169</updated>
|
572
|
+
</task>
|
573
|
+
<option name="localTasksCounter" value="50" />
|
571
574
|
<servers />
|
572
575
|
</component>
|
573
576
|
<component name="TimeTrackingManager">
|
574
|
-
<option name="totallyTimeSpent" value="
|
577
|
+
<option name="totallyTimeSpent" value="41863000" />
|
575
578
|
</component>
|
576
579
|
<component name="ToolWindowManager">
|
577
580
|
<frame x="0" y="0" width="1680" height="1050" extended-state="0" />
|
578
581
|
<layout>
|
579
|
-
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.
|
582
|
+
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.16788767" />
|
580
583
|
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
581
584
|
<window_info id="Favorites" order="2" side_tool="true" />
|
582
585
|
<window_info anchor="bottom" id="Message" order="0" />
|
@@ -602,7 +605,6 @@
|
|
602
605
|
<option name="version" value="1" />
|
603
606
|
</component>
|
604
607
|
<component name="VcsManagerConfiguration">
|
605
|
-
<MESSAGE value="Add show version & edit help, version in banner" />
|
606
608
|
<MESSAGE value="Edit version , release 1.0.2" />
|
607
609
|
<MESSAGE value="Add EventHandler Test logic (1.0.3), edit description on report" />
|
608
610
|
<MESSAGE value="verbose가 1일 떄 배너 출력되지 않도록 수정" />
|
@@ -627,7 +629,8 @@
|
|
627
629
|
<MESSAGE value="(1.0.9) Releases 1.0.9 / Add --raw options, code refactoring, fixed bugs" />
|
628
630
|
<MESSAGE value="(1.1.0) [Fixed #14] Edit raw query print code" />
|
629
631
|
<MESSAGE value="(1.1.0) [Fixed #15] makeQueryPattern 내 페이로드 생성 코드 수정" />
|
630
|
-
<
|
632
|
+
<MESSAGE value="(1.1.0) Releases 1.1.0 / Fixed bug, modify report format, etc.." />
|
633
|
+
<option name="LAST_COMMIT_MESSAGE" value="(1.1.0) Releases 1.1.0 / Fixed bug, modify report format, etc.." />
|
631
634
|
</component>
|
632
635
|
<component name="editorHistoryManager">
|
633
636
|
<entry file="file://$USER_HOME$/.rvm/gems/ruby-2.4.6/gems/bundler-2.0.1/lib/bundler/rubygems_integration.rb">
|
@@ -650,9 +653,26 @@
|
|
650
653
|
</state>
|
651
654
|
</provider>
|
652
655
|
</entry>
|
656
|
+
<entry file="file://$PROJECT_DIR$/README.md">
|
657
|
+
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
658
|
+
<state split_layout="SPLIT">
|
659
|
+
<first_editor relative-caret-position="2865">
|
660
|
+
<caret line="191" column="13" selection-start-line="191" selection-start-column="13" selection-end-line="191" selection-end-column="13" />
|
661
|
+
</first_editor>
|
662
|
+
<second_editor />
|
663
|
+
</state>
|
664
|
+
</provider>
|
665
|
+
</entry>
|
653
666
|
<entry file="file://$PROJECT_DIR$/spec/XSpear_spec.rb">
|
654
667
|
<provider selected="true" editor-type-id="text-editor" />
|
655
668
|
</entry>
|
669
|
+
<entry file="file://$PROJECT_DIR$/lib/XSpear/banner.rb">
|
670
|
+
<provider selected="true" editor-type-id="text-editor">
|
671
|
+
<state relative-caret-position="150">
|
672
|
+
<caret line="10" column="35" selection-start-line="10" selection-start-column="35" selection-end-line="10" selection-end-column="35" />
|
673
|
+
</state>
|
674
|
+
</provider>
|
675
|
+
</entry>
|
656
676
|
<entry file="file://$PROJECT_DIR$/lib/XSpear/log.rb">
|
657
677
|
<provider selected="true" editor-type-id="text-editor">
|
658
678
|
<state relative-caret-position="195">
|
@@ -660,6 +680,13 @@
|
|
660
680
|
</state>
|
661
681
|
</provider>
|
662
682
|
</entry>
|
683
|
+
<entry file="file://$PROJECT_DIR$/lib/XSpear/version.rb">
|
684
|
+
<provider selected="true" editor-type-id="text-editor">
|
685
|
+
<state relative-caret-position="45">
|
686
|
+
<caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
|
687
|
+
</state>
|
688
|
+
</provider>
|
689
|
+
</entry>
|
663
690
|
<entry file="file://$PROJECT_DIR$/XSpear.gemspec">
|
664
691
|
<provider selected="true" editor-type-id="text-editor">
|
665
692
|
<state relative-caret-position="105">
|
@@ -673,41 +700,24 @@
|
|
673
700
|
<entry file="file:///usr/local/bin/rake">
|
674
701
|
<provider selected="true" editor-type-id="text-editor" />
|
675
702
|
</entry>
|
676
|
-
<entry file="file://$PROJECT_DIR$/
|
677
|
-
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
678
|
-
<state split_layout="SPLIT">
|
679
|
-
<first_editor relative-caret-position="1648">
|
680
|
-
<caret line="189" column="13" selection-start-line="189" selection-start-column="13" selection-end-line="189" selection-end-column="13" />
|
681
|
-
</first_editor>
|
682
|
-
<second_editor />
|
683
|
-
</state>
|
684
|
-
</provider>
|
685
|
-
</entry>
|
686
|
-
<entry file="file://$PROJECT_DIR$/lib/XSpear/version.rb">
|
703
|
+
<entry file="file://$PROJECT_DIR$/lib/XSpear/XSpearRepoter.rb">
|
687
704
|
<provider selected="true" editor-type-id="text-editor">
|
688
|
-
<state relative-caret-position="
|
689
|
-
<caret line="
|
705
|
+
<state relative-caret-position="457">
|
706
|
+
<caret line="54" column="10" selection-start-line="54" selection-start-column="10" selection-end-line="54" selection-end-column="10" />
|
690
707
|
</state>
|
691
708
|
</provider>
|
692
709
|
</entry>
|
693
|
-
<entry file="file://$
|
710
|
+
<entry file="file://$USER_HOME$/.rvm/rubies/ruby-2.4.6/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb">
|
694
711
|
<provider selected="true" editor-type-id="text-editor">
|
695
|
-
<state relative-caret-position="
|
696
|
-
<caret line="
|
712
|
+
<state relative-caret-position="207">
|
713
|
+
<caret line="53" selection-start-line="53" selection-end-line="53" />
|
697
714
|
</state>
|
698
715
|
</provider>
|
699
716
|
</entry>
|
700
717
|
<entry file="file://$PROJECT_DIR$/lib/XSpear.rb">
|
701
718
|
<provider selected="true" editor-type-id="text-editor">
|
702
|
-
<state relative-caret-position="
|
703
|
-
<caret line="
|
704
|
-
</state>
|
705
|
-
</provider>
|
706
|
-
</entry>
|
707
|
-
<entry file="file://$PROJECT_DIR$/lib/XSpear/XSpearRepoter.rb">
|
708
|
-
<provider selected="true" editor-type-id="text-editor">
|
709
|
-
<state relative-caret-position="1585">
|
710
|
-
<caret line="113" column="8" selection-start-line="113" selection-start-column="8" selection-end-line="113" selection-end-column="8" />
|
719
|
+
<state relative-caret-position="399">
|
720
|
+
<caret line="112" selection-start-line="112" selection-end-line="112" />
|
711
721
|
</state>
|
712
722
|
</provider>
|
713
723
|
</entry>
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
<img src="https://user-images.githubusercontent.com/13212227/62058818-ffcef780-b25c-11e9-9a35-36537efbcca7.png" width=100%>
|
2
|
+
|
1
3
|
# XSpear
|
2
4
|
XSpear is XSS Scanner on ruby gems
|
3
5
|
|
@@ -300,7 +302,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
300
302
|
|
301
303
|
## Contributing
|
302
304
|
|
303
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
305
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/hahwul/XSpear. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
304
306
|
|
305
307
|
## License
|
306
308
|
|
data/lib/XSpear.rb
CHANGED
@@ -74,6 +74,56 @@ class XspearScan
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
+
class CallbackCheckWAF < ScanCallbackFunc
|
78
|
+
def run
|
79
|
+
pattern = {}
|
80
|
+
pattern['AWS'] = 'AWS Web Application FW'
|
81
|
+
pattern['ACE XML Gateway'] = 'Cisco ACE XML Gateway'
|
82
|
+
pattern['cloudflare'] = 'CloudFlare'
|
83
|
+
pattern['cf-ray'] = 'CloudFlare'
|
84
|
+
pattern['Error from cloudfront'] = 'Amazone CloudFront'
|
85
|
+
pattern['Protected by COMODO WAF'] = 'Comodo Web Application FW'
|
86
|
+
pattern['X-Backside-Transport.*?(OK|FAIL)'] = 'IBM WebSphere DataPower'
|
87
|
+
pattern['FORTIWAFSID'] = 'FortiWeb Web Application FW'
|
88
|
+
pattern['ODSESSION'] = 'Hyperguard Web Application FW'
|
89
|
+
pattern['AkamaiGHost'] = 'KONA(AKAMAIGHOST)'
|
90
|
+
pattern['Mod_Security|NOYB'] = 'ModSecurity'
|
91
|
+
pattern['naxsi/waf'] = 'NAXSI'
|
92
|
+
pattern['NCI__SessionId='] = 'NetContinuum Web Application FW'
|
93
|
+
pattern['citrix_ns_id'] = 'Citrix NetScaler'
|
94
|
+
pattern['NSC_'] = 'Citrix NetScaler'
|
95
|
+
pattern['NS-CACHE'] = 'Citrix NetScaler'
|
96
|
+
pattern['newdefend'] = 'Newdefend Web Application FW'
|
97
|
+
pattern['NSFocus'] = 'NSFOCUS Web Application FW'
|
98
|
+
pattern['PLBSID'] = 'Profense Web Application Firewall'
|
99
|
+
pattern['X-SL-CompState'] = 'AppWall (Radware)'
|
100
|
+
pattern['safedog'] = 'Safedog Web Application FW'
|
101
|
+
pattern['Sucuri/Cloudproxy|X-Sucuri'] = 'CloudProxy WebSite FW'
|
102
|
+
pattern['X-Sucuri'] = 'CloudProxy WebSite FW'
|
103
|
+
pattern['st8(id)'] = 'Teros/Citrix Application FW'
|
104
|
+
pattern['st8(_wat)'] = 'Teros/Citrix Application FW'
|
105
|
+
pattern['st8(_wlf)'] = 'Teros/Citrix Application FW'
|
106
|
+
pattern['F5-TrafficShield'] = 'TrafficShield'
|
107
|
+
pattern['Rejected-By-UrlScan'] = 'MS UrlScan'
|
108
|
+
pattern['Secure Entry Server'] = 'USP Secure Entry Server'
|
109
|
+
pattern['nginx-wallarm'] = 'Wallarm Web Application FW'
|
110
|
+
pattern['WatchGuard'] = 'WatchGuard '
|
111
|
+
pattern['X-Powered-By-360wzb'] = '360 Web Application'
|
112
|
+
pattern['WebKnight'] = 'WebKnight Application FW'
|
113
|
+
|
114
|
+
pattern.each do |key,value|
|
115
|
+
if !@response[key].nil?
|
116
|
+
time = Time.now
|
117
|
+
puts '[I]'.blue + " [#{time.strftime('%H:%M:%S')}] Found WAF: #{value}"
|
118
|
+
@report.add_issue("i","d","-","-","<original query>","Found WAF: #{value}")
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
[false, "not reflected #{@query}"]
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
|
77
127
|
class CallbackCheckHeaders < ScanCallbackFunc
|
78
128
|
def run
|
79
129
|
if !@response['Server'].nil?
|
@@ -96,6 +146,7 @@ class XspearScan
|
|
96
146
|
@report.add_issue("i","s","-","-","<original query>","Not set X-XSS-Protection")
|
97
147
|
end
|
98
148
|
|
149
|
+
|
99
150
|
if !@response['X-Frame-Options'].nil?
|
100
151
|
@report.add_issue("i","s","-","-","<original query>","X-Frame-Options: #{@response['X-Frame-Options']}")
|
101
152
|
else
|
@@ -360,6 +411,7 @@ class XspearScan
|
|
360
411
|
|
361
412
|
|
362
413
|
log('s', 'creating a test query.')
|
414
|
+
r.push makeQueryPattern('x', '<script>alert(45)</script>', '<script>alert(45)</script>', 'i', "Found WAF", CallbackCheckWAF)
|
363
415
|
r.push makeQueryPattern('s', '', '', 'i', "-", CallbackCheckHeaders)
|
364
416
|
r.push makeQueryPattern('d', 'XsPeaR"', 'XsPeaR"', 'i', "Found SQL Error Pattern", CallbackErrorPatternMatch)
|
365
417
|
r.push makeQueryPattern('r', 'rEfe6', 'rEfe6', 'i', 'reflected parameter', CallbackStringMatch)
|
@@ -469,6 +521,10 @@ class XspearScan
|
|
469
521
|
end
|
470
522
|
end
|
471
523
|
|
524
|
+
def reporter
|
525
|
+
@report
|
526
|
+
end
|
527
|
+
|
472
528
|
def makeQueryPattern(type, payload, pattern, category, desc, callback)
|
473
529
|
# type: [r]eflected param
|
474
530
|
# [f]ilted rule
|
data/lib/XSpear/XSpearRepoter.rb
CHANGED
data/lib/XSpear/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: XSpear
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hahwul
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|