Skip to content

Instantly share code, notes, and snippets.

@vestjoe
vestjoe / minis_logo.png
Last active September 26, 2017 17:29
logo
minis_logo.png
# Basic IPTABLES Template Script
# Author: Joe Vest, Andrew Chiles
# NOTES:
# Description:
# Template script to protect C2 infrastructure
# Parameter Reference:
# TARGET_RANGE1 - IPs allowed only to ALLOWED_PORTS
# ALLOWED_PORTS - port allowed from the TARGET_RANGE1
# TEAM_RANGE1 - IPs allowed to connect to all ports
@vestjoe
vestjoe / Shenanigans.md
Created July 4, 2018 09:42
Silly commands to for shenanigans

Image File Execution Options - DOS

Notepad bomb

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /t REG_SZ /v Debugger /d "cmd.exe /c echo Come at me bro... && start C:\windows\notepad.exe&" /f

Explorer Bomb

SSHFS

sshfs is a filesystem based on the SSH file transfer protocol. It can be very useful to stand up an ADHOC file repository.

Reference:

http://www.ubuntux.org/fuse-sshfs/

Installation (Debian/Ubuntu)

Misc persistence techniques

Set User SPN for future kerberoast attacks

Set a SPN on a user account to provide to regain password to account that was changed.

Example

setspn -S MSSQLSvc/myhost.redmond.microsoft.com:1433 redmond\accountname  

Colors

println("\c0 \\c0 = White");
println("\c1 \\c1 = Inverted Highlighted Text"); # You can't see on dark backgrounds
println("\c2 \\c2 = Dark Blue");
println("\c3 \\c3 = Green");
println("\c4 \\c4 = Pink");
println("\c5 \\c5 = Red");
println("\c6 \\c6 = Purple");

Pyinstaller

python -m PyInstaller --onefile <script.py>

PowerShell.md

PowerShell commandline history

Get-PSReadlineOption | Select-Object -ExpandProperty HistorySavePath | Get-ChildItem | Get-Content

Screenshot