###### ######## ### ## ## ### ###### ## ## #### ## ## ########
## ## ## ## ## ## ### ### ## ## ## ## ## ## ## ### ## ##
## ## ## ## ## #### #### ## ## ## ## ## ## #### ## ##
###### ######## ## ## ## ### ## ## ## ## ######### ## ## ## ## ######
## ## ######### ## ## ######### ## ## ## ## ## #### ##
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ### ##
###### ## ## ## ## ## ## ## ###### ## ## #### ## ## ########
SPAMACHINE is a Java client application designed to send prank emails to groups of victims. It uses a fake SMTP server (MailDev) to simulate email sending to victims and prank messages are loaded from input files.
First init the docker compose file
MailDev is a fake SMTP server for testing emails. Pull its Docker image using:
docker pull maildev/maildev:latest
Init the docker compose file
docker compose up -d
You can build the project with Maven using the pom.xml file
mvn -f Client/pom.xml clean package
You can run the SPAMACHINE with the following command:
java -jar Client/target/Client-1.0-SNAPSHOT.jar <victimFile> <messageFile> <groupCount>
To run the SPAMACHINE correctly, you need two input files:
- A victim email file (.txt)
- A prank message file (.txt)
These files must follow specific formats to ensure the program processes them correctly.
The victim file contains a list of email addresses, with each email address on a separate line.
- Only valid email addresses are accepted (validated with regex).
- Invalid or improperly formatted email addresses will be ignored.
- Can have blank lines between
The message file contains the messages to be sent as emails.
- Email subject and body must be on the same line.
- Can have blank lines between
Congratulations! You’ve won a brand-new iPhone 14! Click here to claim your prize: http://fakeprize.com
Dear user, your account has been compromised. Verify your details immediately via this link: http://phishing-link.com
Work from home and earn $5000 per week with zero effort. Sign up now! Unusual activity detected in your bank account. Confirm your details here: http://fakebank.com
The program is divided into several modules, each responsible for specific tasks:
- Entry point of the program.
- Reads input files, processes arguments and initializes the email-sending process.
- Manages communication with the SMTP server.
- Sends commands and reads responses from the server.
- Handles SMTP protocol logic.
- Ensures proper sequencing of commands like EHLO, MAIL, RCPT, etc.
- Represents an email with sender, recipients, and message content.
- Define the commands and expected server responses for the SMTP protocol.
- Victim emails and prank messages are read from files and validated.
- Victims are grouped based on the specified number of groups.
- The program connects to the MailDev SMTP server (via localhost:1025).
- Commands are sent sequentially (EHLO, MAIL, RCPT, DATA, etc.) to send each prank email.
- If an unexpected server response is received, the program attempts to exit with a QUIT command.
In the screenshot above, the program sends prank emails to 5 groups of victims. We choosed to have groups of 2 victims but as we only have 9 victims, the last group has only one victim (handled by the program). The program sends a prank email to each victim, with the sender displayed being a random victim from the entire list.
In the screenshot above, the MailDev web interface shows the prank emails received by the victims. Each email is displayed with the sender, recipient, and message content. The email content is a random prank message from the input file.
In the screenshot above, the program handles an empty victim file by displaying an error message and exiting.