Xingwang interactive Upload Vulnerability Analysis

Source: Internet
Author: User

 

Author: a man like a dog

Upfile_flash.asp

 

######################################## ######################################## ########################

 

<%

Set upload = new upload_file

If upload. form ("act") = "uploadfile" then

Filepath = trim (upload. form ("filepath "))

Filelx = trim (upload. form ("filelx "))

 

I = 0

For each formName in upload. File

Set file = upload. File (formName)

 

The file extension obtained by fileExt = lcase (file. FileExt) 'does not include.

If file. filesize <100 then

Response. write "select the file you want to upload first! [Re-upload]"

Response. end

End if

If (filelx <> "swf") and (filelx <> "jpg") then

Response. write "this file type cannot be uploaded! [Re-upload]"

Response. end

End if

If filelx = "swf" then

If fileext <> "swf" then

Response. write "Only Flash files in swf format can be uploaded! [Re-upload]"

Response. end

End if

End if

If filelx = "jpg" then

If fileext <> "gif" and fileext <> "jpg" and fileext <> "swf" then

Response. write "only jpg/gif/swf images can be uploaded! [Re-upload]"

Response. end

End if

End if

If filelx = "swf" then

If file. filesize> (3000*1024) then

Response. write "a maximum of 3 MB of Flash files can be uploaded! [Re-upload]"

Response. end

End if

End if

If filelx = "jpg" then

If file. filesize> (1000*1024) then

Response. write "up to www.2cto.com can only upload 1000 K image files! [Re-upload]"

Response. end

End if

End if

 

Randomize

RanNum = int (90000 * rnd) + 10000

Filename = filepath & year (now) & month (now) & day (now) & hour (now) & minute (now) & second (now) & ranNum &". "& fileExt

%>

<%

If file. FileSize> 0 then "if FileSize> 0, file data exists.

'File. SaveAs Server. mappath (filename) "save the file

File. SaveToFile Server. mappath (FileName)

'Response. write file. FileName & 'is uploaded successfully!

"

'Response. write "new file name:" & FileName &"

"

'Response. write "the new file name has been copied to the desired location. Close the window !"

If filelx = "swf" then

Response. write ""

End if

Response. write ""

%>

<%

End if

Set file = nothing

Next

Set upload = nothing

End if

%>

######################################## ######################################## ########################

 

Upload directly with kiddie

Www.2cto.com:

The above analysis is detailed. Fix it by yourself.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.