top of page
Search
  • Writer's pictureotw

Linux Basics for Hackers, Part 14: Using the curl command to Download Web Site Source Code

Updated: Dec 28, 2022

Welcome back my aspiring cyber warriors!


Now that you have mastered the Basics of Linux, let's begin looking at some of the more esoteric but equally powerful Linux commands for the hacker.One of those key commands is curl or client URL. This command enables the Linux user to send and receive to a specified URL, among other things. This can be especially useful in downloading web site source code for analysis in your lab.


Step #1: curl help


Let's begin by looking at the curl help screen.


kali > curl -h



To see a more complete help screen, you can enter curl --help all.


In it's simplest form, curl simply targets a URL and then downloads its contents and displays it to your screen (standard output). Let's see what it can do when we use https://hackers-arise.com as our target.


kali > curl https://hackers-arise.com



As you can see, nothing happened. This is because the default settings in curl do not allow for a re-direct. Apparently, hackers-arise.com has a re-direct, so curl simply executes without downloading any data. We can enable re-directs in curl by using curl with the -L switch.


Let's try it again with the -L switch and see whether we get any output.


kali > curl -L https://hackers-arise.com

As you can see below, curl gathered all the source code from the URL and displays it to my screen (stdout).


This output is not very convenient for analysis. It would be much better and easier to work with to have the output sent to a text file. Let's try sending the output from this website to a file.


To do so, we use the -o switch followed by the file name where we want the code stored. In this case, I entered;


kali > curl -L -o hackers_website.html https://hackers-arise.com

This time, curl displays a table and progress bar as it downloads the contents of the page. Now when we open that file with the more command, we can see the contents of that page.


kali > more hackers_website.html



Step #3: Using curl Anonymously


In some cases, we may want to gather data or source code anonymously. In that case, we can use a proxy in our curl command to send the command through a specified proxy such as:


kali > curl -x <proxy IP>:<proxy port> <target URL>


To access hackers-arise.com source code anonymously from a proxy at 45.169.148.11 using port 999, we can simply enter;


kali > curl -x 45.169.148.11:999 -L https://hackers-arise.com



Step #4: Using curl to Send Data


In addition to pulling data from URL's, curl can also push data to URL's. For instance, the website textbelt.com allows you to send data to their service in order to send fake SMS messages. In this case, we can use curl to send both the phone number and the message to their site and they will send the fake text message to the target such as;


kali > sudo curl -X POST https://textbelt.com/text --data-urlencode phone='12152749318' --data-urlencode message='Hurry to St. Thomas Hospital! Your wife has been in a terrible accident!' -d key=<API key>



For more on sending fake SMS messages, go to How To Create a Fake SMS.


Summary


curl is one of those commands in Linux that is often overlooked by beginners but can be a powerful tool in the hands of an experienced Linux user. Is is capable of both sending and receiving data across the Internet and a few minutes invested in learning it subtleties will pay big dividends. Probably it widest use among hackers is downloading source code from web sites for analysis.

6,712 views14 comments

Recent Posts

See All

14 Comments


astriddavina54
astriddavina54
Jan 03, 2023

I’m excited to write about Henry Hacker, he is a great and brilliant hacker who penetrated my spouse’s phone without a physical installation app. And I was able to access my spouse’s phone, SMS, Whatsapp, Instagram, Facebook, Wechat, Snapchat, Call Logs, Kik, Twitter and all social media. The most amazing thing there is that he restores all phone deleted text messages. And I also have access to everything including the phone gallery without touching the phone.I can see the whole secret of my spouse. Contact him for any hacking service. He is also a genius in repairing Credit Score, increasing school grade, Clear Criminal Record etc. His service is fast. Contact:, Henryclarkethicalhacker@gmail.com and on whatsapp him on +1262-236-7526...


Like

Hire a professional cell Phone Hacker who has the skills that can grant you remotely access to your spouse cell phone and grant access to cheating spouse cell phone information on their cell phone. He can also use he skills to spy on other people’s cell phones device. It is also known as a cell phone spy who are capable to provide you all you require to infiltrate any type of smartphone and iPhone. I was able to got access to partner iPhone, the job was prefect to the extended he didn’t knowing anything about it, was so prefect you can conatct him via kelvinethicalhacker @ gmail. com. reach to him to help spy on your cheating spouse...

Like

Hi everyone... I am Mike Luciano and I’m so addicted to winning the lottery. I’ve just scooped my FOURTH jackpot of $1million – taking my total winnings to $4.6million through the help of one legit spell caster named Dr Amber. My first ever win was $100,000. Last year, I won $500,000 from the Pennsylvania state lottery and I also won $3 million in 2016 bringing the grand total of my winnings to $4.6 million. All my winnings have been made possible with the numbers given to me by Dr Amber. I've been so blessed, winning big three times in my lifetime. His spell casting is unique and safe unlike some fake spell casters that are just after your money without…

Like

REAL LOVE SPELLS THAT WORK FAST +27787390989, AND DONE WORK OR SPELLS, LOST LOVE SPELL CASTING, HERBAL TREATMENT, INSTANT MONEY SPELLS, GET PROMOTIONAL AT WORK, WIN LOTTO, JACK POTS, POWER BALL IN SOUTH AFERICA, TIN GIN DEBT SPELLS, MAGIC WALLETS, SPIRITUAL / TRADITIONAL HEALER, WHITE MAGIC LOVE SPELLS, FREE RED CANDLE SPELLS, BLACK MAGIC SPELLS, VOODOO LOVE SPELLS, THE FORGIVE SPELLS, BREAK UP SPELLS, GOOD LUCK SPELLS, WICCA LOVE THE REMOVAL SPELLS CURSE, GAY LOVE SPELLS, REAL MAGIC SPELLS, WITCH DOCTOR, FERTILITY SPELLS, BIND US TOGETHER, REMOVING CURSES, BUSINESS SPELLS, THE SPELLS TO DEFEAT YOUR ENEMIES, AFRICAN MAGIC, FREE BUSINESS SPELLS, LOVE SPELLS, PH MARRIAGE SPELLS, STOP DIVORCE SPELLS, SANGOMA, HEX REMOVAL, LUCK CHARM, MENS ERECTION HERBALS,whataspp : +27787390989, E-mail…

Like

REAL LOVE SPELLS THAT WORK FAST +27787390989, AND DONE WORK OR SPELLS, LOST LOVE SPELL CASTING, HERBAL TREATMENT, INSTANT MONEY SPELLS, GET PROMOTIONAL AT WORK, WIN LOTTO, JACK POTS, POWER BALL IN SOUTH AFERICA, TIN GIN DEBT SPELLS, MAGIC WALLETS, SPIRITUAL / TRADITIONAL HEALER, WHITE MAGIC LOVE SPELLS, FREE RED CANDLE SPELLS, BLACK MAGIC SPELLS, VOODOO LOVE SPELLS, THE FORGIVE SPELLS, BREAK UP SPELLS, GOOD LUCK SPELLS, WICCA LOVE THE REMOVAL SPELLS CURSE, GAY LOVE SPELLS, REAL MAGIC SPELLS, WITCH DOCTOR, FERTILITY SPELLS, BIND US TOGETHER, REMOVING CURSES, BUSINESS SPELLS, THE SPELLS TO DEFEAT YOUR ENEMIES, AFRICAN MAGIC, FREE BUSINESS SPELLS, LOVE SPELLS, PH MARRIAGE SPELLS, STOP DIVORCE SPELLS, SANGOMA, HEX REMOVAL, LUCK CHARM, MENS ERECTION HERBALS,whataspp : +27787390989, E-mail…

Like
bottom of page