Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2016-5699 PoC — Python 注入漏洞

Source
Associated Vulnerability
Title:Python 注入漏洞 (CVE-2016-5699)
Description:CRLF injection vulnerability in the HTTPConnection.putheader function in urllib2 and urllib in CPython (aka Python) before 2.7.10 and 3.x before 3.4.4 allows remote attackers to inject arbitrary HTTP headers via CRLF sequences in a URL.
Description
Reading Course Report
Readme
# cve-2016-5699-report
Reading Course Report

This repo references an [example](https://github.com/bunseokbot/CVE-2016-5699-poc).

`simple-client.py` is a Python script to make HTTP requests to the URL passed from a command argument.  
`simple-server.py` uses Flask to construct a simple HTTP server to print the headers of received requests.

## Set Up
* Install virtualenv, `pip install virtualenv`
* Get two versions of Python for comparison, one before 2.7.10, the other after 2.7.10. This [link](http://mbless.de/blog/2016/01/09/upgrade-to-python-2711-on-ubuntu-1404-lts.html) might be useful.
* Create two Python environments with `virtualenv`. For example:
  * `virtualenv -p [path_to_one_Python_version] venv-one-version`
  * `virtualenv -p [path_to_the_other_Python_version] venv-the-other-version`
* Install `flask` in both environments. Activate corresponding environment, and `pip install flask`

## Run
* Choose the version you want to use, activate using `source ./venv-one-version/bin/activate`
* To start the server, simply run `python simple-server.py`
* To run the client:
  * run `python simple-client.py http://127.0.0.1:8000/test-url` for healthy URL
  * run `python simple-client.py http://127.0.0.1%0d%0aX-injected:%20header%0d%0ax-leftover:%20:8000/test-url` for malicious URL

## References:
* http://blog.blindspotsecurity.com/2016/06/advisory-http-header-injection-in.html
* https://github.com/bunseokbot/CVE-2016-5699-poc
* https://hg.python.org/cpython/rev/1c45047c5102
File Snapshot

[4.0K] /data/pocs/0ede2ed18eae4f2d5b11d517774a164b9d7ca623 ├── [526K] CVE_2016_5699_Report.pdf ├── [1.5K] README.md ├── [ 350] simple-client.py └── [ 323] simple-server.py 0 directories, 4 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →