Skip to content

Commit

Permalink
Adding Files to the Thesis Repository
Browse files Browse the repository at this point in the history
  • Loading branch information
msladic1 authored May 25, 2024
1 parent aac3547 commit 11d555e
Show file tree
Hide file tree
Showing 52 changed files with 7,441 additions and 0 deletions.
112 changes: 112 additions & 0 deletions Fine-Tuning Dataset/Fine-tuning_data_complete.jsonl

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions Fine-Tuning Dataset/test-data.jsonl

Large diffs are not rendered by default.

123 changes: 123 additions & 0 deletions Human Evaluation of shelLM's Deception Capabilities/Cowrie/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# This Dockerfile contains two images, `builder` and `runtime`.

# `builder` contains all necessary code to build

# `runtime` is stripped down.

ARG ARCH=

ARG BUILD_DATE

ARG TAG

FROM ${ARCH}debian:bookworm-slim as builder

WORKDIR /

# This is a temporary workaround, see https://github.com/cowrie/docker-cowrie/issues/26

ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1

ENV COWRIE_GROUP=cowrie \
COWRIE_USER=cowrie \
COWRIE_HOME=/cowrie

# Set locale to UTF-8, otherwise upstream libraries have bytes/string conversion issues

ENV LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8

RUN groupadd -r ${COWRIE_GROUP} && \
useradd -r -d ${COWRIE_HOME} -m -g ${COWRIE_GROUP} ${COWRIE_USER}

# Set up Debian prereqs

RUN export DEBIAN_FRONTEND=noninteractive; \
apt-get -q update && \
apt-get -q install -y \
-o APT::Install-Suggests=false \
-o APT::Install-Recommends=false \
python3-pip \
ca-certificates \
libffi-dev \
libssl-dev \
python3-dev \
python3-venv \
python3 \
rustc \
cargo \
build-essential \
python3-virtualenv \
libsnappy-dev && \
rm -rf /var/lib/apt/lists/*


USER ${COWRIE_USER}

WORKDIR ${COWRIE_HOME}

# Copy requirements first to use Docker caching better

RUN mkdir -p ${COWRIE_HOME}/cowrie-git

COPY --chown=${COWRIE_USER}:${COWRIE_GROUP} requirements.txt requirements-output.txt ${COWRIE_HOME}/cowrie-git/

RUN python3 -m venv cowrie-env && \
. cowrie-env/bin/activate && \
pip install --no-cache-dir --upgrade pip wheel setuptools && \
pip install --no-cache-dir --upgrade cffi && \
pip install --no-cache-dir --upgrade -r ${COWRIE_HOME}/cowrie-git/requirements.txt && \
pip install --no-cache-dir --upgrade -r ${COWRIE_HOME}/cowrie-git/requirements-output.txt

COPY --chown=${COWRIE_USER}:${COWRIE_GROUP} . ${COWRIE_HOME}/cowrie-git

FROM gcr.io/distroless/python3-debian12 AS runtime

#FROM gcr.io/distroless/python3-debian12:debug AS runtime

LABEL org.opencontainers.image.created=${BUILD_DATE}
LABEL org.opencontainers.image.authors="Michel Oosterhof <[email protected]>"
LABEL org.opencontainers.image.url="https://cowrie.org/"
LABEL org.opencontainers.image.documentation="https://cowrie.readthedocs.io"
LABEL org.opencontainers.image.source="https://github.com/cowrie/cowrie"
LABEL org.opencontainers.image.version=${TAG}
LABEL org.opencontainers.image.revision="Source control revision identifier for the packaged software."
LABEL org.opencontainers.image.vendor="Cowrie"
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.ref.name=${TAG}
LABEL org.opencontainers.image.title="Cowrie SSH/Telnet Honeypot"
LABEL org.opencontainers.image.description="Cowrie SSH/Telnet Honeypot"

#LABEL org.opencontainers.image.base.digest="7beb0248fd81"

LABEL org.opencontainers.image.base.name="gcr.io/distroless/python3-debian12"

ENV COWRIE_GROUP=cowrie \
COWRIE_USER=cowrie \
COWRIE_HOME=/cowrie


COPY --from=builder --chown=0:0 /etc/passwd /etc/passwd
COPY --from=builder --chown=0:0 /etc/group /etc/group

COPY --from=builder --chown=${COWRIE_USER}:${COWRIE_GROUP} ${COWRIE_HOME} ${COWRIE_HOME}

RUN [ "python3", "-m", "compileall", "${COWRIE_HOME}", "/usr/lib/python3.11" ]

VOLUME [ "/cowrie/cowrie-git/var", "/cowrie/cowrie-git/etc" ]

USER ${COWRIE_USER}

WORKDIR ${COWRIE_HOME}/cowrie-git

ENV PATH=${COWRIE_HOME}/cowrie-env/bin:${PATH}
ENV PYTHONPATH=${COWRIE_HOME}/cowrie-git/src
ENV PYTHONUNBUFFERED=1


ENTRYPOINT [ "/cowrie/cowrie-env/bin/python3" ]

CMD [ "/cowrie/cowrie-env/bin/twistd", "-n", "--umask=0022", "--pidfile=", "cowrie" ]

EXPOSE 2222 2223
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM ubuntu:latest

RUN apt-get update && apt-get install -y && \
apt-get install -y openssh-server

RUN mkdir /var/run/sshd

RUN useradd -m tomas && \
echo "tomas:tomy" | chpasswd && \
useradd -m anna && \
echo "anna:thispas" | chpasswd

RUN echo 'root:your_password' | chpasswd

RUN mkdir -p /home/tomas/Documents && \
mkdir -p /home/tomas/Desktop && \
mkdir -p /home/tomas/Public && \
mkdir -p /home/tomas/Misc

RUN touch /home/tomas/Documents/notes.txt && \
echo "Remember to wash the dishes!" > /home/tomas/Documents/notes.txt

RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && \
echo "export VISIBLE=now" >> /etc/profile

RUN chown -R tomas:tomas /home/tomas
RUN chown -R anna:anna /home/anna

RUN usermod -s /bin/bash tomas && \
usermod -s /bin/bash anna

COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

USER root
WORKDIR /home/tomas

EXPOSE 22

CMD ["/entrypoint.sh"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

/usr/sbin/sshd -D &
/bin/bash
136 changes: 136 additions & 0 deletions Human Evaluation of shelLM's Deception Capabilities/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
version: '3.3'

services:
webpage:
build: ./experiments_webpage
container_name: experiments_webpage
hostname: experiments_webpage
restart: always
volumes:
- ./experiments_webpage/emails.txt:/app/emails.txt:rw
- ./experiments_webpage/keys.txt:/app/keys.txt:rw
networks:
thesis_muris_frontend:
ipv4_address: 172.30.222.2
deploy:
resources:
limits:
cpus: '3'
memory: 4GB
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
compress: "True"
labels:
- "traefik.enable=true"
- "traefik.http.routers.webpage.entrypoints=websecure"
- "traefik.http.routers.webpage.rule=Host(`shellsevaluation.thesis.stratosphereips.org`)"
- "traefik.http.routers.webpage.tls.certresolver=resolver"
- "traefik.http.services.webpage.loadbalancer.server.port=3000"

webssh:
build: ./webssh
container_name: webssh
hostname: webssh
restart: always
networks:
thesis_muris:
ipv4_address: 172.30.224.3
healthcheck:
test: ["CMD", "python", "-c", "'import requests; response = requests.get(\"http://localhost:8888/\"); assert response.status_code == 200'"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
deploy:
resources:
limits:
cpus: '3'
memory: 4GB
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
compress: "True"
labels:
- "traefik.enable=true"
- "traefik.http.routers.webssh.entrypoints=websecure"
- "traefik.http.routers.webssh.rule=Host(`backend-shellsevaluation.thesis.stratosphereips.org`)"
- "traefik.http.routers.webssh.tls.certresolver=resolver"
- "traefik.http.services.webssh.loadbalancer.server.port=8888"

shellm:
build: ./shelLM
container_name: courageous_coyote
hostname: ailabs
restart: always
volumes:
- ./shelLM/logs:/opt/system/logs:rw
- ./shelLM/historylogs:/opt/system/historylogs:rw
networks:
thesis_muris:
ipv4_address: 172.30.224.11
deploy:
resources:
limits:
cpus: '3'
memory: 4GB
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
compress: "True"

cowrie:
image: sladimur/dockcow
container_name: mystic_merlin
hostname: ailabs
restart: always
networks:
thesis_muris:
ipv4_address: 172.30.224.12
deploy:
resources:
limits:
cpus: '3'
memory: 4GB
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
compress: "True"

ubuntu:
image: sladimur/regular_updated
container_name: whimsical_wombat
hostname: ailabs
restart: always
stdin_open: true # Keeps stdin open
tty: true # Allocates a tty
networks:
thesis_muris:
ipv4_address: 172.30.224.13
deploy:
resources:
limits:
cpus: '3'
memory: 4GB
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
compress: "True"

networks:
thesis_muris:
external: true
thesis_muris_backend:
external: true
thesis_muris_frontend:
external: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM cgr.dev/chainguard/node:latest

WORKDIR /app

COPY package.json .

RUN npm install

COPY Logos.jpg .
COPY Experiment.html .
COPY experiment.js .
COPY emails.txt .
COPY keys.txt .

USER root
RUN chmod 666 keys.txt
RUN chmod 666 emails.txt

ENTRYPOINT [ "node", "experiment.js" ]
Loading

0 comments on commit 11d555e

Please sign in to comment.