π Download with Bash using /dev/tcp
Stuck on a minimal Linux system with no wget
, no curl
, no nc
? π±
Don't panic β as long as you have Bash v2.04+, you can use the hidden power of:
π /dev/tcp
β Bashβs Built-in Networking Superpower!
/dev/tcp
β Bashβs Built-in Networking Superpower!If Bash was compiled with --enable-net-redirections
(which most modern ones are), you can use it to connect to IPs and ports β and even download files!
π Step 1: Connect to the Webserver
Use the exec
command to open a TCP connection to your target:
π This opens a bidirectional connection (read & write) to port 80 and assigns it to file descriptor 3.
π₯ Step 2: Send an HTTP GET Request
Now send a basic HTTP request for the file you want (e.g., LinEnum.sh
):
π‘ -e
allows escape sequences like to simulate Enter.
π¬ This sends your GET request over the connection.
π Step 3: Read and Print the Response
Now print the serverβs response using cat
:
π¨οΈ This reads the incoming response (which includes both headers + file content).
π‘ Pro Tip: Save to File
If you want to save the file instead of printing it:
Last updated