Brief description: by default, the upload. asp file in the background is restricted only to asp | aspx | php | jsp | asa | shtml | html | htm | js | vbs.
Detailed description:
<! -- # Include file = "../inc/upload. asp" -->
<Html>
<Head>
<Meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<Title> upload a file </title>
<Style>
* {Margin: 0px; padding: 0px ;}
Body {
Font-size: 12px;
}
. Border {
Font-size: 12px;
Border: #000 solid 1px;
}
</Style>
<Link rel = "stylesheet" rev = "stylesheet" href = "images/css.css" type = "text/css" media = "all"/>
</Head>
Www.2cto.com
<Body leftmargin = 0 topmargin = 0>
<%
Dim go: go = Request. QueryString ("go ")
If Request. QueryString ("action") = "upload" Then
Set upload = new my_upload
Dim filepath
Filepath = trim (upload. form ("filepath "))
For each formName in upload. File
Set file = upload. File (formName)
Dim o, txt, FileExt: FileExt = file. FileExt
Txt = Split ("asp | aspx | php | jsp | asa | shtml | html | htm | js | vbs", "| ")
For o = 0 To UBound (txt)
If InStr (LCase (FileExt), txt (o) <> 0 Then
Response. write "<script> alert ('your upload format is incorrect! '); Location. href = 'up. asp'; </script>"
Response. end
End if
Next
We can upload cer, ashx, and other files.
Solution: Modify the source code to only allow uploading images or adding vulnerability files
Author's dog-like man @ wooyun