Saturday, March 19, 2016

Unix sniff network traffic on specific port with tcpflow

Install it : sudo apt-get install tcpflow
Run the command on console : sudo tcpflow -i any -C -J port 1234


sunels@sunels:~$ sudo tcpflow -i any -C -J port 8888
tcpflow: listening on any




GET /hi?name=serkan, HTTP/1.1
Host: localhost:8888
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/48.0.2564.116 Chrome/48.0.2564.116 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8


HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=UTF-8
Content-Length: 18
Date: Sat, 19 Mar 2016 20:22:39 GMT


Hi there, serkan,!