fork of six-ddc/httpflow on github
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
2.6 KiB

7 years ago
# httpflow
7 years ago
[![Build Status](https://travis-ci.org/six-ddc/httpflow.svg?branch=master)](https://travis-ci.org/six-ddc/httpflow)
7 years ago
![](https://github.com/six-ddc/httpflow/blob/master/demo.gif?raw=true)
## Installation
7 years ago
### MacOs
7 years ago
```bash
7 years ago
brew update
brew install httpflow
```
### Linux
7 years ago
Forests oneliner for debian / ubuntu
3 years ago
```
apt-get install -y g++ libpcap-dev zlib1g-dev libpcre3 libpcre3-dev && git clone https://git.sequentialread.com/forest/httpflow && cd httpflow && make && make install
3 years ago
```
Forests oneliner for alpine linux
```
apk update && apk add make g++ libpcap-dev zlib-dev pcre pcre-dev && git clone https://git.sequentialread.com/forest/httpflow && cd httpflow && make && make install
```
3 years ago
* Install [zlib](http://www.zlib.net/), [pcap](http://www.tcpdump.org/), [pcre](http://pcre.org/)
7 years ago
7 years ago
```bash
7 years ago
## On CentOS
7 years ago
yum update
yum install libpcap-devel zlib-devel pcre-devel
7 years ago
7 years ago
## On Ubuntu / Debian
apt-get update
apt-get install libpcap-dev zlib1g-dev libpcre3 libpcre3-dev
7 years ago
```
7 years ago
* Building httpflow
7 years ago
```bash
> git clone https://github.com/six-ddc/httpflow
> cd httpflow && make && make install
```
or directly download [Release](https://github.com/six-ddc/httpflow/releases) binary file.
## Usage
7 years ago
```
7 years ago
libpcap version libpcap version 1.8.1 -- Apple version 67.60.1
7 years ago
httpflow version 0.0.5
7 years ago
7 years ago
Usage: httpflow [-i interface | -r pcap-file] [-f packet-filter] [-u url-filter] [-w output-path]
7 years ago
7 years ago
-i interface Listen on interface
-r pcap-file Read packets from file (which was created by tcpdump with the -w option)
Standard input is used if file is '-'
-f packet-filter Selects which packets will be dumped
If filter expression is given, only packets for which expression is 'true' will be dumped
For the expression syntax, see pcap-filter(7)
-u url-filter Matches which urls will be dumped
-w output-path Write the http request and response to a specific directory
7 years ago
For more information, see https://github.com/six-ddc/httpflow
7 years ago
```
* Capture default interface
```bash
> httpflow
```
* Capture all interfaces
```bash
> httpflow -i any
```
* Use the expression to filter the capture results
```bash
# If no expression is given, all packets on the net will be dumped.
# For the expression syntax, see pcap-filter(7).
> httpflow -f 'tcp port 80 and host baidu.com'
```
7 years ago
7 years ago
* Use the regexp to filter request urls
7 years ago
```bash
> httpflow -u '(google.com|httpbin.org)/.*/get'
```
7 years ago
* Read packets from file
```bash
# tcpdump -w a.cap
> httpflow -r a.cap
```
7 years ago
* Read packets from input
```bash
7 years ago
> tcpdump -w - | httpflow -r -
7 years ago
```