Skip to content

Latest commit

 

History

History
88 lines (66 loc) · 1.77 KB

colab.md

File metadata and controls

88 lines (66 loc) · 1.77 KB

Reverse Shell Colab Notebook

Steps:

  1. Install cloudflared
!curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb -o cloudflared.deb
!sudo dpkg -i cloudflared.deb
!sudo apt-get install -f
  1. Install pm2
!npm install -g pm2
  1. Install netcat from source
!wget http://sourceforge.net/projects/netcat/files/netcat/0.7.1/netcat-0.7.1.tar.gz
!tar -xvf netcat-0.7.1.tar.gz
!cd netcat-0.7.1 && ./configure
!cd netcat-0.7.1 && sudo make && sudo make install
!mv /usr/local/bin/nc /usr/local/bin/nothing
!nothing -h
  1. Start reverse shell
  • nothing.sh
#!/bin/bash

nothing -l -p 8888 -e /bin/bash
!pm2 start nothing.sh --name nothing --watch
  1. Start cloudflared tunnel
  • tunnel.sh
#!/bin/bash

cloudflared tunnel --url tcp://localhost:8888
!pm2 start tunnel.sh --name tunnel
!pm2 logs tunnel #get the domain
  1. From local machine:
nc localhost 8888
python -c 'import pty; pty.spawn("/bin/bash")'

Commands

%%capture --no-display
!pm2 start server.py --name server --watch && pm2 start tunnel.sh --name tunnel

!cloudflared tunnel --url http://localhost:8888
!cloudflared tunnel --url tcp://localhost:8888

!pm2 logs nothing --lines 100
!pm2 flush
!pm2 logs
!pm2 status
!pm2 stop all
!pm2 delete all