Skip to content

Instantly share code, notes, and snippets.

@Maecenas
Last active November 26, 2023 01:07
Show Gist options
  • Save Maecenas/fd0a103929ecc867043654dafce410ac to your computer and use it in GitHub Desktop.
Save Maecenas/fd0a103929ecc867043654dafce410ac to your computer and use it in GitHub Desktop.
My Connection Guide for CMU 14-741/18-631: Introduction to Information Security

My Connection Guide for 14-741/18-631

Settings

$ cat ~/.ssh/config
Host *
    TCPKeepAlive yes
    ServerAliveInterval 60
    ServerAliveCountMax 2
    ControlMaster auto
    ControlPath ~/.ssh/master_%r@%h:%p

Host 14741
    Hostname 14741hw.ini.cmu.edu
    User tunneler
    DynamicForward 8123
    Compression yes
    LogLevel QUIET
    RequestTTY no

Host 741
    Hostname 192.168.2.73
    User your_username
    #ProxyCommand /usr/bin/nc -x 127.0.0.1:8123 %h %p
    ProxyJump 14741

Usage

# In a terminal
$ #ssh -D 8123 -C -q -N tunneler@14741hw.ini.cmu.edu
$ ssh 14741

SSH tunnel started, shell disabled by the system administrator
TERM environment variable not set.

# In a new terminal
# For macOS user: DO use the /usr/bin/nc
$ #ssh -o ProxyCommand='/usr/bin/nc -x localhost:8123 %h %p' your_username@192.168.2.73
$ ssh 741

Warning: Permanently added '192.168.2.73' (ECDSA) to the list of known hosts.
Enter your platform password (characters will be hidden):
your_username@pico-local-dev-shell:~$ 

Developing Environment Setup with Docker

The following is about a containerized developing environment for 14-741/18-631, based on Docker and Ubuntu.

$ git clone https://gist.github.com/fd0a103929ecc867043654dafce410ac.git cmu-14741 && cd cmu-14741
$ docker-compose run --rm ctf
# can also run with Docker
$ docker run --rm -v "`pwd`":/app/ -it lx70716/cmu-14741
version: "3"
services:
ctf:
build: .
image: lx70716/cmu-14741:latest
container_name: cmu-14741
volumes:
- ./:/app/
- ./.bash_history:/root/.bash_history
- ~/.gdbinit:/root/.gdbinit
restart: "no"
stdin_open: true # --interactive Keep STDIN open even if not attached (docker exec -i)
tty: true # --tty Allocate a pseudo-TTY (docker exec -t)
security_opt:
- seccomp:unconfined
cap_add:
- SYS_PTRACE
FROM i386/ubuntu:18.04
WORKDIR /app
RUN apt-get update \
&& apt-get install -y \
build-essential \
binutils \
gdb \
gcc-multilib \
valgrind \
python \
vim \
&& rm -rf /var/lib/apt/lists/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment