Skip to content

Reverse shell implant #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Reverse shell implant #22

wants to merge 21 commits into from

Conversation

w1th4d
Copy link
Owner

@w1th4d w1th4d commented Mar 29, 2025

Classic reverse shell that connects to a specified hostname, IPv4 or IPv6 address and TCP port.

Unfortunately, this is an unstable shell. Meaning it does not support PTY terminal emulation. Doing so turns out to be suprizingly complicated in Java (effectively requiring libraries that uses JNI/JNA which is a huge footprint for an implant).

Tested on Linux v6.8.0, Windows 11 22H2 and macOS v15.4.

@w1th4d w1th4d marked this pull request as draft March 29, 2025 20:23
w1th4d added 11 commits March 31, 2025 01:14
This never quite worked. The pipe streams seem to behave differently regarding how they're closed compared to the actual streams of a Socket? This commit will be reverted, but I want it in the history in case it's needed in the future.
This should make sure there are no implicitly expected behaviours around how Sockets close their streams. Consider the case where the shell dies, the fromShell stream gets closed, toRemote is closed, but the Socket is not (leaving the fromSocket thread hanging). So far this has not been the case, but it's not very clear why. This change should make sure steams and threads are properly interrupted.
This fixes a bug with Windows targets where the threads would not get end-of-stream when the remote just stops responding.
This makes it a mandatory conf property.
@w1th4d w1th4d marked this pull request as ready for review April 4, 2025 23:57
w1th4d added 4 commits April 19, 2025 12:04
This code is supposed to be invoked as an implant. Maybe consider supplying main methods in implants in the future?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant