My understanding of cURL

Note : In this I will be using kali-linux and metasploitable3 . It is recommended to setup your lab by downloading both , before following the blog. 


cURL ( yes , you are right it is Client URL ) 

It is a tiny and simple command line tool that lets you talk to any website without even touching browser . Most beginners, including me, eventually make up using it. We use it for automation and small scripts. Because it's simple , fast and works with almost all the protocols you will ever meet .

    Today, in this blog we will be seeing about accessing HTTP and basic HTTPS . Initial steps are same for both these protocols with a minute difference later . With HTTPS, the server may redirect you, so curl -L helps follow redirects.

Setting up Metasploitable3 for cURL 

We use Metasploitable3 because it has many intentionally vulnerable services to test against. To do so we need it's IP address . 

Steps to get IP address

1) Login in into your metasploitable3 . Admin - vagrant ; Password - vagrant
2) Run ifconfig and note the  inet address under eth0


Starting with cURL 

We have done a good chunk of work by just knowing the metaspolitable3 IPv4 address . Now , we need to move on to cURL who is the actual hero 😎 of our blog . 

Steps to follow 

1) Log into Kali (username: kali, password: kali, unless you changed it). .
2) Access the terminal and type 

 ping -c 3 192.168.182.131 

We used this command to verify that whether the host is live or not . You can see the result 3 packets received transmitted , 3 received which means host is up and can listen to our commands . 

3) Now we will use the actual cURL  type 


curl 192.168.182.131


The output you see is a raw html response from the metasploitable3 server. 


Note : You can also type the domain name of any website if you want to .Type the following command:

 curl  https://example.com


Note: If you see a lot of certificate errors and warnings no need to worry. We will cover this later . 

To access any page (not api) you need to know the exact location of the page on the website . Then you can run the following commands : 

curl 192.168.182.131/chat/ 


This will help you access the chat page in metasploitable3 




You can open this url in you firefox also .We will end up this blog here and come back tomorrow with something new about curl and we will try to cover up web request topic in this week . Till then keep learning and keep hunting . Do share if you know something extra with us in comments section . 

Comments

Popular posts from this blog

Obfuscation and Deobfuscation

OSINT Basics: Introduction, Scope, and Ethical Boundaries (Part 1)

Cybersecurity Devices and Technologies Part 1