GithubHelp home page GithubHelp logo

jbstand / teaching-heigvd-res-2021-labo-smtp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from softeng-heigvd/teaching-heigvd-res-2021-labo-smtp

0.0 0.0 0.0 829 KB

Shell 3.43% Java 95.41% CSS 0.26% JavaScript 0.35% Dockerfile 0.55%

teaching-heigvd-res-2021-labo-smtp's Introduction

Teaching-HEIGVD-RES-2021-Labo-SMTP

Description

The initial idea of the project is to teach the student the behavior of the SMTP protocol and how to use it.

Thanks to this application, we can now prank our friends.

Because our application is a mail prank generator. To avoid spamming our friends, we have set up a mock server that will take care of retrieving the mails before they leave.

How does it work ?

The application will randomly take the emails you propose and randomly take a message you propose, then it will randomly choose between the chosen emails to determine the victim that will send the email and the rest of the emails will be the victims receiving the email.

Instructions to set up mock SMTP server

If you want to test our pranking mail solution but aren't confident enough to get live already this section is for you.

First of all, you'll need Docker installed on your machine. Please install it from here.

We prepared a Docker container running a Mocked SMTP server, this way, all the prank mail you send will remain local and you'll be able to see the result in a nice Web interface (http://localhost:8282).

In order to use this Docker container you'll have to complete the two steps below :

  • Step 1: Build the Docker image : Open a terminal and browse to the MockMock/ folder. Then run :

    docker build -t yourname/nameoftheimage .

    Once completed, the image is ready to be ran. You should see it popping up in the Docker GUI and will be able to run it from there but don't forget the port mapping. Below is the CLI way to run the image with the correct port mapping.

  • Step 2: Run the Docker image : In the same terminal run :

    docker run -p 8888:25 -p 8282:80 yourname/nameoftheimage

    (Where 8888 is the port configured in config.properties and 8282 is the port you'd like for the web interface)

Once completed, run our solution and open the web interface (http://localhost:8282) to see the prank mail coming in! Do not worry, none of them is actually sent.

Instructions to configure our tool

First, in order to use our application, you will have to clone our repo.

To be able to use our application, you just have to modify three different files to adapt what you want :

  • You can change the application's configuration here : SMTPrank\src\main\resources\config.properties
  • You can change the prank messages here : SMTPrank\src\main\resources\messages.utf8
  • You can change the list of victim's emails here : SMTPrank\src\main\resources\victims.utf8

And then to run the app, you'll need to run the class SMTP/src/main/java/ch/heigvd/MelMot/Main.java

Implementation

You can see how our application is structured :

You can see how the SMTP protocol is used in our application:

When you start the connection with the server, the following messages are supposed to appear in your console (the client sends the "EHLO" request to the server) :

  1. The first line represents the device from which I connect to the server and on which SMTP server we are connected
  2. The second line represents the device I use to connect to the server
  3. The third line tells that the content is a MIME. encoded content
  4. The fourth line tells us that the server is ready to accept conversation.

When you send a mail to the server, the following messages are supposed to appear in your console :

  1. The first "send" message represent the client sending the request "MAIL FROM : [email protected]", which tells to server who's the sender

  2. The second and third "send" message represent the client sending the request "RCPT TO : [email protected]", which tells the server who's the recipient

  3. The fourth "send" message represent the client sending the request "DATA", which tells the server the following messages are the body of the mail. It needs to end with "<CR><LF>.<CR><LF>"

  4. Every messages send to the server are followed with the response "250 Ok" which means the server accept what the client sends

When you close the connection with the server, the following message is supposed to appear in your console (the client sends the "QUIT" request to the server) :

Server side

We can see that the mock server intercept all the mails we send.

teaching-heigvd-res-2021-labo-smtp's People

Contributors

alex-mottier avatar jbstand avatar wasadigi avatar edri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.