mysql手工注入之load_file()应用 - cracer知乎

大哥们在线教下,mysql手工注入之load_file()应用 - cracer知乎
最新回答
有泪无悔

2026-06-26 07:59:36

在MySQL注入攻击中,利用`load_file()`函数能获取敏感信息,实现提权和读取系统敏感文件。以下是一些常见敏感文件的路径:

- /usr/local/app/apache2/conf/httpd.conf(Apache配置文件)

- /usr/local/apache2/conf/httpd.conf(Apache配置文件)

- /usr/local/app/apache2/conf/extra/httpd-vhosts.conf(虚拟网站设置)

- /usr/local/app/php5/lib/php.ini(PHP相关设置)

- /etc/sysconfig/iptables(防火墙规则策略)

- /etc/httpd/conf/httpd.conf(Apache配置文件)

- /etc/rsyncd.conf(同步程序配置文件)

- /etc/sysconfig/network-scripts/ifcfg-eth0(查看IP)

- /etc/my.cnf(MySQL配置文件)

- /etc/redhat-release(系统版本)

- /etc/issue(系统发行版信息)

- /etc/issue.net(系统发行版网络信息)

- c:\mysql\data\mysql\user.MYD(存储MySQL.user表中的数据库连接密码)

- c:\Program Files\
http://RhinoSoft.com
\Serv-U\ServUDaemon.ini(存储虚拟主机网站路径和密码)

- c:\Program Files\
http://RhinoSoft.com
\ServUDaemon.exe(Serv-U管理员密码存储)

- c:\Program Files\Serv-U\ServUAdmin.exe(Serv-U 6.0版本以前的管理员密码存储)

- c:\Documents and Settings\All Users\Application Data\Symantec\pcAnywhere\*.cif(存储pcAnywhere登录密码)

- c:\windows\repair\sam(存储Windows系统初次安装密码)

`load_file()`除了读取配置文件,还能读取二进制文件,如:

- c:\windows\repair\sam(存储Windows系统初次安装的密码)

- c:\Program Files\
http://RhinoSoft.com
\ServUDaemon.exe(Serv-U管理员密码存储)

- c:\Program Files\
http://RhinoSoft.com
\ServUDaemon.ini(Serv-U配置文件)

通过注入`load_file()`函数,攻击者可以获取敏感信息,例如上传图片。实现过程包括:

- 验证写权限,获取网站物理路径,如:/var/www/html/xxxx/www/new/info.php 和 /var/www/html/xxxx/www/new/2.jpg。

- 使用`load_file()`将图片上传至指定路径,如:load_file(/var/www/html/xxxx/www/new/2.jpg) into outfile '/var/www/html/xxxx/www/new/info1.php'。

通过注入`load_file()`函数,攻击者可以执行更为复杂的操作,获取更多敏感信息,提高攻击效率。