Javasgod free enterprise website creation system without verification add administrator practice and message book XSS Vulnerability (including repair)

Source: Internet
Author: User

① Add an administrator without verification
② Message book XSS Vulnerability
Detailed Description: ① add an administrator without verification
Vulnerability file: Admin_Add.asp
Vulnerability code:
<! -- # Include file = ".../../config/conn. asp" -->
<! -- # Include file = "md5.asp" -->

<%
If request. QueryString ("action") = "save" then

Uid = replace (trim (Request ("uid ")),"'","")
Realname = replace (trim (Request ("realname ")),"'","")
Pwd1 = replace (trim (Request ("pwd1 ")),"'","")
Pwd2 = replace (trim (Request ("pwd2 ")),"'","")
Password = md5 (pwd1)

Cause: data is written directly without verification.

Scheme: Construct a URL

Http: // localhost/source/admin/Admin_Add.asp? Action = save & uid = test & realname = test & pwd1 = 123456 & pwd2 = 123456

In this way, you can add an administrator account whose account is test and password is 123456.
② Message book XSS Vulnerability
Vulnerability file: Message. asp
Vulnerability code:
If request. QueryString ("action") = "save" then
Username = trim (request ("username "))
Email = trim (request ("email "))
Tel = trim (request ("tel "))
Zhiwu = trim (request ("zhiwu "))
City = trim (request ("city "))
Qq = trim (request ("qq "))
Add = trim (request ("add "))
Title = trim (request ("title "))
Content = trim (request ("content "))
Messageip = Request. ServerVariables ("REMOTE_ADDR ")
Set rs = server. CreateObject ("adodb. recordset ")
Rs. open "select * from pai_message", conn, 1, 3

Cause: If not filtered, the backend can still execute

 

Proof of vulnerability:



The website is an official demonstration site and has the same vulnerability.

Repair solution:

Add judgment code
If session ("admin") = "" then
Response. Write "<script language = 'javascript '> alert ('network timed out or you have not logged on yet! '); Window. location. href = 'login. asp'; </script>"
Response. End
End if

Add and filter message books

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.