Skip to content

Instantly share code, notes, and snippets.

@TheNilesh
Last active April 6, 2020 13:41
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 TheNilesh/69acad71e08beece00858a00678382ab to your computer and use it in GitHub Desktop.
Save TheNilesh/69acad71e08beece00858a00678382ab to your computer and use it in GitHub Desktop.
dir615_url = 'http://192.168.1.1'
form_url = 'url to the google form which has only two text fields one for ssid and another for wpa key'
print('logging in to router')
requests.post(dir615_url + '/login.cgi',data={'username':username, 'password':password, 'submit.htm?login.htm':'Send'})
print('getting pass page')
response = requests.get(dir615_url + '/wlan_basic.htm')
soup = BeautifulSoup(response.content, 'html.parser')
input_passphrase = soup.find('input', {'name':'pskValue'})
passphrase = input_passphrase['value']
input_ssid = soup.find('input', {'name':'ssid'})
ssid = input_ssid['value']
fields_to_submit = [ssid, passphrase]
print(fields_to_submit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment