mqtt_pwn.shell.mixins package

Submodules

mqtt_pwn.shell.mixins.back module

class mqtt_pwn.shell.mixins.back.BackMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

Back Mixin Class

back_parser = ArgumentParser(prog='back', usage=None, description='Deselect a variable like current_victim or current_scan...', formatter_class=<class 'argparse.ArgumentDefaultsHelpFormatter'>, conflict_handler='error', add_help=True)
do_back(args)[source]

usage: back [-h] {victim,scan}

Deselect a variable like current_victim or current_scan…

positional arguments:
{victim,scan}
optional arguments:
-h, --help show this help message and exit

mqtt_pwn.shell.mixins.bruteforce module

class mqtt_pwn.shell.mixins.bruteforce.BruteforceMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

Bruteforce Mixin Class

bt_parser = ArgumentParser(prog='bruteforce', usage=None, description='Bruteforce credentials of the connected MQTT broker', formatter_class=<class 'argparse.ArgumentDefaultsHelpFormatter'>, conflict_handler='error', add_help=True)
do_bruteforce(args)[source]
usage: bruteforce [-h] [–host HOST] [–port PORT] [-u USERNAME [USERNAME …]
-uf USERNAMES_FILE] [-p PASSWORD [PASSWORD …] | -pf

PASSWORDS_FILE]

Bruteforce credentials of the connected MQTT broker

optional arguments:
-h, --help show this help message and exit
--host HOST host to connect to (default: test.mosquitto.org)
--port PORT port to use (default: 1883)
-u USERNAME [USERNAME …], –username USERNAME [USERNAME …]
the username to probe the broker with (can be more than one, separated with spaces) (default: None)
-uf USERNAMES_FILE, –usernames-file USERNAMES_FILE
use a usernames file instead (usernames separated with a newline) (default: /home/docs/checkouts/readthedocs.org/user_builds/mqtt- pwn/checkouts/latest/docsresources/wordlists/usernames .txt)
-p PASSWORD [PASSWORD …], –password PASSWORD [PASSWORD …]
the password to probe the broker with (can be more than one, separated with spaces) (default: None)
-pf PASSWORDS_FILE, –passwords-file PASSWORDS_FILE
use a password file instead (passwords separated with a newline) (default: /home/docs/checkouts/readthedocs.org/user_builds/mqtt- pwn/checkouts/latest/docsresources/wordlists/passwords .txt)
pass_group = <argparse._MutuallyExclusiveGroup object>
user_group = <argparse._MutuallyExclusiveGroup object>

mqtt_pwn.shell.mixins.commands module

class mqtt_pwn.shell.mixins.commands.CommandsMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

Commands Mixin Class

commands_parser = ArgumentParser(prog='commands', usage=None, description='Show commands that were executed on the current victim', formatter_class=<class 'argparse.ArgumentDefaultsHelpFormatter'>, conflict_handler='error', add_help=True)
do_commands(args)[source]

usage: commands [-h] [-i ID]

Show commands that were executed on the current victim

optional arguments:
-h, --help show this help message and exit
-i ID, --id ID show only a specific command id (default: None)

mqtt_pwn.shell.mixins.connect module

class mqtt_pwn.shell.mixins.connect.ConnectMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

Connect Mixin Class

connect_parser = ArgumentParser(prog='connect', usage=None, description='Connect to an MQTT broker', formatter_class=<class 'argparse.ArgumentDefaultsHelpFormatter'>, conflict_handler='error', add_help=True)
disconnect_parser = ArgumentParser(prog='nnection_required', usage=None, description='Disconnect from an MQTT broker', formatter_class=<class 'argparse.ArgumentDefaultsHelpFormatter'>, conflict_handler='error', add_help=True)
do_connect(args)[source]
usage: connect [-h] [-o HOST] [-p PORT] [-u USERNAME] [-w PASSWORD]
[-t TIMEOUT]

Connect to an MQTT broker

optional arguments:
-h, --help show this help message and exit
-o HOST, --host HOST
 host to connect to (default: test.mosquitto.org)
-p PORT, --port PORT
 port to use (default: 1883)
-u USERNAME, --username USERNAME
 username to authenticate with (default: None)
-w PASSWORD, --password PASSWORD
 password to authenticate with (default: None)
-t TIMEOUT, --timeout TIMEOUT
 connection timeout (default: 60)
do_disconnect(**kwargs)

usage: nnection_required [-h]

Disconnect from an MQTT broker

optional arguments:
-h, --help show this help message and exit

mqtt_pwn.shell.mixins.discover module

class mqtt_pwn.shell.mixins.discover.DiscoveryMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

Discovery Mixin Class

discover_parser = ArgumentParser(prog='discovery', usage=None, description='Discover new topics/messages in the current connected broker', formatter_class=<class 'argparse.ArgumentDefaultsHelpFormatter'>, conflict_handler='error', add_help=True)
do_discovery(args)[source]

usage: discovery [-h] [-t TIMEOUT] [-p TOPICS [TOPICS …]] [-q QOS]

Discover new topics/messages in the current connected broker

optional arguments:
-h, --help show this help message and exit
-t TIMEOUT, --timeout TIMEOUT
 for how long to discover (default: 60)
-p TOPICS [TOPICS …], –topics TOPICS [TOPICS …]
which topics to listen to (default: [‘$SYS/#’, ‘#’])
-q QOS, --qos QOS
 which quality of service (default: 0)

mqtt_pwn.shell.mixins.execute module

class mqtt_pwn.shell.mixins.execute.ExecuteMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

Execute Mixin Class

do_exec(args)[source]

usage: exec [-h] …

The Execute function method

positional arguments:
command the command to execute on the current victim
optional arguments:
-h, --help show this help message and exit
execute_parser = ArgumentParser(prog='exec', usage=None, description='The Execute function method', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)

mqtt_pwn.shell.mixins.messages module

class mqtt_pwn.shell.mixins.messages.MessagesMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

Messages Mixin Class

do_messages(args)[source]
usage: messages [-h] [-e] [-i INDEX] [-j] [-s] [-l LIMIT] [-mr MESSAGE_REGEX]
[-tr TOPIC_REGEX] [-c]

List Messages that were detected through discovery scans

optional arguments:
-h, --help show this help message and exit
-e, --export export the search results

Single Message Arguments

-i INDEX, --index INDEX
 show a message based on an ID
-j, --json-prettify
 JSON prettify the message body

Multi Message Arguments

-s, --show-only-labeled
 show only labeled topics
-l LIMIT, --limit LIMIT
 get the first X rows
-mr MESSAGE_REGEX, –message-regex MESSAGE_REGEX
search for a pattern in the message body
-tr TOPIC_REGEX, –topic-regex TOPIC_REGEX
search for a pattern in the topic name
-c, --case-sensitive
 make the regex search case sensitive (default is case insensitive)
messages_parser = ArgumentParser(prog='messages', usage=None, description='List Messages that were detected through discovery scans', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
multi_message_group = <argparse._ArgumentGroup object>
single_message_group = <argparse._ArgumentGroup object>

mqtt_pwn.shell.mixins.owntracks module

class mqtt_pwn.shell.mixins.owntracks.OwnTracksMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

OwnTracks Mixin Class

do_owntracks(args)[source]

usage: owntracks [-h] [-u USER] [-d DEVICE]

Owntracks shares publicly their users coordinates. Simply discover some topics, choose that scan and pick a user+device to look for.

optional arguments:
-h, --help show this help message and exit
-u USER, --user USER
 user to find owntracks coordinates
-d DEVICE, --device DEVICE
 device to find owntracks coordinates
owntracks_parser = ArgumentParser(prog='owntracks', usage=None, description='Owntracks shares publicly their users coordinates. Simply discover some topics, choose that scan and pick a user+device to look for.', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)

mqtt_pwn.shell.mixins.scans module

class mqtt_pwn.shell.mixins.scans.ScansMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

Scans Mixin Class

do_scans(args)[source]

usage: scans [-h] [-i ID] [-t]

The Scans function method

optional arguments:
-h, --help show this help message and exit
-i ID, --id ID select a specific scan by id
-t, --tail show only the tail of the scans table
scans_parser = ArgumentParser(prog='scans', usage=None, description='The Scans function method', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)

mqtt_pwn.shell.mixins.sonoff module

class mqtt_pwn.shell.mixins.sonoff.SonoffMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

Sonoff Mixin Class

do_sonoff(args)[source]

usage: sonoff [-h] [-p PREFIX] [-t TIMEOUT]

Sonoff devices tend to share certain information on demand. This module looks for those pieces of information actively.

optional arguments:
-h, --help show this help message and exit
-p PREFIX, --prefix PREFIX
 the topic prefix of the sonoff device (default: sonoff/)
-t TIMEOUT, --timeout TIMEOUT
 for how long to listen (default: 10)
sonoff_parser = ArgumentParser(prog='sonoff', usage=None, description='Sonoff devices tend to share certain information on demand. This module looks for those pieces of information actively.', formatter_class=<class 'argparse.ArgumentDefaultsHelpFormatter'>, conflict_handler='error', add_help=True)

mqtt_pwn.shell.mixins.system_info module

class mqtt_pwn.shell.mixins.system_info.SystemInfoMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

Scans Mixin Class

do_system_info(_)[source]

usage: system_info [-h]

The System Information function method

optional arguments:
-h, --help show this help message and exit
system_info_parser = ArgumentParser(prog='system_info', usage=None, description='The System Information function method', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)

mqtt_pwn.shell.mixins.topics module

class mqtt_pwn.shell.mixins.topics.TopicsMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

Topics Mixin Class

do_topics(args)[source]

usage: topics [-h] [-e] [-s] [-l LIMIT] [-r REGEX] [-c]

List topics that were detected through discovery scans

optional arguments:
-h, --help show this help message and exit
-e, --export export the search results
-s, --show-only-labeled
 show only labeled topics
-l LIMIT, --limit LIMIT
 get the first X rows
-r REGEX, --regex REGEX
 search for a pattern in the topic name
-c, --case-sensitive
 make the regex search case sensitive (default is case insensitive)
topics_parser = ArgumentParser(prog='topics', usage=None, description='List topics that were detected through discovery scans', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)

mqtt_pwn.shell.mixins.victims module

class mqtt_pwn.shell.mixins.victims.VictimsMixin[source]

Bases: mqtt_pwn.shell.base.BaseMixin

Victims Mixin Class

do_victims(args)[source]

usage: victims [-h] [-i ID]

The Victims function method

optional arguments:
-h, --help show this help message and exit
-i ID, --id ID select a specific victim by id
victims_parser = ArgumentParser(prog='victims', usage=None, description='The Victims function method', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)

Module contents