Skip to content

Commit c641abc

Browse files
author
root
committed
fixed broken interact with agents function
1 parent 7779593 commit c641abc

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed
23 Bytes
Binary file not shown.

C2-python-server/c2-server.py

+7-13
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@
22
import threading
33
import readline
44
from collections import OrderedDict
5-
from menu import Menu, GREEN, ORANGE, RESET #import menu.py module
5+
from menu import Menu, GREEN, ORANGE, PURPLE, RESET #import menu.py module
66
from ascii_art import BANNER_ART #import sick ascii
77

8-
9-
10-
# ANSI colors
11-
GREEN = '\033[92m'
12-
ORANGE = '\033[93m'
13-
RESET = '\033[0m'
14-
158
class AutoComplete:
169
def __init__(self, options):
1710
self.options = sorted(options)
@@ -100,20 +93,21 @@ def main_menu():
10093
while True:
10194
command, args = mainMenu.parse()
10295
if command == "agents":
103-
print(f"\n{GREEN}Type \"interact <agent_id>\" to interact with an agent{RESET}\n")
104-
print(f"\n{ORANGE}Active agents:{RESET}")
96+
print(f"\n{GREEN}Type \"interact <agent_id>\" to interact with an agent{RESET}")
97+
print(f"{PURPLE}Active agents:{RESET}")
10598

10699
for client_id in clients.keys():
107-
print(f"{GREEN}{client_id}{RESET}")
100+
print(f"{PURPLE}{client_id}{RESET}")
108101
print()
109102
elif command.startswith("interact"):
110103
if len(args) < 1:
111104
print(f"{ORANGE}Please specify an agent ID.{RESET}\n")
112105
continue
113-
elif len(args) == 2:
114-
print(f"\nConnected to {agent_id}!\n")
106+
elif len(args) == 1:
115107
agent_id = args[0]
116108
interact_with_agent(agent_id, mainMenu)
109+
# print(f"\nConnected to {agent_id}!\n")
110+
117111

118112
elif command == "help":
119113
mainMenu.showHelp()

C2-python-server/menu.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# ANSI escape sequences for colors
55
GREEN = '\033[1;38;5;2m'
66
ORANGE = '\033[93m'
7+
PURPLE = '\033[0;35m'
78
RESET = '\033[0m'
89

910
class AutoComplete:

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
```
1111

1212
# Phantom-C2
13+
* Written for fun to learn sockets and more C.
14+
* Clear text, do not use outside a lab envrionment.
1315
* Agents written in C
1416
* Server in Python3.8
1517

1618

1719
# To get the server up and listening:
1820

1921
```
20-
Listening on 0.0.0.0 (all interfaces) port 5000
22+
# Listening on 0.0.0.0 (all interfaces) port 5000
2123
python3.8 c2-server.py
2224
```
2325

0 commit comments

Comments
 (0)