<%@LANGUAGE="VBSCRIPT"%>
<%
dim csmi,mdb,sfqczx,qjsjbz
mdb="KB2012.mdb"
csmi = "2342346666"
sfqczx = "2"
qjsjbz = "{[good-piao]}"
%>
<% if rose(request("p")) = "1" then %>
<%
ling=dosql()
ling=now() & qjsjbz & ling
ling=wen(ling)
%>
<% = ling %>
<% elseif rose(request("p")) = "2" then %>
<%
piao= getstr()
piao= now() & qjsjbz & piao
piao= wen(piao)
%>
<% = piao %>
<% elseif rose(request("p")) = "3" then %>
<% = wen(plfhq(rose(request("f")))) %>
<% elseif rose(request("p")) = "4" then %>
<%
if sfqczx="1" then
plzx()
end if
pdrose=pdsql()
pdrose=now() & qjsjbz & pdrose
pdrose=wen(pdrose)
%>
<% = pdrose %>
<% elseif rose(request("p")) = "5" then %>
<%
plpo=plfp(rose(request("us")),rose(request("mi")),ys(request("m5i")))
plpo=now() & qjsjbz & plpo
plpo=wen(plpo)
%>
<% = plpo %>
<% elseif rose(request("p")) = "6" then %>
<%
pldong=pldt(rose(request("u3")),rose(request("m3")),ys(request("s3")))
pldong=now() & qjsjbz & pldong
pldong=wen(pldong)
%>
<% = pldong %>
<% else %>
<% = wen("-1") %>
<% end if %>
<%
Function getstr()
set conn = Server.CreateObject("ADODB.Connection")
on error resume next 
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdb)
if err then 
getstr="1"  '数据库不存在
exit Function
end if
set rs = Server.CreateObject("ADODB.Recordset")
sqi = ys(request("post"))
rs.Open sqi, conn, 3
if err then 
getstr="2"  'SQL语句出错
exit Function
end if
rs.MoveFirst
For Each varItem In rs.Fields 
getstr = getstr & varItem.name & "々"
Next 
getstr = getstr & "☆" 
Do While NOT rs.EOF
For Each varItem In rs.Fields 
getstr = getstr & varItem.value & "々" 
Next 
getstr = getstr & "☆" 
rs.MoveNext 
Loop 
Set rs = Nothing 
set conn = Nothing
End Function
%>
<%
Function dosql()
set conn = Server.CreateObject("ADODB.Connection")
on error resume next 
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdb)
if err then 
dosql="1"   '数据库不存在
exit Function
end if
set rs = Server.CreateObject("ADODB.Recordset")
sqi = ys(request("post"))
rs.Open sqi, conn, 3
if err then 
dosql="2"   'SQL语句出错
exit Function
end if
Set rs = Nothing 
set conn = Nothing
dosql = 6
End Function
%>
<%
Function pdsql()
set conn = Server.CreateObject("ADODB.Connection")
on error resume next 
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdb)
if err then 
pdsql="1"  '数据库不存在
exit function
end if
set rs = Server.CreateObject("ADODB.Recordset")
sqi=ys(request("post"))
rs.open sqi,conn,1,1
if err then 
pdsql="2"  'SQL语句出错
exit Function
end if
if rs.bof and rs.eof then
rs.close
conn.close
set rs=nothing
set conn=nothing
pdsql="no"
exit Function
else
rs.close
conn.close
set rs=nothing
set conn=nothing
pdsql="ok"
end if
end Function
%>
<%
Function ys(w)
dim fen,shi,shu
fen=split(rose(w),"{[good-rose]}")
shi=formatdatetime(fen(0),0)
if datediff("s",shi,time()) < 90 then 
shu=fen(1)
Else
shu="3"  '命令超时
end if
ys=shu
End Function
%>
<%
Function wen(a)
dim q, fe, fq, shu, tioe
fe = 1
for q = 1 to len(a)
fq = cint(mid(csmi,fe,1))+1
shu =hex(asc(mid(a,q,1)) xor fq)
if len(shu)=4 then
tioe=tioe & cstr(shu)
else
tioe=tioe & "00" & cstr(shu)
end if
if fe < len(csmi) Then
fe = fe + 1
Else
fe=1
End If
next
wen=tioe
End Function
%>
<%
function rose(x)
dim  xun, disc, ism
xun=1
for i=1 to len(x) step 4
ism=cint(mid(csmi,xun,1))+1
disc=disc & chr(int("&H" & mid(x,i,4))xor ism)
if xun < len(csmi) Then
xun=xun + 1
else
xun=1
end if
next
rose=disc
end function
%>
<%
function plzx()
dim fen,shi,shu,miao,zong
fen=split(time(),":")
shi=fen(0)*60*60
shu=fen(1)*60
miao=fen(2)
zong=shi+shu+miao
set conn = Server.CreateObject("ADODB.Connection")
on error resume next 
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdb)
set rs=createobject("ADODB.recordset")
if err then 
rs.Close
Set rs = Nothing 
conn.Close
set conn = Nothing
exit Function
end if
set rs = Server.CreateObject("ADODB.Recordset")
sqi = "update admin set zaixian=2 where "&zong&"- jubing > 305 or jubing -"&zong&" > 305"
rs.Open sqi,conn,1,3
if err then 
rs.Close
Set rs = Nothing 
conn.Close
set conn = Nothing
exit Function
end if
rs.Close
Set rs = Nothing 
conn.Close
set conn = Nothing
plzx = 0
End Function
%>
<%
Function plfp(u,m,m5)
dim dqi, tez
set conn = Server.CreateObject("ADODB.Connection")
on error resume next 
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdb)
if err then 
plfp="|1|"  '数据库不存在
exit function
end if
set rs = Server.CreateObject("ADODB.Recordset")
sqi="select * from sys where gongneng='md5' and zhuangtai='" & m5 & "'"
rs.open sqi,conn,1,1
if rs.bof and rs.eof then
  rs.Close
  conn.Close
  set rs=nothing
  set conn=nothing
  plfp="|2|"  'md5错误
else
  rs.Close
  sqk="select * from admin where use='" & u & "' and pass='" & m & "'"
  rs.open sqk,conn,1,1
  if rs.bof and rs.eof then
   rs.Close
   conn.Close
   set rs=nothing
   set conn=nothing
   plfp="|3|"  '账号密码错误
  else
    rs.Close
    sqly="select * from sys where gongneng='tzsj'"
    rs.open sqly,conn,1,1
    if rs.bof and rs.eof then
     rs.close
     conn.close
     set rs=nothing
     set conn=nothing
     plfp="|5|"  '特征数据不存在
    else
     tez=rs("zhuangtai")
     rs.close
     conn.close
     set rs=nothing
     set conn=nothing
     plfp=tez
    end if    
  end if
end if
end function
%>
<%
Function pldt(u2,m2,s2)
dim dqi, tez
set conn = Server.CreateObject("ADODB.Connection")
on error resume next 
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdb)
if err then 
pldt="|1|"  '数据库不存在
exit function
end if
set rs = Server.CreateObject("ADODB.Recordset")
sqi="select * from sys where gongneng='dtyz' and zhuangtai='1'"
rs.open sqi,conn,1,1
if rs.bof and rs.eof then
  rs.Close
  conn.Close
  set rs=nothing
  set conn=nothing
  pldt="|2|"  '未开启动态验证
else
  rs.Close
  sqk="select * from admin where use='" & u2 & "' and pass='" & m2 & "'"
  rs.open sqk,conn,1,1
  if rs.bof and rs.eof then
   rs.Close
   conn.Close
   set rs=nothing
   set conn=nothing
   pldt="|3|"  '账号密码错误
  else
    rs.Close
    conn.close
    set rs=nothing
    set conn=nothing
    pldt=s2
  end if
end if
end function
%>
<%
Function plfhq(f2)
IPString = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If IPString = "" Then
IPString = Request.ServerVariables("REMOTE_ADDR")
End If
set conn = Server.CreateObject("ADODB.Connection")
on error resume next
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdb)
if err then 
plfhq="1"  '数据库不存在
exit function
end if
set rs = Server.CreateObject("ADODB.Recordset")
sqi="select * from safe where ip='" & IPString & "' and lx='1'"
rs.open sqi,conn,1,1
if rs.bof and rs.eof then
  rs.Close
  sqk="select * from safe where ip='" & f2 & "' and lx='2'"
  rs.open sqk,conn,1,1
  if rs.bof and rs.eof then
    rs.Close
    conn.Close
    set rs=nothing
    set conn=nothing
    plfhq=now() & qjsjbz & IPString
  else
    rs.Close
    conn.Close
    set rs=nothing
    set conn=nothing
    plfhq="11"  '机器码被封
  end if
else
  rs.Close
  conn.close
  set rs=nothing
  set conn=nothing
  plfhq="12"  'IP被封
end if
end function
%>