Ft_onion - 42Madrid

Web Hidden Server.

Introduction to the hidden services of the Tor network.

This is a project developed in the cybersecurity bootcamp of 42Madrid.

Subject:

The objective of this project is to create a web page and make it accessible from the Tor network by creating a hidden service.

The hidden service is a web service that is hidden in the Tor network, But what is Tor?

Tor is an application that takes the data that enters and exits through your Internet connection and passes it through a circuit of servers around the world. This makes your traffic completely anonymous.
A little-known use of Tor is anonymous access to the Deep Web or Darknet, a little-known part of the Internet, inaccessible from search engines such as Google, and hosting content of often questionable legality.

Requirements:

Files to submit:

index.html
nginx.conf
sshd_config
torrc


Bonus part:


Project:

This project was developed with docker containers to perform all the connection and configuration tests, without damaging the system. It has a Server container and a Client container.

Server

Based on a debian docker container generated by the following Dockerfile:

FROM debian:latest

# Installation packages
RUN apt-get update -y && apt upgrade -y
RUN apt-get install nginx tor openssh-server vim -y

# Copy sshd_config file
COPY sshd_config /etc/ssh/sshd_config

# Copy torrc file
COPY torrc /etc/tor/torrc

# Copy index.html file
COPY index.html /usr/share/nginx/html/index.html

# COPY nginx file
COPY nginx.conf /etc/nginx/nginx.conf

# SSH user configuration
RUN useradd -m sshusr
RUN echo "sshusr:onion" | chpasswd

# Service startup.
ENTRYPOINT service ssh start; nginx; tor  


The following packages are installed and configured:

With the COPY commands that are indicated in the Dockerfile, the files are sent to the directory paths where they should replace the original files, loading the requested settings.

The following steps were followed to enable all services:

In addition to installing the necessary applications and copying the configuration files into the container, an user is created which has the privileges to access the SSH service when fortifying. [user=sshusr, pass=onion]

Client:

Based on a debian docker container generated by the following Dockerfile:

FROM debian:latest

# Installation packages
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install tor ssh -y

# Service startup.
ENTRYPOINT service ssh start; tor


The following packages are installed:

To speed up the deployment and execution of the containers, a Makefile was configured with the following instructions:

- make:        Generates the Server container, the Client container and both images.
- make server: Generates the Server container image.
- make client: Generates the image of the Client container.
- make exe:    Runs the Client container and returns a Bash.
- make clean:  Stops and removes the Server and Client containers. 


When executing the server, a Volume is generated in the Server container synchronizing the directory /url, this will return the directories where the hostname files are located, these contain the url’s xxxxxxxxx.onion for the HTTP and SSH.


Docker test

Dependencies:

Execution Instructions:

  1. Clone the repository
    git clone https://github.com/goldcod3/Ft_onion.git
    
  2. Inside the cloned repository run:
    make && make exec
    
  3. The Server container generates in the srv/url directory the HTTP and SSH urls for the hidden tor services.
    • srv/url/hidden_service/hostname -> HTTP
    • srv/url/other_hidden_service/hostname -> SSH

Access to the Services:

Enjoy it!

View the source code here


Project completed

Rating: lgomes-o's 42 ft_onion Score

Next Project

Stockholm - 42Madrid