Cheatsheet

Curl Commands

Syntax & Examples:

curl google.com

-retrieves homepage

curl -O google.com/something.txt

-save output to file

curl -L google.com

- Follows redirects

curl -A "Mozilla/5.0 etc " https://google.com

-Changes the User-Agent

curl -X GET https://www.google.com

-Explicit http method

curl --noproxy 127.0.0.1 http://google.com

-No http proxy

curl -k -v https://google.com

- Get response with a header

curl -I https://www.google.com

- Head request

curl -d "name=username&password=abc" https://www.google.com

-Post request

curl -u $username:$password http://google.com

- with credentials


Using Curl for FTP:

curl -u FTP_Username:FTP_PW ftp://google.com

-Access to FTP

curl -u FTP_Username:FTP_PW ftp://google.com/file.zip

-Download a file from FTP

curl -T    -u FTP_UN:FTP_PW ftp://ftp.google.com 

 - Upload a file to the ftp server 



Netcat

Basics:

File transfer:

Banner Grab:

Port Scanner:

Backdoor Shells:

Options:

-l  = listen

-u = udp

-p = port

-e = execute

-n = no dns lookup

-z = packet without data is sent

-v = verbose


Relays:

Linux systems

start by creating a FIFO (named pipe) called mypipe

Listener to client relay:

nc -l -p<port> 0<mypipe | nc <targetIP> <port> | tee mypipe

Listener to listener relay:

nc -l -p <localport> 0<mypipe | nc -l -p <localport2> | tee mypipe

Client to client relay:

nc <previousHOP-ip> <port> 0<mypipe | nc <nexHOP-ip> <port2> | tee mypipe

Windows systems

enter a temp directory, from where we create .exe files

Listener to client relay:

Listener to listener relay:

Client to client relay: