forked from grimlyreaper/CICADA
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·167 lines (136 loc) · 4.29 KB
/
main.py
File metadata and controls
executable file
·167 lines (136 loc) · 4.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/usr/bin/python3
# _____ _____ _____ _____
# / ____|_ _/ ____| /\ | __ \ /\
# | | | || | / \ | | | | / \
# | | | || | / /\ \ | | | |/ /\ \
# | |____ _| || |____ / ____ \| |__| / ____ \
# \_____|_____\_____/_/ \_\_____/_/ \_\
from cmd import Cmd
import os
from common import modules
import gitlab
try:
import gnureadline
import sys
sys.modules['readline'] = gnureadline
except ImportError:
pass
banner = """
_____ _____ _____ _____
/ ____|_ _/ ____| /\ | __ \ /\
| | | || | / \ | | | | / \
| | | || | / /\ \ | | | |/ /\ \
| |____ _| || |____ / ____ \| |__| / ____ \
\_____|_____\_____/_/ \_\_____/_/ \_\
"""
# targets = ["github.com/test"]
# TODO
# 1) fork all targets
# 2) clone forked targets
# 3)
# 4) load poison yml file to forked targets
# 5) push commit changes, and submit pull request
# 6) Listen for incoming messages.
#TODO: Ask if they are using a custom gitlab instance
GITHUB_TOKEN = ""
GITLAB_TOKEN = "w_z7Ae4xvggSU3wLjizB"
CUSTOM_GITLAB = "http://gitlab.example.com"
GITLAB_USERNAME = "test"
class color:
HEADER = '\033[95m'
IMPORTANT = '\33[35m'
NOTICE = '\033[33m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
RED = '\033[91m'
END = '\033[0m'
UNDERLINE = '\033[4m'
LOGGING = '\33[34m'
class Terminal(Cmd):
prompt = "(CICADA) >>> "
targets = ["root/xfr-demo"]
listerners = []
loadedModule = None
SETOPTIONS = ['target', 'module']
def __init__(self):
Cmd.__init__(self)
self.installPath = os.getcwd()
def do_exit(self, args):
"Exit the framework"
print("Byee")
os._exit(0)
def do_clear(self, args):
os.system("clear")
def do_listerners(self, args):
"Your Listerners"
print("Here are your listerners...")
if len(self.listerners) == 0:
print("No listerners")
else:
for listerner in self.listerners:
print(listerner)
def do_modules(self, args):
"Availble modules"
print("Listing availble modules...")
self.printModules()
def do_targets(self, args):
"Lists of your targets"
if len(self.targets) == 0:
print("No targets")
else:
for target in self.targets:
print(target)
def do_set(self, args):
"""Add a target/module
set target [target_link]
set target <namespace>/<projectname>
set module travis/enum"""
arg = args.split()
if arg[0] == "target":
self.targets.append(arg[1])
elif arg[0] == "module":
## check if module exist
if self.checkModules(arg[1]):
self.loadedModule = arg[1]
print(self.loadedModule)
#Change the prompt
genModule = modules.ModuleMenu(self.loadedModule, self.installPath)
genModule.cmdloop()
else:
print("Module doesn't exit")
# TODO: DONT;t work
def complete_set(self, text, line, begidx, endidx):
if not text:
completions = self.SETOPTIONS[:]
return completions
def do_unset(self, args):
"""Remove target
unset target [target_link]"""
arg = args.split()
if arg[0] == "target":
self.targets.remove(arg[1])
def do_interact(self, args):
"Interact with targets"
# TODO: filter out some useless directory
def printModules(self):
file = os.walk("./modules")
for dir, dirs, files in file:
print(dir)
def checkModules(self, dir):
path = "./modules"
if os.path.isdir(path + "/" + dir):
return True
else:
return False
def welcome():
print(banner)
# print("Welcome!!! May the force be with you")
print("Created by PabloPotat0 & Th3QuantumJ3d1")
print("CI Exploitation framework")
def main():
welcome()
terminal = Terminal()
terminal.cmdloop()
if __name__ == "__main__":
main()