HTTP Header Injection Discovery method (with case)

Source: Internet
Author: User
Tags get ip

0x0: Overview

Author: Dark Month Blog: www.moonsec.com

With regard to this type of injection, the traditional web vulnerability scanner is basically for get/post injection .

The detection of this type of injection becomes powerless.

0x01: Discover

0x01.1: Common HTTP may be contaminated with these parameters

    • User-agent browser version (less)
    • Referer Source (less)
    • X-forwarded-for get IP (High)
    • CLIENT_IP get IP (High)

0x01.2: Discovery Tools

The author uses the Firefox browser to demonstrate first install the browser add-ons modify headers after installation Restart Firefox Select Web Development Selection tool, the following settings:

Need to detect user-agent Referre is also how to set, select Start to determine the browser will load these parameters every time you visit the site.

0x01.3: Vulnerability Discovery

There is a loophole here is usually logged in, there is a place to record browser information, according to the author of the past audit loopholes and fuzzy testing when the presence of IP records found in a particular place.

0X0.14: Vulnerability Code

Function getip () {    if (getenv (' http_client_ip '))    {        $ip = getenv (' http_client_ip ');    }       ElseIf (getenv (' http_x_forwarded_for '))    {//Get the real IP address of the client when accessing the proxy server        $ip = getenv (' http_x_forwarded_for ');    }    ElseIf (getenv (' http_x_forwarded '))    {        $ip = getenv (' http_x_forwarded ');    }    ElseIf (getenv (' http_forwarded_for '))    {        $ip = getenv (' http_forwarded_for ');    }    ElseIf (getenv (' http_forwarded '))    {        $ip = getenv (' http_forwarded ');    }    else    {        $ip = $_server[' remote_addr ');    }    return $IP;}

0x01.5: Vulnerability Demo

HTTP_CLIENT_IP first CLIENT_IP not get to select the X-forwarded-for diagram in Http_forwarded_for:

0x02 Case Reference:

    1. Penetration DZ Official website
    2. BLUECMS Injection Vulnerability

HTTP Header Injection Discovery method (with case)

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.