Wget Cheat Sheet

  



Jul 11, 2019 Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects. SQL Injection Login Bypass Cheat Sheet You can use the following cheat sheet on login forms for bypassing authentication proccess. I recommend you to use this cheat sheet with the Burp Suite Intruder Module.

Often you may want to put a file onto a target, this can be useful to move exploits onto the target amongst other things. Most of these techniques can be used in reverse to exfiltrate data as well

Using wget

Cheat

A common method uses wget to pull the files from a web server

Wget cheatsheet 📅 2016-Jan-22 ⬩ ️ Ashwin Nanjappa ⬩ 🏷️ cheatsheet, wget ⬩ 📚 Archive. To download a URL: $ wget urltodownload. It writes to the current directory with a filename same as in the URL. To download a URL, but write to a specific filename: $ wget -O writetothisfile urltodownload. $ http POST name='John' Host:example.com — JSON, cookies, files, auth, and other httpie examples. One-page guide to httpie.

Params

Examples

Servers Expose Files

When you want to expose a file from your machine to wget you may want to enable a HTTP server on your machine to expose the files

Apache Server

Kali comes with an apache2 server pre-installed, it can be activated using the following command

then files within /var/www/html can be accessed on port 80 of your IP address

Python HTTP Server

Python can also provide a http server

This will expose the directory the command is run within and any sub directories as a web server

Params
Examples

Using Netcat

An alternative option is to use netcat to transfer the file as raw data

Reverse Connection

This uses a similar principle to a reverse shell, firstly you run open a listener on your machine, feeding in the file you wish to transfer, then on the target you connect back to the listener, sending the output to a file

Setting The Listener

Params
Examples

Triggering The Transfer

Params
Wget
Examples

Using SCP

If you have ssh credentials for the target, and an open ssh port you can use scp to transfer files

Using Username:Password Combo

When using this command you will prompted for the accounts password

Params

Chmod Cheat Sheet

Examples

Using SSH Key

Wget Cheat Sheet

Params

Examples


  • PDF Link: cheatsheet-curl-A4.pdf, Category: Tools
  • Blog URL: https://cheatsheet.dennyzhang.com/cheatsheet-curl-A4
  • Related posts: CheatSheet: shell, #denny-cheatsheets

Yahoo Fantasy Football Cheat Sheets

File me Issues or star this repo.

1.1 Curl Get/Head

NameCommand
Curl head requestcurl -I https://www.google.com
Curl head request with verbosecurl -v -I https://www.google.com
Curl with explicit http methodcurl -X GET https://www.google.com
Curl without http proxycurl --noproxy 127.0.0.1 http://www.stackoverflow.com
Curl has no timeout by defaultcurl --connect-timeout 10 -I -k https://www.google.com
Curl get with extra headerscurl --verbose --header 'Host: www.mytest.com:8182' www.google.com
Curl get response with headerscurl -k -v https://www.google.com

1.2 Curl POST

NameCommand
Curl post requestcurl -d 'name=username&password=123456' <URL>
Curl post send jsoncurl <URL> -H 'content-type: application/json' -d '{ 'woof': 'bark'}'

1.3 Curl Advanced

NameCommand
Get my public ipcurl -L -s http://ipecho.net/plain, curl -L -s http://whatismijnip.nl
Curl with credentialcurl -u $username:$password http://repo.dennyzhang.com/README.txt
Curl uploadcurl -v -F key1=value1 -F upload=@localfilename <URL>
Install curl in alpine linuxapk add --update curl
Curl with http2curl -k -v --http2 https://www.google.com/
Curl ftp uploadcurl -T cryptopp552.zip -u test:test ftp://10.32.99.187/
Curl ftp downloadcurl -u test:test ftp://10.32.99.187/cryptopp552.zip -o cryptopp552.zip
Curl upload with credentialcurl -v -u admin:admin123 --upload-file package1.zip http://mysever:8081/dir/package1.zip

1.4 Curl Script

NameCommand
Install packages with curlcurl-install-package.sh
Check a website response timecurl-url-time.sh
Beautify json output for curl responsecurl-format-json.sh
Curl run remote scriptscurl-remote-scripts.sh

1.5 Wget

NameCommand
Download one urlwget -O /tmp/google.html https://google.com
Download mutiple urlswget https://google.com https://bing.com
Download a list of urlswget -i url-list.txt, url-list.txt

Wget Pdf

1.6 More Resources

Wget Cheat Sheet 2019

License: Code is licencurl under MIT License.