SQL Injection After BBSXP

Source: Internet
Author: User

Vulnerability Analysis

Order:
There is a movie named "all-in-one killer". The hero in the play is real. I like his personality very much!
He is very cool, I like! I don't know if you have watched this movie?
However, the story I want to explain today finds that it is a very common SQL penetration attack on the Internet. It is also the most basic.
The process is as follows:
1. Identify and analyze vulnerabilities.
2. Use the vulnerability to obtain the front-end head password.
3. Use the vulnerability to obtain the background password.
4. Add an announcement, pop-up!

Start work:

Download the latest bbsxp from the official bbsxp website.

Step 1: locate the vulnerability and analyze the vulnerability. This vulnerability exists in the asp file favorites. asp in the add to favorites function.
// *************************** Source code ************ ***************************************//
<%

If request. cookies ("username") = "" then
Error ("
You have not logged on to the community ")
End if

Select case request ("menu ")
Case "add"
If request. servervariables ("request_method") = "post" then
Url = request ("url ")
Else
Url = request. servervariables ("http_referer ")
End if
Conn.exe cute ("insert into favorites (username, name, url) values (" & request. cookies ("username") & "," & request ("name") & "," & url &")")
Error2 ("added to network favorites! ")

Case "del"
Conn.exe cute ("delete from [favorites] where username =" & request. cookies ("username") & "and id =" & request ("id ")&"")
End select
***** ***************************//

When you see the code, you must first register and use this function.
Then, the parameters submitted in this asp file include menu and id.
Let's take a look. When the submitted menu is del. Haha! What is called? It has vulnerabilities. Where is the vulnerability?
Conn.exe cute ("delete from [favorites] where username =" & request. cookies ("username") & "and id =" & request ("id ")&"")
The submitted id value is not filtered and directly added to the SQL statement.

  • 1
  • 2
  • Next Page
[Content navigation]
Page 1: Vulnerability Analysis Page 1: Attack demonstration

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.