Categories
How-To Software Technical

Using netcat to print header info from web browsers

You can identify what information is sent from the browser to the remote web server using a Linux tool called netcat (nc). Netcat is often referred to as a “Swiss-army knife for TCP/IP”. Its list of features includes port scanning, transferring files, and port listening, and it can be used as a backdoor.

Simply run netcat in listing mode on your desired port. Example: nc -l 8080. You can then point to address of this system http://ip_address:port and netcat will display the values received.

The following are some example of the output:

Google Chrome – Version 27.0.1453.116m:

GET / HTTP/1.1
Host: 10.255.255.10:8080
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8

 

Internet Explorer 10 – Version 10.0.9200.16599

GET / HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: en-US
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
Accept-Encoding: gzip, deflate
Host: 10.255.255.10:8080
DNT: 1
Connection: keep-alive

 

Firefox – Version 21.0

GET / HTTP/1.1
Host: 10.255.255.10:8080
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive

 

Google Chrome (Android) – Version 27.0.1453.90

GET / HTTP/1.1
Host: 10.255.255.10:8080
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Linux; Android 4.2.2; SAMSUNG-SGH-I337 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.90 Mobile Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8