比較全的SQL注入相關(guān)的命令分享
作者: 來(lái)源: 發(fā)布時(shí)間:2011-6-15 15:18:23 點(diǎn)擊:
</font>"
end if
'SQL Server 數(shù)據(jù)庫(kù)的備份與恢復(fù)!
if request("action")="backupdatabase" Then
dim sqlserver,sqlname,sqlpassword,sqlLoginTimeout,databasename,bak_file,act
sqlserver = trim(request("sqlserver"))
sqlname = trim(request("sqlname"))
sqlpassword =trim(request("sqlpassword"))
sqlLoginTimeout = 15
databasename = trim(request("databasename"))
bak_file = trim(request("bak_file"))
bak_file = replace(bak_file,"$1",databasename)
act = lcase(request("act"))
if databasename = "" then
response.write "<font color=#ff0000>沒(méi)有輸入數(shù)據(jù)庫(kù)名稱(chēng)!</font>"
else
if act = "backup" then
Set srv=Server.CreateObject("SQLDMO.SQLServer")
srv.LoginTimeout = sqlLoginTimeout
srv.Connect sqlserver,sqlname, sqlpassword
Set bak = Server.CreateObject("SQLDMO.Backup")
bak.Database=databasename
bak.Devices=Files
bak.Action = 0
bak.Initialize = 1
'bak.Replace = True
bak.Files=bak_file
bak.SQLBackup srv
if err.number>0 then
response.write err.number&"<font color=red><br>"
response.write err.description&"</font>"
end if
Response.write "<font color=green>備份成功!</font>"
elseif act="restore" then
'恢復(fù)時(shí)要在沒(méi)有使用數(shù)據(jù)庫(kù)時(shí)進(jìn)行!
Set srv=Server.CreateObject("SQLDMO.SQLServer")
srv.LoginTimeout = sqlLoginTimeout
srv.Connect sqlserver,sqlname, sqlpassword
Set rest=Server.CreateObject("SQLDMO.Restore")
rest.Action=0 ' full db restore
rest.Database=databasename
rest.Devices=Files
rest.Files=bak_file
rest.ReplaceDatabase=True 'Force restore over existing database
if err.number>0 then
response.write err.number&"<font color=red><br>"
response.write err.description&"</font>"
end if
rest.SQLRestore srv
Response.write "<font color=green>恢復(fù)成功!</font>"
else
Response.write "<font color=red>請(qǐng)選擇備份或恢復(fù)!</font>"
end if
end if
end if
%></td>
</tr>
</table>
</body>
</html>
end if
'SQL Server 數(shù)據(jù)庫(kù)的備份與恢復(fù)!
if request("action")="backupdatabase" Then
dim sqlserver,sqlname,sqlpassword,sqlLoginTimeout,databasename,bak_file,act
sqlserver = trim(request("sqlserver"))
sqlname = trim(request("sqlname"))
sqlpassword =trim(request("sqlpassword"))
sqlLoginTimeout = 15
databasename = trim(request("databasename"))
bak_file = trim(request("bak_file"))
bak_file = replace(bak_file,"$1",databasename)
act = lcase(request("act"))
if databasename = "" then
response.write "<font color=#ff0000>沒(méi)有輸入數(shù)據(jù)庫(kù)名稱(chēng)!</font>"
else
if act = "backup" then
Set srv=Server.CreateObject("SQLDMO.SQLServer")
srv.LoginTimeout = sqlLoginTimeout
srv.Connect sqlserver,sqlname, sqlpassword
Set bak = Server.CreateObject("SQLDMO.Backup")
bak.Database=databasename
bak.Devices=Files
bak.Action = 0
bak.Initialize = 1
'bak.Replace = True
bak.Files=bak_file
bak.SQLBackup srv
if err.number>0 then
response.write err.number&"<font color=red><br>"
response.write err.description&"</font>"
end if
Response.write "<font color=green>備份成功!</font>"
elseif act="restore" then
'恢復(fù)時(shí)要在沒(méi)有使用數(shù)據(jù)庫(kù)時(shí)進(jìn)行!
Set srv=Server.CreateObject("SQLDMO.SQLServer")
srv.LoginTimeout = sqlLoginTimeout
srv.Connect sqlserver,sqlname, sqlpassword
Set rest=Server.CreateObject("SQLDMO.Restore")
rest.Action=0 ' full db restore
rest.Database=databasename
rest.Devices=Files
rest.Files=bak_file
rest.ReplaceDatabase=True 'Force restore over existing database
if err.number>0 then
response.write err.number&"<font color=red><br>"
response.write err.description&"</font>"
end if
rest.SQLRestore srv
Response.write "<font color=green>恢復(fù)成功!</font>"
else
Response.write "<font color=red>請(qǐng)選擇備份或恢復(fù)!</font>"
end if
end if
end if
%></td>
</tr>
</table>
</body>
</html>
Tags:
比較全的SQL注入相關(guān)的命令分享上一篇:對(duì)XmlHttp研究的經(jīng)驗(yàn)分享 下一篇: 非數(shù)據(jù)庫(kù)實(shí)現(xiàn)數(shù)據(jù)對(duì)象的實(shí)例及說(shuō)明
[收藏此文章]