Skip to content

Instantly share code, notes, and snippets.

@orlea
Last active October 16, 2020 05:08
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 orlea/6ec16caa7fd7d46c95e7201310b4e43e to your computer and use it in GitHub Desktop.
Save orlea/6ec16caa7fd7d46c95e7201310b4e43e to your computer and use it in GitHub Desktop.
WatchGuard Firebox config downloader
import time
import json
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
options = Options()
options.add_argument('--headless')
desired_capabilities = DesiredCapabilities.CHROME.copy()
desired_capabilities['acceptInsecureCerts'] = True
driver = webdriver.Chrome(chrome_options=options, desired_capabilities=desired_capabilities)
driver.get("https://10.0.0.1:8080/auth/login?from_page=/")
driver.set_window_size(1080, 800)
driver.find_element(By.ID, "username").send_keys("status")
driver.find_element(By.ID, "password").send_keys("readonly")
driver.find_element(By.ID, "password").send_keys(Keys.ENTER)
driver.find_element(By.XPATH, "//*[@id='webui_nav_list']/li[8]").click()
time.sleep(2)
driver.find_element(By.LINK_TEXT, "構成ファイル").click()
time.sleep(5)
driver.find_element(By.ID, "download_config").click()
time.sleep(3)
driver.quit()
@orlea
Copy link
Author

orlea commented Oct 16, 2020

only japanese environment.
I have confirmed that it works on Ubuntu 20.04.

environment

  • Ubuntu 20.04
  • Python 3.8.5
  • Selenium 3.141.0
  • Google Chrome 86.0.4240.75
  • chromedriver 86.0.4240.20
  • Firebox 12.5.3

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