Skip to content

Instantly share code, notes, and snippets.

@santaklouse
Last active January 12, 2024 12:50
Show Gist options
  • Save santaklouse/98dffe0043c26f406448d5ca54865e77 to your computer and use it in GitHub Desktop.
Save santaklouse/98dffe0043c26f406448d5ca54865e77 to your computer and use it in GitHub Desktop.
gsocket ssh using disposable thc servers

create segfault server configuration (details: https://www.thc.org/segfault/)

$ ssh root@segfault.net # The password is 'segfault'

~/.ssh/config

...
Host currentparent
    User root
    HostName adm.segfault.net
    IdentityFile ~/.ssh/id_sf-adm-segfault-net
    SetEnv SECRET=
...

Server

// gs forward to port 22 of local address 192.168.192.168

$ gs-netcat -l -d 192.168.192.168 -p 22 -s 'SECRETSTR' 

Client

version 1

Thc server

$ ssh currentparent

// create reverse port
$ curl sf/port

// get ip and port 
$ cat /config/self/reverse_*

$ tmux new-session -d 'gs-netcat -s "SECRETSTR" -p PORT -d IP'

and ssh to thc reverse port thats will forward us to server 22 port

$ ssh dev@IP -p PORT

version 2

one line ssh

$ ssh -o 'StrictHostKeyChecking no' -C -A -t -o ProxyCommand='ssh -C -A -T  currentparent gs-netcat -s "SECRETSTR"' dev@localhost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment