Git Product home page Git Product logo

httpdump's Introduction

httpdump

前提条件:

  • go开发环境
  • Linux安装libpcap-devel库

构建

git clone https://github.com/jiangyd/httpdump.git
cd httpdump
go build httpdump.go

查看使用说明

$ ./httpdump --help
Usage of ./httpdump:
  -dev string
        interface example: eth0 (default "any")
  -ip string
        source ip or dst ip
  -methods string
        methods name example: GET or GET|POST
  -path string
        url request path
  -port string
        src port or dst port

例子

$ sudo ./httpdump -methods "GET|POST" -port 6442 -path "/test/.*"
bpf filter: tcp port 6442 and ( tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x48545450 or tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420 or tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354  )




172.16.10.244:51106->172.16.5.9:6442(tarp)

GET /test/cc HTTP/1.1
Host: 172.16.5.9:6442
User-Agent: curl/7.43.0
Accept: */*




172.16.5.9:6442(tarp)->172.16.10.244:51106

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 20 Jul 2021 10:08:40 GMT
Content-Length: 169

{"body":"","cookies":[],"headers":{"Accept":["*/*"],"User-Agent":["curl/7.43.0"]},"method":"GET","params":[{"Key":"anypath","Value":"/cc"}],"path":"/test/cc","query":""}

问题

  • 当使用-path过滤时,请求可以过滤,但是响应内容暂时无法过滤

httpdump's People

Contributors

jiangyd avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.