7 releases (4 breaking)

0.5.2 Oct 30, 2024
0.5.1 Feb 10, 2024
0.5.0 Jun 3, 2023
0.4.0 Apr 25, 2021
0.1.0 Feb 23, 2018

#1852 in Command line utilities

Download history 3/week @ 2024-09-20 4/week @ 2024-09-27 1/week @ 2024-10-04 105/week @ 2024-10-25 20/week @ 2024-11-01 3/week @ 2024-11-15 1/week @ 2024-11-22

59 downloads per month

GPL-3.0-or-later

285KB
665 lines

rshijack Crates.io

tcp connection hijacker, rust rewrite of shijack from 2001.

This was written for TAMUctf 2018, brick house 100. The target was a telnet server that was protected by 2FA. Since the challenge wasn't authenticated, there have been multiple solutions for this. Our solution (cyclopropenylidene) was waiting until the authentication was done, then inject a tcp packet into the telnet connection:

# if you don't know one of the ports use 0 to match any port
echo 'cat ~/.ctf_flag' | sudo rshijack tap0 172.16.13.20:37386 172.16.13.19:23

After some attempts this command was accepted and executed by the telnet server, resulting in a tcp packet containing the flag.

screenshot

The way this works is by sniffing for a packet of a specific connection, then read the SEQ and ACK fields. Using that information, it's possible to send a packet on a raw socket that is accepted by the remote server as valid.

The other tools in that screenshot are sniffglue and arpspoof.

Installation

Packaging status

Arch Linux

pacman -S rshijack

Docker

If needed, rshijack can be pulled as a docker image. The image is currently about 10.2MB.

docker run -it --init --rm --net=host kpcyrd/rshijack eth0 172.16.13.20:37386 172.16.13.19:23

Notable mentions

License

GPLv3+

Dependencies

~5–7MB
~121K SLoC