curl is an open source http scripting tool that can be used to make/ gets the data. it sends data and it retrieves the information.
curl --trace-ascii d.txt --trace-time http://thetechiehouse.blogspot.com/
curl -o blog.html http://thetechiehouse.blogspot.com/
http authentication curl --user name:password http://www.google.com
post curl --data "birthyear=1905&press=%20OK%20" http://www.example.com/when.cgi
post curl --data "birthyear=1905&press=%20OK%20" http://www.example.com/when.cgi
curl --basic --user-agent “<user_agent>" —<user_name>:<pwd> "<url>"
curl -i
-H "Accept: application/json"
-H "Content-Type: application/x-www-form-urlencoded"
-H "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
-X POST "http://www.mysite.com/form" -d"param1=val1"
Getting data from secured service:
curl -H
"Authorization: Bearer <service_auth_token>" 'secured_service_Url'
Getting IP configuration
ipconfig//win
ifconfig// mac
Querying DNS to get IP address mapping
nslookup google.com
network statistics
netstat -n
TCP packet dump
tcpdump -l -x
tcpdump allows us to save the packets that are captured, so that we can use it for future analysis. The saved file can be viewed by the same tcpdump command.
nslookup google.com
dig google.com
curl google.com
curl -L -V google.com
curl-L google.com
curl for sftp:
curl -k ---user user:pwd sftp://abc.com/path
ping vs curl
Ping only checks if the remote host is answering ICMP packets, which (usually) means it's up and running;- This doesn't give you any information about which services the host is actually offering.
An HTTP GET request checks that there is a web server running on the host, that it answers to a given IP/port/hostname combo
that you asked it for a valid URL and that the web site is able to answer your request.
If IIS (or Apache) is stopped on the host, it will very well answer a Ping request, but a HTTP GET will fail.
No comments:
Post a Comment