GithubHelp home page GithubHelp logo

brightio / penelope Goto Github PK

View Code? Open in Web Editor NEW
582.0 582.0 83.0 282 KB

Penelope Shell Handler

License: GNU General Public License v3.0

Python 99.38% Shell 0.62%
bind-shell ctf ctf-tools pty python rce reverse-shell shell-handler tty

penelope's People

Contributors

brightio avatar jpts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

penelope's Issues

Questions about v0.9.2

Hello, I'm about to pull down v0.9.2 and was wondering if you could elaborate on what these two statements translate to.

  • Removed Unix 'advanced' shell support
  • Removed PTY Windows shell support temporarily

I'm particularly interested in the Windows shell support. Does this mean that using v0.9.2 of penelope no longer supports any Windows reverse shells, or no longer supports some subset of Windows reverse shells?

What does the removal of Unix 'advanced' shell support mean as far as reduced functionality?

Thanks again for an excellent tool!! Very glad to see some development updates.

Invalid shell from *

Hi
When I am trying to connect to the shell through Linux ubuntu 5.11.0-34-generic (using fish shell), it is writing to me: "Invalid shell from"

More privesc scripts

It would be awesome if you added deepce (Docker enumeration ) , PrivescCheck (Fancy script)

options.recon_scripts = {
'Unix':[
	'https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh',
	'https://raw.githubusercontent.com/diego-treitos/linux-smart-enumeration/master/lse.sh',
	'https://raw.githubusercontent.com/stealthcopter/deepce/main/deepce.sh'
],
'Windows':[
	'https://raw.githubusercontent.com/PowerShellEmpire/PowerTools/master/PowerUp/PowerUp.ps1',
	'https://raw.githubusercontent.com/itm4n/PrivescCheck/master/PrivescCheck.ps1'
]}

TERM=xterm-256color for all connection is a slight issue with old Linux versions

Hello,

I'm working on a very old version of Red Hat (Linux tophat.acme.com 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 athlon i386 GNU/Linux) and I noticed this when using penelope and trying to clear the screen it would not work and you would get an error about unknown terminal xterm-256color

image

Trying to clear the terminal

image

Environment

image

Setting the TERM variable to TERM=xterm
image

The clear command works now

image

Not a huge deal by any means, not sure if you were aware or had experienced this or not and not sure if you can check for something like this and set the TERM variable to a standard xterm if xterm-256color is not possible.

Thanks for the great tool! I'm loving using it and cannot wait to, hopefully, see some updates in the not too distant future (Windows multiple sessions , etc. ;-) )

Upload not working

Hello, just found this tool last night and it looks amazing. Just starting to play around with it this evening and I have a great reverse shell (multiple shells with the maintain function) and I have tried to upload files unsuccessfully multiple times.

Here's what one session looks like when trying to use the run upload_privesc_scripts command

image

The session gets disconnected and then says the upload was successful and then tells you there there are no sessions.

Here's another time when I tried to upload the linpeas.sh script from my system to the remote machine and the session was disconnected again but I had enabled the maintain function and a new shell was spawned. None of the file are visible on the remote system. I have validated that I can write files to the location that I am trying to upload to

image

I was able to do a download. I downloaded the entire /etc/ directory without any issue.

The system is running CentOS release 5.6 (Final)
Linux version 2.6.18-238.12.1.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Tue May 31 13:23:01 EDT 2011

Great tool even without the upload, but I will definitely have an even bigger ear to ear grin if I can get the upload working.

Thanks for an excellent tool!

Download files /folders

Hi, great work with penelope!
My target machine is windows client, so it is not possible to upgrade shell to PTY.
When I try do download a file / folder it does not show up "download sucsseful" and the file is not stored on the penelope location it should be.
So, is it because the shell is not PTY?
Isn t it possible to download files with the simple shell?
And, if it isn t, Is there any command to see contents of files on targest system, instead of downloading them?
Thanks

Emoji icons not displaying when using penelope

I have run into an issue where the emoji symbols are not displaying next to the "Show Payloads" and "Quit" text when penelope is run. I did not have this issue on previous versions of Kali but now on the latest version, this occurs.

image

Any idea what may cause this behavior?

Appreciation

I loved your script
I have a question can you do some type of stuff like if its windows shell instead of aborting the shell it starts the shell with non tty mode

Error with 'run upload_privesc_scripts' module

First let me gush a little on how much I love this program!

I use it all the time and recommend it on my OSCP challenge walkthroughs at https://medium.com/@Dpsypher.

I encountered an error using the 'run upload_privesc_scripts' module:

Exception in thread Menu:
Traceback (most recent call last):
File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
self.run()
File "/usr/lib/python3.11/threading.py", line 982, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.11/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/cmd.py", line 217, in onecmd
return func(arg)
^^^^^^^^^
File "/home/kali/offsec-labs/TEMP-publish/./penelope.py", line 172, in newfunc
return func(self, ID)
^^^^^^^^^^^^^^
File "/home/kali/offsec-labs/TEMP-publish/./penelope.py", line 393, in do_upload
core.sessions[self.sid].upload(glob, randomize_fname=True)
File "/home/kali/offsec-labs/TEMP-publish/./penelope.py", line 2234, in upload
destination = remote_path if remote_path else self.cwd
^^^^^^^^
File "/home/kali/offsec-labs/TEMP-publish/./penelope.py", line 1408, in cwd
self._cwd = self.control_session.exec(cmd, value=True)
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'exec'

I could not be more thrilled that you chose lse.sh as well as linpeas as your scripts. They are also my go to.

I just want to thank you for the ongoing effort you put in to make this a spectacular lightweight C2. Please let me know if I can help.

Respectfully,
Derek Foster

P.S. It may be related to using a python reverse shell to connect with Penelope. I get an error on connection but after pressing enter the shell seems to behave normally.
image

penelope sometimes crashes when trying to upgrade or switch a session

Session Management
==================
sessions · [SessionID]      · Show active sessions or interact with the SessionID                                      
┍┽ penelope ┾┑ > ls
[!] No such command: 'ls'. Issue 'help' for all available commands
[+] Got reverse shell from 🐧 localhost~127.0.0.1 💀 - Assigned SessionID <2>

┍┽ penelope ┾┑ > sessions

➤  🐧 localhost~127.0.0.1 💀

    ID  | Shell | Source                                   
    <2> | Basic | Reverse shell from Listener(0.0.0.0:4444)


┍┽ penelope ┾┑ > sessions 2
[+] Attempting to upgrade shell to PTY...
Exception in thread Menu:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.11/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/cmd.py", line 217, in onecmd
    return func(arg)
           ^^^^^^^^^
  File "/home/pascal/Git/penelope/./penelope.py", line 260, in do_sessions
    if self.do_interact(line):
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pascal/Git/penelope/./penelope.py", line 172, in newfunc
    return func(self, ID)
           ^^^^^^^^^^^^^^
  File "/home/pascal/Git/penelope/./penelope.py", line 295, in do_interact
    return core.sessions[ID].attach()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pascal/Git/penelope/./penelope.py", line 2007, in attach
    self.upgrade()
  File "/home/pascal/Git/penelope/./penelope.py", line 1854, in upgrade
    self.shell = self.bin['bash'] if self.bin['bash'] else self.bin['sh']
                                     ^^^^^^^^
  File "/home/pascal/Git/penelope/./penelope.py", line 1431, in bin
    response = self.exec(f'for i in {" ".join(binaries)}; do which $i 2>/dev/null || echo;done')
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pascal/Git/penelope/./penelope.py", line 1714, in exec
    readables, _, _ = select.select([self.subchannel.control, self.subchannel], [], [], timeout)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 9] Bad file descriptor
Exception in thread Core:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "/home/pascal/Git/penelope/./penelope.py", line 986, in loop
    target.write(data)
  File "/home/pascal/Git/penelope/./penelope.py", line 1222, in write
    os.write(self._write, data)
BrokenPipeError: [Errno 32] Broken pipe

Laggish

After getting a reverse shell, typing is very laggish and slow. Otherwise phenomenal program.

Session [id] died...

For a machine I have a reverse shell connection using nc, penelope is having a problem like the screenshot below. What is the reason for this? How can we solve it?

111
222

SyntaxWarning Message

After running the program, it shows a SyntaxWarning message due to an invalid escape sequence on the code. This can, although, be considered a minor error, since it doesn't interfere during the usage.

image

multiple session break console output

Hi,

First of all, this tool is amazing. Right now i facing weird issue is that the console just simply messed up after receiving more than 2 connection.

I attached screenshot to visually describe the issue
Capture

thank you!

new feature: Interact console

I'm glad to see the creation of this tool,During my use, I came up with a new idea:
Can I connect to the current penelope console at another terminal by running the same command again?
This makes it easy for me to connect and manage multiple sessions at the same time

[!] Upgrading Windows shell is not implemented yet.

Is there any plan to implement the feature for automatically upgrading Windows shells to full PTYs?

I just tried out penelope again and so far i really like it but the feature for Windows machines is still lacking.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.