首页 > 系统相关 >resurfaceio gor linux 二进制包

resurfaceio gor linux 二进制包

时间:2024-03-05 13:22:07浏览次数:23  
标签:http -- linux raw input output gor resurfaceio

resurfaceio的gor 是对于开源版本的修改 (比如开启了企业特性,同时添加了对于resurfaceio http output 的支持),为了方便对于linux 系统的使用
我拉取了官方镜像,将二进制文件放到github 了https://github.com/rongfengliang/resurfaceio-gor

支的命令

 
Gor is a simple http traffic replication tool written in Go. Its main goal is to replay traffic from production servers to staging and dev environments.
Project page: https://github.com/buger/gor
Author: <Leonid Bugaev> [email protected]
Current Version: v1.4.3-Resurface
 
  -copy-buffer-size value
        Set the buffer size for an individual request (default 5MB)
  -cpuprofile string
        write cpu profile to file
  -exit-after duration
        exit after specified duration
  -http-allow-header value
        A regexp to match a specific header against. Requests with non-matching headers will be dropped:
             gor --input-raw :8080 --output-http staging.com --http-allow-header api-version:^v1
  -http-allow-method value
        Whitelist of HTTP methods to replay. Anything else will be dropped:
            gor --input-raw :8080 --output-http staging.com --http-allow-method GET --http-allow-method OPTIONS
  -http-allow-url value
        A regexp to match requests against. Filter get matched against full url with domain. Anything else will be dropped:
             gor --input-raw :8080 --output-http staging.com --http-allow-url ^www.
  -http-basic-auth-filter value
        A regexp to match the decoded basic auth string against. Requests with non-matching headers will be dropped:
             gor --input-raw :8080 --output-http staging.com --http-basic-auth-filter "^customer[0-9].*"
  -http-disallow-header value
        A regexp to match a specific header against. Requests with matching headers will be dropped:
             gor --input-raw :8080 --output-http staging.com --http-disallow-header "User-Agent: Replayed by Gor"
  -http-disallow-url value
        A regexp to match requests against. Filter get matched against full url with domain. Anything else will be forwarded:
             gor --input-raw :8080 --output-http staging.com --http-disallow-url ^www.
  -http-header-limiter value
        Takes a fraction of requests, consistently taking or rejecting a request based on the FNV32-1A hash of a specific header:
             gor --input-raw :8080 --output-http staging.com --http-header-limiter user-id:25%
  -http-original-host
        Normally gor replaces the Host http header with the host supplied with --output-http.  This option disables that behavior, preserving the original Host header.
  -http-param-limiter value
        Takes a fraction of requests, consistently taking or rejecting a request based on the FNV32-1A hash of a specific GET param:
             gor --input-raw :8080 --output-http staging.com --http-param-limiter user_id:25%
  -http-pprof :8181
        Enable profiling. Starts  http server on specified port, exposing special /debug/pprof endpoint. Example: :8181
  -http-rewrite-header value
        Rewrite the request header based on a mapping:
            gor --input-raw :8080 --output-http staging.com --http-rewrite-header Host: (.*).example.com,$1.beta.example.com
  -http-rewrite-url value
        Rewrite the request url based on a mapping:
            gor --input-raw :8080 --output-http staging.com --http-rewrite-url /v1/user/([^\/]+)/ping:/v2/user/$1/ping
  -http-set-header value
        Inject additional headers to http request:
            gor --input-raw :8080 --output-http staging.com --http-set-header 'User-Agent: Gor'
  -http-set-param value
        Set request url param, if param already exists it will be overwritten:
            gor --input-raw :8080 --output-http staging.com --http-set-param api_key=1
  -input-dummy value
        Used for testing outputs. Emits 'Get /' request every 1s (default [])
  -input-file value
        Read requests from file:
            gor --input-file ./requests.gor --output-http staging.com (default [])
  -input-file-dry-run
        Simulate reading from the data source without replaying it. You will get information about expected replay time, number of found records etc.
  -input-file-loop
        Loop input files, useful for performance testing.
  -input-file-max-wait duration
        Set the maximum time between requests. Can help in situations when you have too long periods between request, and you want to skip them. Example: --input-raw-max-wait 1s
  -input-file-read-depth int
        GoReplay tries to read and cache multiple records, in advance. In parallel it also perform sorting of requests, if they came out of order. Since it needs hold this buffer in memory, bigger values can cause worse performance (default 100)
  -input-kafka-host string
        Send request and response stats to Kafka:
            gor --output-stdout --input-kafka-host '192.168.0.1:9092,192.168.0.2:9092'
  -input-kafka-json-format
        If turned on, it will assume that messages coming in JSON format rather than  GoReplay text format.
  -input-kafka-mechanism string
        mechanism
            gor --input-raw :8080 --output-kafka-mechanism 'SCRAM-SHA-512'
  -input-kafka-password string
        password
            gor --input-raw :8080 --output-kafka-password 'password'
  -input-kafka-topic string
        Send request and response stats to Kafka:
            gor --output-stdout --input-kafka-topic 'kafka-log'
  -input-kafka-use-sasl
        use-sasl
            --use-sasl true
  -input-kafka-username string
        username
            gor --input-raw :8080 --output-kafka-username 'username'
  -input-raw value
        Capture traffic from given port (use RAW sockets and require *sudo* access):
            # Capture traffic from 8080 port
            gor --input-raw :8080 --output-http staging.com (default [])
  -input-raw-allow-incomplete
        If turned on Gor will record HTTP messages with missing packets
  -input-raw-bpf-filter string
        BPF filter to write custom expressions. Can be useful in case of non standard network interfaces like tunneling or SPAN port. Example: --input-raw-bpf-filter 'dst port 80'
  -input-raw-buffer-size value
        Controls size of the OS buffer which holds packets until they dispatched. Default value depends by system: in Linux around 2MB. If you see big package drop, increase this value.
  -input-raw-buffer-timeout duration
        set the pcap timeout. for immediate mode don't set this flag
  -input-raw-engine libpcap
        Intercept traffic using libpcap (default), `raw_socket`, `pcap_file`, `vxlan`
  -input-raw-expire duration
        How much it should wait for the last TCP packet, till consider that TCP message complete. (default 2s)
  -input-raw-ignore-interface value
        In case if you want listen for all interfaces except a few ones. Can be used in k8s environment. Example: --input-raw-ignore-interface cbr0 --input-raw-ignore-interface eth0 --input-raw-ignore-interface localhost (default [])
  -input-raw-k8s-nomatch-nocap
        disable port-only capture mode when no matching pods are found in the cluster
  -input-raw-k8s-skip-ns value
        skip k8s these namespaces for discovery. Example: --input-raw-k8s-skip-ns kube-system (default [])
  -input-raw-k8s-skip-svc value
        skip k8s these services for discovery. Example: --input-raw-k8s-skip-svc kubernetes (default [])
  -input-raw-monitor
        enable RF monitor mode
  -input-raw-override-snaplen
        Override the capture snaplen to be 64k. Required for some Virtualized environments
  -input-raw-promisc
        enable promiscuous mode
  -input-raw-protocol value
        Specify application protocol of intercepted traffic. Possible values: http, binary
  -input-raw-realip-header string
        If not blank, injects header with given name and real IP value to the request payload. Usually this header should be named: X-Real-IP
  -input-raw-stats
        enable stats generator on raw TCP messages
  -input-raw-timestamp-type string
        Possible values: PCAP_TSTAMP_HOST, PCAP_TSTAMP_HOST_LOWPREC, PCAP_TSTAMP_HOST_HIPREC, PCAP_TSTAMP_ADAPTER, PCAP_TSTAMP_ADAPTER_UNSYNCED. This values not supported on all systems, GoReplay will tell you available values of you put wrong one.
  -input-raw-track-response
        If turned on Gor will track responses in addition to requests, and they will be available to middleware and file output.
  -input-raw-vlan
        Enable VLAN (802.1Q) support
  -input-raw-vlan-vid value
        VLAN VID to capture. By default capture all VIDs (default [])
  -input-raw-vxlan-port vxlan
        VXLAN port. Can be used only when engine set to vxlan. Default: 4789 (default 4789)
  -input-raw-vxlan-vni --input-raw-vxlan-vni -2
        VXLAN VNI to capture. By default capture all VNIs. Ignore VNI by setting them with minus sign, example: --input-raw-vxlan-vni -2 (default [])
  -input-tcp value
        Used for internal communication between Gor instances. Example:
            # Receive requests from other Gor instances on 28020 port, and redirect output to staging
            gor --input-tcp :28020 --output-http staging.com (default [])
  -input-tcp-certificate string
        Path to PEM encoded certificate file. Used when TLS turned on.
  -input-tcp-certificate-key string
        Path to PEM encoded certificate key file. Used when TLS turned on.
  -input-tcp-secure
        Turn on TLS security. Do not forget to specify certificate and key files.
  -kafka-tls-ca-cert string
        CA certificate for Kafka TLS Config:
            gor  --input-raw :3000 --output-kafka-host '192.168.0.1:9092' --output-kafka-topic 'topic' --kafka-tls-ca-cert cacert.cer.pem --kafka-tls-client-cert client.cer.pem --kafka-tls-client-key client.key.pem
  -kafka-tls-client-cert string
        Client certificate for Kafka TLS Config (mandatory with to kafka-tls-ca-cert and kafka-tls-client-key)
  -kafka-tls-client-key string
        Client Key for Kafka TLS Config (mandatory with to kafka-tls-client-cert and kafka-tls-client-key)
  -memprofile string
        write memory profile to this file
  -middleware string
        Used for modifying traffic using external command
  -output-binary value
        Forwards incoming binary payloads to given address.
            # Redirect all incoming requests to staging.com address
            gor --input-raw :80 --input-raw-protocol binary --output-binary staging.com:80 (default [])
  -output-binary-debug
        Enables binary debug output.
  -output-binary-timeout duration
        Specify HTTP request/response timeout. By default 5s. Example: --output-binary-timeout 30s
  -output-binary-track-response
        If turned on, Binary output responses will be set to all outputs like stdout, file and etc.
  -output-binary-workers int
        Gor uses dynamic worker scaling by default.  Enter a number to run a set number of workers.
  -output-file value
        Write incoming requests to file:
            gor --input-raw :80 --output-file ./requests.gor (default [])
  -output-file-append
        The flushed chunk is appended to existence file or not.
  -output-file-buffer string
        The path for temporary storing current buffer:
            gor --input-raw :80 --output-file s3://mybucket/logs/%Y-%m-%d.gz --output-file-buffer /mnt/logs (default "/tmp")
  -output-file-flush-interval duration
        Interval for forcing buffer flush to the file, default: 1s. (default 1s)
  -output-file-max-size-limit value
        Max size of output file, Default: 1TB
  -output-file-queue-limit int
        The length of the chunk queue. Default: 256 (default 256)
  -output-file-size-limit value
        Size of each chunk. Default: 32mb
  -output-http value
        Forwards incoming requests to given http address.
            # Redirect all incoming requests to staging.com address
            gor --input-raw :80 --output-http http://staging.com (default [])
  -output-http-elasticsearch string
        Send request and response stats to ElasticSearch:
            gor --input-raw :8080 --output-http staging.com --output-http-elasticsearch 'es_host:api_port/index_name'
  -output-http-queue-len int
        Number of requests that can be queued for output, if all workers are busy. default = 1000 (default 1000)
  -output-http-redirects int
        Enable how often redirects should be followed.
  -output-http-response-buffer value
        HTTP response buffer size, all data after this size will be discarded.
  -output-http-skip-verify
        Don't verify hostname on TLS secure connection.
  -output-http-stats
        Report http output queue stats to console every N milliseconds. See output-http-stats-ms
  -output-http-stats-ms int
        Report http output queue stats to console every N milliseconds. default: 5000 (default 5000)
  -output-http-timeout duration
        Specify HTTP request/response timeout. By default 5s. Example: --output-http-timeout 30s (default 5s)
  -output-http-track-response
        If turned on, HTTP output responses will be set to all outputs like stdout, file and etc.
  -output-http-worker-timeout duration
        Duration to rollback idle workers. (default 2s)
  -output-http-workers int
        Gor uses dynamic worker scaling. Enter a number to set a maximum number of workers. default = 0 = unlimited.
  -output-http-workers-min int
        Gor uses dynamic worker scaling. Enter a number to set a minimum number of workers. default = 1.
  -output-kafka-host string
        Read request and response stats from Kafka:
            gor --input-raw :8080 --output-kafka-host '192.168.0.1:9092,192.168.0.2:9092'
  -output-kafka-json-format
        If turned on, it will serialize messages from GoReplay text format to JSON.
  -output-kafka-mechanism string
        mechanism
            gor --input-raw :8080 --output-kafka-mechanism 'SCRAM-SHA-512'
  -output-kafka-password string
        password
            gor --input-raw :8080 --output-kafka-password 'password'
  -output-kafka-topic string
        Read request and response stats from Kafka:
            gor --input-raw :8080 --output-kafka-topic 'kafka-log'
  -output-kafka-use-sasl
        --output-kafka-use-sasl true
  -output-kafka-username string
        username
            gor --input-raw :8080 --output-kafka-username 'username'
  -output-null
        Used for testing inputs. Drops all requests.
  -output-resurface value
        Forwards incoming requests and response data to resurface instance. Example: gor --input-raw :80 --output-resurface http://localhost:7701/message (default [])
  -output-resurface-rules string
        Resurface filtering rules. Example: gor --input-raw :80 --output-resurface http://localhost:7701/message --output-resurface-rules "include_debug
        "
  -output-stdout
        Used for testing inputs. Just prints to console data coming from inputs.
  -output-tcp value
        Used for internal communication between Gor instances. Example:
            # Listen for requests on 80 port and forward them to other Gor instance on 28020 port
            gor --input-raw :80 --output-tcp replay.local:28020 (default [])
  -output-tcp-response-buffer value
        TCP response buffer size, all data after this size will be discarded.
  -output-tcp-secure
        Use TLS secure connection. --input-file on another end should have TLS turned on as well.
  -output-tcp-skip-verify
        Don't verify hostname on TLS secure connection.
  -output-tcp-stats
        Report TCP output queue stats to console every 5 seconds.
  -output-tcp-sticky
        Use Sticky connection. Request/Response with same ID will be sent to the same connection.
  -output-tcp-workers int
        Number of parallel tcp connections, default is 10 (default 10)
  -output-ws value
        Just like output tcp, just with WebSocket. Example:
            # Listen for requests on 80 port and forward them to other Gor instance on 28020 port
            gor --input-raw :80 --output-ws wss://replay.local:28020/endpoint (default [])
  -output-ws-skip-verify
        Don't verify hostname on TLS secure connection.
  -output-ws-stats
        Report WebSocket output queue stats to console every 5 seconds.
  -output-ws-sticky
        Use Sticky connection. Request/Response with same ID will be sent to the same connection.
  -output-ws-workers int
        Number of parallel ws connections, default is 10 (default 10)
  -prettify-http
        If enabled, will automatically decode requests and responses with: Content-Encoding: gzip and Transfer-Encoding: chunked. Useful for debugging, in conjunction with --output-stdout
  -recognize-tcp-sessions
        [PRO] If turned on http output will create separate worker for each TCP session. Splitting output will session based as well.
  -split-output true
        By default each output gets same traffic. If set to true it splits traffic equally among all outputs.
  -stats
        Turn on queue stats output
  -verbose int
        set the level of verbosity, if greater than zero then it will turn on debug output

参考资料

https://hub.docker.com/r/resurfaceio/network-sniffer
https://github.com/resurfaceio/containers
https://github.com/rongfengliang/resurfaceio-gor

标签:http,--,linux,raw,input,output,gor,resurfaceio
From: https://www.cnblogs.com/rongfengliang/p/18053404

相关文章

  • 未完成编辑 Linux CentOS7.6使用腾讯Yum源安装MySQL5.7,执行mysql-secure-installation
    学习安装MySQL时发现官方源很慢,试了国内腾讯源快,记录一下LinuxCentOS7.6前置环境:CPU1内存4GB硬盘SCSI20GB网络模式桥接系统内为自动DHCPpingqq.com可通互联网以下为MySQL5.7安装步骤编辑新repo库路径:/etc/yum.repos.d/mysql-community.repovi/etc/yum.repos......
  • Linux系统安装软件
    Linux系统软件安装使用rpm命令安装挂载mount/dev/sr0/mnt切换到/mnt/Packages下(安装包位置)cd/mnt/Packages安装程序(需按需求顺序依次安装)rpm-ivhA-B-C-D*注:rpm命令安装条件复杂有时缺失中间包则无法使用创建本地yum源仓库(无网络情况下使用)挂载mount/dev/sr0/......
  • linux的挂载
    linux系统安装软件的命令rpm-q软件名可以查询软件的安装情况yuminstall软件名-y安装软件mount/dev/sr0/mnt挂载yumcleanall清理缓存yummakecache创建缓存linux内部挂载软件库cd/etv/yum.repos.d到指定文件夹mkddir文件夹名创建文件夹mv*.re......
  • 解决SSH连接Linux超时自动断开
    问题使用SSH客户端(如WindTerm)连接Linux服务器时,当键盘和鼠标长时间不操作,服务器就自动断开连接了,需要再次登录密码重新连接。解决echo$TMOUT#判断是否是否设置了该参数,如果输出空或0表示不超时,大于0的数字n表示n秒没有收入则超时vim/etc/profile#编辑此配置文件exp......
  • Linux下挂在samba 文件夹到本地
    在Linux中,可以使用mount命令来打开SMB(ServerMessageBlock)共享。sudomount-tcifs//服务器IP地址/共享目录路径/本地挂载点-ousername=用户名,password=密码其中,需要将"//服务器IP地址/共享目录路径"替换为实际的SMB共享路径;"/本地挂载点"替换为希望在本地创建的文件夹作......
  • linux下使用官网压缩包安装nodejs
    linux下使用官网压缩包安装nodejs一、下载1、官网地址:https://nodejs.org/en/download/点击对应版本下载,这里提供的是tar.xz压缩包二、解压其实这种文件其实是两层压缩,外层是.xz压缩方式,内层是.tar压缩方式,下面进行逐层解压1.xz解压xz-dxxx.tar.xz2.tar解压tar-......
  • linux对文件内容去重,排序与不排序
    方法一,使用uniq相关命令进行去重用法:uniq[选项]...[输入文件[输出文件]]从<输入文件>(或标准输入)中过滤内容相同的相邻的行,并写到<输出文件>(或标准输出)。不带选项时,内容相同的行将仅输出一次。长选项的必选参数对于短选项也是必选的。-c,--count在每行......
  • linux内核同步机制
    内核同步机制在使用共享内存的程序代码中,为了保护共享资源,放置共享资源的并发访问导致的错误逻辑,需要用到内核同步机制。1.临界区是访问和操作共享数据的代码段。多个执行线程并发访问同一个资源(读/写),通常是不安全的,为了避免这种隐患,编程人员必须保证这种访问是原子的(不可打断)......
  • 使用SSH客户端登录Linux实例提示“ssh_exchange_identification: read: Connection re
    产品推荐:1、安全稳定的云服务器租用,2核/2G/5M仅37元,点击抢购>>>;2、高防物理服务器20核/16G/50M/200G防御仅350元,点击抢购>>>3、百度智能建站(五合一网站)仅880元/年,点击抢购>>> 模板建站(PC+手机站)仅480元/年,点击抢购>>>使用SSH客户端登录Linux实例提示“ssh_exchange_identifi......
  • Linux使用netstat查看端口使用情况
    1.netstat(networkstatus网络状态)命令各个参数说明如下:-t:指明显示TCP端口,t是TCP的首字母。-u:指明显示UDP端口,u是UDP的首字母-l:仅显示监听套接字(所谓套接字就是使应用程序能够读写与收发通讯协议(protocol)与资料的程序),l是listening的首字母。-p:显示进程标识......