diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b358df0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM python:3.8-slim-buster + +# Create non-root user to run pyja3mas as +RUN useradd ja3user + +WORKDIR /opt/pyja3mas + +COPY requirements.txt *.py ./ + +RUN python3 -m pip install -r requirements.txt + +RUN mkdir certs logs + +# Generate key and certificate for pyja3mas +RUN openssl req -newkey rsa:4096 -nodes -keyout certs/privkey.pem -x509 -days 365 -out certs/fullchain.pem -subj "/C=US/ST=VA/L=Springfield/O=ACME/OU=IT/CN=localhost" + +RUN chown -R ja3user:ja3user certs logs + +USER ja3user + +CMD python3 https_server.py diff --git a/README.md b/README.md index bb85fbe..4bed647 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ python3 https_server.py ``` This will start the server on `localhost:4443` by default. You can visit -`https://localhost:4443` on your browser. Make sure you inlcude `https` in +`https://localhost:4443` on your browser. Make sure you include `https` in front of the domain, or the browser will not connect properly. To change the host/port, go into the code and edit the `HOST` and `PORT` global variables. @@ -68,3 +68,13 @@ browser's JA3 fingerprint, browser name, and browser version. It extracts all of this data, except for the JA3 fingerprint, from the User-Agent string your browser sends with the initial GET request. + +### Docker +To run pyja3mas as a Docker container, first build the Docker image with: +`docker build -t pyja3mas .` + +Then run the container with: +`docker run -p 127.0.0.1:443:4443 pyja3mas` + +This will listen on port 443 of your loopback adapter for connections and +forward them to the running pyja3mas script inside the container.