Curl

Rachmani3652

Active Member
Joined
Jun 16, 2020
Messages
154
Reaction score
54
Credits
1,026
Can anyone on here help me with installing and running curl? I've been searching Google and Youtube. I type in 'curl ipinfo.io/ (ip address goes here)' but it doesn't work for me. Everything is updated. I just get a bunch of mumbo jumbo on the screen when I type in the command. I want to find a url or websites location.
 


ok curl is basically about playing with http requests.

first thing you do is clarify your set up:

With no sudo in command what is output typing in a command line of :

whereis curl

which curl


i am more than certain you have it all aready. Because its a command line that does not render , html output response can seem a bit "large" sometimes.

Here is how i used it simply :

bash-5.0$ curl -i -L http://slackware.com
// this one shows there is a lot of use of tables in the html doc

now run this command:

curl -i -L http://slackware.com > /home/$(whoami)/Desktop/info.html

go to your Desktop and right click on info.html open with firefox or something


because kali is a child of Debian most of Debian are available

eg type:
sudo apt --help
 
Can anyone on here help me with installing and running curl? I've been searching Google and Youtube. I type in 'curl ipinfo.io/ (ip address goes here)' but it doesn't work for me. Everything is updated. I just get a bunch of mumbo jumbo on the screen when I type in the command. I want to find a url or websites location.
How to Install Curl
 
From what I can see @Rachmani3652 isn’t having problems installing curl, it seems he is using curl to access the API for a website called ipinfo.io, in order to look up information about a server using its IP address.

But he doesn’t seem to be able to interpret/understand the information it’s sending back.

However - as the OP is running Kali - if curl is NOT already installed, it should just be a case of running apt install curl if running as root. Or sudo apt install curl if running as an ordinary user. I seem to recall reading that the newer versions of Kali no longer run as root by default.

Anyway - assuming that installing curl is not the problem, lets try using ipinfo.io's API with curl. I took a quick look at the documentation on the ipinfo.io website:

From looking at that, it looks like all that's needed is:
curl ipinfo.io/{server IP}

It also mentions providing an authentication key. But I don't have an API key for ipinfo.io, and I'm not signing up for one for the sake of providing an answer here. So I'll simply pass the IP without an auth token.

I know that the IPV4 for one of OpenDNS's nameservers is 208.67.222.222.
So let's look up some information about that IP using the following curl command:
Bash:
curl ipinfo.io/208.67.222.222

Using the above, I get the following response:
Code:
{
  "ip": "208.67.222.222",
  "hostname": "resolver1.opendns.com",
  "city": "Cincinnati",
  "region": "Ohio",
  "country": "US",
  "loc": "39.1271,-84.5144",
  "org": "AS36692 Cisco OpenDNS, LLC",
  "postal": "45219",
  "timezone": "America/New_York",
  "readme": "https://ipinfo.io/missingauth"
}

Hmm, seems perfectly fine! Lets try the IPV6 address of one of OpenDNS's servers - 2620:119:35::35:
Bash:
curl ipinfo.io/2620:119:35::35

Which yields:
Code:
{
  "ip": "2620:119:35::35",
  "city": "San Francisco",
  "region": "California",
  "country": "US",
  "loc": "37.7621,-122.3971",
  "org": "AS36692 Cisco OpenDNS, LLC",
  "postal": "94107",
  "timezone": "America/Los_Angeles",
  "readme": "https://ipinfo.io/missingauth"
}

So where is the problem?! It all seems pretty straightforward to me!

File this one under PICNIC. (Problem In Chair, Not In Computer) ha ha!
 
This is what I get:
 

Attachments

  • Screenshot_2020-07-13_04-16-50.png
    Screenshot_2020-07-13_04-16-50.png
    122.6 KB · Views: 415
W
From what I can see @Rachmani3652 isn’t having problems installing curl, it seems he is using curl to access the API for a website called ipinfo.io, in order to look up information about a server using its IP address.

But he doesn’t seem to be able to interpret/understand the information it’s sending back.

However - as the OP is running Kali - if curl is NOT already installed, it should just be a case of running apt install curl if running as root. Or sudo apt install curl if running as an ordinary user. I seem to recall reading that the newer versions of Kali no longer run as root by default.

Anyway - assuming that installing curl is not the problem, lets try using ipinfo.io's API with curl. I took a quick look at the documentation on the ipinfo.io website:

From looking at that, it looks like all that's needed is:
curl ipinfo.io/{server IP}

It also mentions providing an authentication key. But I don't have an API key for ipinfo.io, and I'm not signing up for one for the sake of providing an answer here. So I'll simply pass the IP without an auth token.

I know that the IPV4 for one of OpenDNS's nameservers is 208.67.222.222.
So let's look up some information about that IP using the following curl command:
Bash:
curl ipinfo.io/208.67.222.222

Using the above, I get the following response:
Code:
{
  "ip": "208.67.222.222",
  "hostname": "resolver1.opendns.com",
  "city": "Cincinnati",
  "region": "Ohio",
  "country": "US",
  "loc": "39.1271,-84.5144",
  "org": "AS36692 Cisco OpenDNS, LLC",
  "postal": "45219",
  "timezone": "America/New_York",
  "readme": "https://ipinfo.io/missingauth"
}

Hmm, seems perfectly fine! Lets try the IPV6 address of one of OpenDNS's servers - 2620:119:35::35:
Bash:
curl ipinfo.io/2620:119:35::35

Which yields:
Code:
{
  "ip": "2620:119:35::35",
  "city": "San Francisco",
  "region": "California",
  "country": "US",
  "loc": "37.7621,-122.3971",
  "org": "AS36692 Cisco OpenDNS, LLC",
  "postal": "94107",
  "timezone": "America/Los_Angeles",
  "readme": "https://ipinfo.io/missingauth"
}

So where is the problem?! It all seems pretty straightforward to me!

File this one under PICNIC. (Problem In Chair, Not In Computer) ha ha!
Wait it's working now! It wasn't for a minute. Maybe because I just updated and upgraded.
 
This is what I get:

::facepalm::

OK, I think you're a bit confused about what curl is for.
Curl is a tool for sending http requests.
You can use it to send queries to web-sites/web-services to get information back.

So for example to see a weather forecast in the terminal you can use:
Bash:
curl wttr.in
And based on your IP - that will try to determine your location and return the weather for your local area.

And if it returns the weather for the wrong area you can try:
Bash:
curl wttr.in/location
Where location is a place-name. If the place name has more than one word, enclose the location in double quotes e.g. "New York"
e.g.
Bash:
curl wttr.in/"New York"

From your original post - the ipinfo.io website is what gives you information about IP addresses. You can use curl to send a request to ipinfo.io about a particular IP address and it should return you some information about that IP.

Where you have used curl -L google.com in your previous post - you're just getting the entire HTML code for the google.com front-page. That's why you're seeing what seems to be nonsense!

Does that make sense now?


Wait it's working now! It wasn't for a minute. Maybe because I just updated and upgraded.

No, it was always working correctly - you were just using it incorrectly! Ha ha! XD Curl hasn't changed much in the last 20 years or so!
 

Staff online

Members online


Top