Skip to content

Instantly share code, notes, and snippets.

View zeroSteiner's full-sized avatar

Spencer McIntyre zeroSteiner

View GitHub Profile
@zeroSteiner
zeroSteiner / rdesktop-gui
Last active January 24, 2024 20:28
Python rdesktop GUI
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# rdesktop-gui
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
@zeroSteiner
zeroSteiner / _msfconsole
Last active February 22, 2023 10:09
ZSH completions for Metasploit Utilities
#compdef msfconsole
# ------------------------------------------------------------------------------
# Copyright (c) 2014 Spencer McIntyre
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@zeroSteiner
zeroSteiner / zpycompletion.py
Created April 2, 2021 00:23
ZSH completion from argparse
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# zpycompletion
#
# Copyright 2015 Spencer McIntyre <zeroSteiner@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
@zeroSteiner
zeroSteiner / log_handler.py
Last active April 6, 2022 19:14
Python logging.Handler for use in external Metasploit modules.
import logging
import metasploit.module as module
class MetasploitLogHandler(logging.Handler):
def emit(self, record):
log_entry = self.format(record)
level = 'debug'
if record.levelno >= logging.ERROR:
level = 'error'
elif record.levelno >= logging.WARNING:
@zeroSteiner
zeroSteiner / cli_mailer.py
Last active January 27, 2022 00:36
King Phisher CLI Mail Utility
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tools/cli_mailer.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
@zeroSteiner
zeroSteiner / safeseh_inspect.py
Created December 16, 2014 18:20
Safe Exception Handler Analysis Tool
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# safeseh_inspect.py
#
# Copyright 2014 Spencer McIntyre
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#!/usr/bin/env ruby
# meterpreter_command_scanner.rb
#
# This script is used for analyzing Metasploit Framework library and module source code files to identify references to
# the Meterpreter API. Originally implemented in support of https://github.com/rapid7/metasploit-framework/pull/15079.
#
require 'find'
# These are ignored because they do not invoke a Meterpreter command.
@zeroSteiner
zeroSteiner / pyenv-each
Created March 17, 2021 21:03
Python test harness
#!/usr/bin/env bash
set -e
py_stdout_fd=1
py_stderr_fd=2
delay=0
timeout=10
params=()
show_help () {
@zeroSteiner
zeroSteiner / bt_shell.py
Last active February 24, 2021 06:13
Python Bluetooth shell with PTY support
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# bt_shell.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@zeroSteiner
zeroSteiner / Proxy Shim
Created August 12, 2020 18:13
Example of a proxy shim for external Metasploit modules
if __name__ == "__main__":
env = dict(os.environ)
if 'LD_PRELOAD' in env:
module.run(metadata, run)
else:
env['LD_PRELOAD'] = 'libproxychains4.so'
os.execve(os.path.realpath(__file__), sys.argv, env)