Summary of Kali curl command


brief introduction

curlIs a command-line tool, the role is to issue network requests, and then get and extract data, displayed in the “stdout” above.

It supports multiple protocols

View the source code of the webpage

Add the URL directly after the curl command, you can see the source of the web page.

$ curl

Display header information

-iParameter can display the header information of HTTP response together with the web page code

$ curl -i

-IThe parameter displays only the header information of HTTP response

Display communication process

-vParameters can display the whole process of an HTTP communication, including port connection and HTTP request header information.

$ curl -v

See more detailed communication process: $curl — trace output.txt Or $curl — trace ASCII output.txt

After running, open output.txt File view

Send form information

There are two ways to send form information: get and post. The get method is relatively simple, as long as the data is attached to the web address

$ curl

The post method must separate the data from the web address, and curl uses the — data parameter

$ curl -d “param1=value1&m2=value2” “

Or useWGet command

wget –post-data “user=foo&password=bar”

Add header information

Sometimes you need to add a header in HTTP request.--headerParameters can do this.

$ curl –header “Content-Type:application/json”

$ curl –local-port 51 port 51 to access this website locally