ThePorgs / Exegol-images

Docker images of the Exegol project
https://exegol.readthedocs.io/
GNU General Public License v3.0
89 stars 69 forks source link

add penelope tool #410

Open Frozenka opened 3 weeks ago

Frozenka commented 3 weeks ago

Description

This PR adds the installation function for Penelope, a shell handler designed to replace netcat when exploiting RCE vulnerabilities.

Related issues

If your PR responds to an issue for a bug fix or feature request, make sure to includes references to the issues (e.g. "fixes #xxxx").

Point of attention

Things you are not sure about that deserve special attention if you have doubts or questions.

QU35T-code commented 3 weeks ago

@Frozenka,

Can you synchronize (merge) with the remote dev branch ? In addition, the install_penelope function is not called :

image
QU35T-code commented 3 weeks ago

@Frozenka,

Penelope needs a display to show helper menu. I haven't found an command to test, so for the moment I can't approve.

QU35T-code commented 2 weeks ago

https://github.com/brightio/penelope/blob/main/penelope.py#L4232

ShutdownRepo commented 1 week ago

imo we can approve, if there's something wrong with penelope's tty we'll find a fix later on (or find a test command later on). It's not a huge priority. The only thing I'm wondering is if we really need penelope, because pwncat-cs is already installed and it seems to me it's quite similar, am I wrong?

QU35T-code commented 1 week ago

@Frozenka

Frozenka commented 1 week ago

Hello, yes, actually, pwncat hasn't been maintained for several years. Penelope is a new, similar version that is currently maintained. :)

cHJlaXpoZXI commented 5 days ago

Hello, yes, actually, pwncat hasn't been maintained for several years. Penelope is a new, similar version that is currently maintained. :)

Indeed ! Penelope is maintained. Pwncat-cs, the last commit was made 2 years ago.and 48 issues without answers of maintainers.

Penelope needs a display to show helper menu. I haven't found an command to test, so for the moment I can't approve.

The maintainer added a help option with argparse in the last version :

 [Nov 14, 2024 - 16:52:57 (CET)] exegol-htb-gui penelope # python3 penelope.py -h
usage: penelope.py [-i] [-c] [-a] [-l] [-h] [-Q] [-d] [-L] [-T] [-CT] [-r]
                   [-m] [-H] [-P] [-S] [-C] [-U] [-s] [-p] [-pass] [-N] [-v]
                   [ports ...]

Penelope Shell Handler

positional arguments:
  ports                 Ports to listen/connect to, depending on -i/-c
                        options. Default: 4444

Reverse or Bind shell?:
  -i , --interface      Interface or IP address to listen on. Default: 0.0.0.0
  -c , --connect        Bind shell Host

Hints:
  -a, --hints           Show sample payloads for reverse shell based on the
                        registered Listeners
  -l, --interfaces      Show the available network interfaces
  -h, --help            show this help message and exit

Verbosity:
  -Q, --silent          Be a bit less verbose
  -d, --debug           Show debug messages

Session Logging:
  -L, --no-log          Do not create session log files
  -T, --no-timestamps   Do not include timestamps in session logs
  -CT, --no-colored-timestamps
                        Do not color timestamps in session logs

Misc:
  -r , --configfile     Configuration file location
  -m , --maintain       Maintain NUM total shells per target
  -H, --no-history      Disable shell history on target
  -P, --plain           Just land to the main menu
  -S, --single-session  Accommodate only the first created session
  -C, --no-attach       Disable auto attaching sessions upon creation
  -U, --no-upgrade      Do not upgrade shells

File server:
  -s, --serve           HTTP File Server mode
  -p , --port           File Server port. Default: 8000
  -pass , --password    URL prefix

Debug:
  -N , --no-bins        Simulate binary absence on target (comma separated
                        list)
  -v, --version         Show Penelope version

Regards,

QU35T-code commented 5 days ago

Hello, yes, actually, pwncat hasn't been maintained for several years. Penelope is a new, similar version that is currently maintained. :)

Indeed ! Penelope is maintained. Pwncat-cs, the last commit was made 2 years ago.and 48 issues without answers of maintainers.

Penelope needs a display to show helper menu. I haven't found an command to test, so for the moment I can't approve.

The maintainer added a help option with argparse in the last version :

 [Nov 14, 2024 - 16:52:57 (CET)] exegol-htb-gui penelope # python3 penelope.py -h
usage: penelope.py [-i] [-c] [-a] [-l] [-h] [-Q] [-d] [-L] [-T] [-CT] [-r]
                   [-m] [-H] [-P] [-S] [-C] [-U] [-s] [-p] [-pass] [-N] [-v]
                   [ports ...]

Penelope Shell Handler

positional arguments:
  ports                 Ports to listen/connect to, depending on -i/-c
                        options. Default: 4444

Reverse or Bind shell?:
  -i , --interface      Interface or IP address to listen on. Default: 0.0.0.0
  -c , --connect        Bind shell Host

Hints:
  -a, --hints           Show sample payloads for reverse shell based on the
                        registered Listeners
  -l, --interfaces      Show the available network interfaces
  -h, --help            show this help message and exit

Verbosity:
  -Q, --silent          Be a bit less verbose
  -d, --debug           Show debug messages

Session Logging:
  -L, --no-log          Do not create session log files
  -T, --no-timestamps   Do not include timestamps in session logs
  -CT, --no-colored-timestamps
                        Do not color timestamps in session logs

Misc:
  -r , --configfile     Configuration file location
  -m , --maintain       Maintain NUM total shells per target
  -H, --no-history      Disable shell history on target
  -P, --plain           Just land to the main menu
  -S, --single-session  Accommodate only the first created session
  -C, --no-attach       Disable auto attaching sessions upon creation
  -U, --no-upgrade      Do not upgrade shells

File server:
  -s, --serve           HTTP File Server mode
  -p , --port           File Server port. Default: 8000
  -pass , --password    URL prefix

Debug:
  -N , --no-bins        Simulate binary absence on target (comma separated
                        list)
  -v, --version         Show Penelope version

Regards,

Yes, but this line is called before the helper and needs a display… https://github.com/ThePorgs/Exegol-images/pull/410#issuecomment-2446503723

Will try with the latest version

ShutdownRepo commented 2 days ago

Since pwncat-cs is not maintained anymore and penelope seems to a maintained alternative we might as well keep both and remove one in the future. I wouldn't be against merging here even without the display test, but with a simple -h test instead, what do you think @QU35T-code