☰ Menu
CLI Open source 5 installs/mo Up 3.1×

rshijack for Mac

rshijack

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

  1. Open Terminal (press ⌘ + Space and type “Terminal”).
  2. If Homebrew is not installed yet, run the command below first.
  3. Run this command:

Latest 10 releases

Last updated 2024-10-30; current version v0.5.2, with the latest 4 releases listed.

VersionReleasedTypeSizemacOSWindowsLinux
v0.5.22024-10-30Stable————
v0.5.12024-02-10Stable————
v0.5.02023-06-03Stable————
v0.4.02021-04-25Stable————

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.

Compared with similar apps
AppVersionLicenseArchitecture30-day installs
rshijackv0.5.2GPL-3.0-or-laterCLI5
ucspi-tcp0.88LicenseRef-Homebrew-public-domainCLI4
tproxyv0.9.2MITCLI8
redirv3.3GPL-2.0-or-laterCLI3

Similar apps: Command-line Tools

Leave a comment

评论表单加载中…