Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xxxVxxx/e1e62dfc5cc3cec564b3c5f17c763046 to your computer and use it in GitHub Desktop.
Save xxxVxxx/e1e62dfc5cc3cec564b3c5f17c763046 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import sys
try:
import pexpect
except ImportError:
sys.stderr.write("\nPexpect is not installed. You can do so with 'pip install pexpect' :)\n\n")
exit(1)
def connect(root_pass,username, password, response='phone'):
conn = pexpect.spawn('sudo openvpn --config /usr/bin/client.ovpn --auth-retry interact')
conn.logfile = None
conn.expect('\[sudo\]')
conn.sendline(root_pass)
conn.logfile = sys.stdout
conn.expect('Username:')
conn.sendline(username)
conn.expect('Password:')
conn.logfile = None
conn.sendline(password)
conn.logfile = sys.stdout
conn.expect('Response:')
conn.delaybeforesend = 1
conn.sendline(response)
conn.expect('Initialization Sequence Completed')
def main():
root_pass = '@#$!@$!@#$' # replace with your system root password. NOTE: This is also not my password :D
username = 'xxxVxxx' # replace with your username. NOTE. This is my username :)
password = 'h14!BYEbOH4BOLm' # replace with your password. NOTE: This is also not my password :P
response = '' # set this to push if you want to use your mobile duo notification
connect(root_pass, username, password)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment