-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutoDork.py
More file actions
50 lines (37 loc) · 1.59 KB
/
AutoDork.py
File metadata and controls
50 lines (37 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
############################################
# #
# To-do: #
# Screenshots folder #
# If no results don't screenshot #
# Proxies #
# Threading #
# #
# #
############################################
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
import argparse
def AutoDork(filename):
domain_parser = argparse.ArgumentParser(description="Usage: python3 AutoDork.py google.com")
domain_parser.add_argument('domain', metavar='exampledomain.com', help='Domain to be dorked')
args = domain_parser.parse_args()
domain = args.domain
print(domain)
iteration = 0
filename = open(filename, 'r')
for line in filename:
dork = line.replace("`domain`", f"{domain}")
print(dork)
options = Options()
options.add_argument("--headless=new")
driver = webdriver.Chrome(options=options)
driver.get(f'https://www.google.com/search?q={dork}')
S = lambda X: driver.execute_script('return document.body.parentNode.scroll'+X)
driver.set_window_size(1920,S('Height'))
driver.find_element(By.TAG_NAME, 'body').screenshot(f'screenshot' + f'{iteration}.png')
iteration += 1
filename.close()
driver.quit()
AutoDork("dorks.txt")