rshijack for Mac
rshijack
rshijack — overview
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.
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
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 2020, August: @ezequielpereira wrote an excellent blog post about a GCE container->host escape with rshijack and contributed a patch that was merged.
License
GPLv3+
Details
TCP 连接劫持器
How to install rshijack
- Open Terminal (press ⌘ + Space and type “Terminal”).
- If Homebrew is not installed yet, run the command below first.
- Run this command:
Latest 10 releases
Last updated 2024-10-30; current version v0.5.2, with the latest 4 releases listed.
| Version | Released | Type | Size | macOS | Windows | Linux |
|---|---|---|---|---|---|---|
| v0.5.2 | 2024-10-30 | Stable | — | — | — | — |
| v0.5.1 | 2024-02-10 | Stable | — | — | — | — |
| v0.5.0 | 2023-06-03 | Stable | — | — | — | — |
| v0.4.0 | 2021-04-25 | Stable | — | — | — | — |
Data from GitHub Releases; stable releases first, each group sorted newest first.
Prebuilt bottle platforms
Official Homebrew bottles cover:
- Apple silicon · latest macOS
- Apple silicon · macOS 26 Tahoe
- Apple silicon · macOS 15 Sequoia
- Apple silicon · macOS 14 Sonoma
- Apple silicon · macOS 13 Ventura
- Intel · macOS 14 Sonoma
- Intel · macOS 13 Ventura
- Linux · ARM64
- Linux · x86_64
Compared with similar apps
Only public metadata is compared, with no subjective recommendation; see the compare pages for field-by-field comparisons.
| App | Version | License | Architecture | 30-day installs |
|---|---|---|---|---|
| rshijack | v0.5.2 | GPL-3.0-or-later | CLI | 5 |
| ucspi-tcp | 0.88 | LicenseRef-Homebrew-public-domain | CLI | 4 |
| tproxy | v0.9.2 | MIT | CLI | 8 |
| redir | v3.3 | GPL-2.0-or-later | CLI | 3 |
Similar apps: Command-line Tools
ucspi-tcp
ucspi-tcp is a collection of command-line tools for building TCP client and server programs.tproxy
CLI tool to proxy and analyze TCP connectionsredir
[![Coverity Status]][Coverity Scan]libnetfilter_conntrack
libnetfilterconntrack is a low-level library for Linux network management scenarios, primarily…openssl@4
Cryptography and SSL/TLS Toolkitxz
General-purpose data compression with high compression ratioCategories: Command-line Tools