#tcp #packet #send #cli #restructuredtext #sendpkt

app sendpkt-rs

send tcp packet from cli

2 releases

0.1.1 Jul 28, 2020
0.1.0 Jul 28, 2020

#14 in #restructuredtext

Custom license

10KB
168 lines

sendpkt-rs

sendpkt-rs send the TCP Packet from cli

Purpose

kill the quiet TCP connection (CLOSE-WAIT status) by sending the RST segment.

Sendpkt-rs

sendpkt-rs is a command line tool to send TCP Packet with specified option as the following:

USAGE:
    sendpkt [FLAGS] [OPTIONS] --ip-dip <ip-dip> --ip-sip <ip-sip> --tcp-dport <tcp-dport> --tcp-sport <tcp-sport>

FLAGS:
    -h, --help            Prints help information
        --tcp-flag-ack
        --tcp-flag-cwr
        --tcp-flag-ece
        --tcp-flag-fin
        --tcp-flag-ns
        --tcp-flag-psh
        --tcp-flag-rst
        --tcp-flag-syn
        --tcp-flag-urg
    -V, --version         Prints version information
    -v, --verbose         Verbose mode (-v, -vv, -vvv, etc.)

OPTIONS:
        --ip-dip <ip-dip>
        --ip-sip <ip-sip>
        --ip-ttl <ip-ttl>
        --tcp-dport <tcp-dport>
        --tcp-seq <tcp-seq>
        --tcp-sport <tcp-sport>
        --tcp-window <tcp-window>

Install

  1. cargo install sendpkt-rs
  2. Download the binary from sendpkt-rs/releases

Requirements

You have must WinPcap or npcap installed which is libpnet required.

usage

send rst packet

sendpkt --ip-dip 127.0.0.1 --ip-sip 127.0.0.1 --tcp-dport 8888 --tcp-sport 1234  --tcp-seq 0x12345 --tcp-flag-rst

send syn packet

sendpkt --ip-dip 127.0.0.1 --ip-sip 127.0.0.1 --tcp-dport 8888 --tcp-sport 1234  --tcp-seq 0x12345 --tcp-flag-syn

License

sendpkt-rs is under the MIT license. See the LICENSE file for details.

Dependencies

~3–4MB
~75K SLoC