-
Notifications
You must be signed in to change notification settings - Fork 0
/
docksenum.py
127 lines (113 loc) · 4.84 KB
/
docksenum.py
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import webbrowser
import requests
from bs4 import BeautifulSoup
# Function to perform the Google search and display the results
def run_dork(keyword, dork):
if dork == 15:
postman_search(keyword)
return
query = get_query(keyword, dork)
print(f"\n----- Dork {dork} -----\n")
print(f"Performing Google search for '{query}'...")
search_results = []
headers = {'User-Agent': 'Mozilla/5.0'}
response = requests.get(f"https://www.google.com/search?q={query}", headers=headers)
soup = BeautifulSoup(response.text, 'html.parser')
results = soup.select('a')
for result in results:
url = result.get('href')
if url.startswith('/url?q='):
url = url[7:]
if 'google' not in url:
search_results.append(url)
if search_results:
print("\n----- Search Results -----")
for result in search_results:
print(result)
else:
print("No results found.")
# Function to get the dork query based on the dork number
def get_query(keyword, dork):
dork_queries = {
1: f"site:github.com OR site:gitlab.com OR site:bitbucket.org {keyword}",
2: f"site:s3.amazonaws.com {keyword}",
3: f"site:{keyword} -www {keyword}",
4: f"site:pastebin.com {keyword}",
5: f"site:{keyword} intitle:phpinfo",
6: f"site:{keyword} intitle:index of OR inurl:/logs",
7: f"site:{keyword} intext:'SQL Error'",
8: f"site:{keyword} intitle:apache +intext:conf | cnf | config",
9: f"site:{keyword} intitle:index of OR inurl:/",
10: f"site:{keyword} ext:sql OR ext:dbf OR ext:mdb",
11: f"site:{keyword} ext:doc OR ext:docx OR ext:odt OR ext:pdf OR ext:rtf OR ext:sxw OR ext:psw OR ext:ppt OR ext:pptx OR ext:pps OR ext:csv",
12: f"site:{keyword} inurl:readme OR inurl:license OR inurl:install OR inurl:setup OR inurl:config",
13: f"site:{keyword} inurl:/phpinfo.php OR inurl:.htaccess",
14: f"site:atlassian.net OR site:bitbucket.org {keyword}",
15: f"https://www.postman.com/search?q={keyword}&scope=public&type=request"
}
return dork_queries.get(dork, "")
# Function to display the help menu
def display_help():
print("Usage: python dork_search.py")
print("Interactive Dork Search Menu:")
print("1. GitHub, GitLab, Bitbucket Dork")
print("2. S3 Bucket Dork")
print("3. Subdomain Dork")
print("4. Pastebin Dork")
print("5. intitle:phpinfo Dork")
print("6. Logs Dork")
print("7. SQL Errors Dork")
print("8. Apache Config Files Dork")
print("9. Index and Directory Dork")
print("10. Database Files Dork")
print("11. File Extensions Dork")
print("12. Specific Files in URLs Dork")
print("13. PHP Info and .htaccess Files Dork")
print("14. Atlassian and Bitbucket Dork")
print("15. Postman Search")
print("-h or --help: Display this help menu")
print("\nGive credit to Shubham Pandey (GitHub: shubhamvpandey, LinkedIn: https://www.linkedin.com/in/shubham-pandey-10704014b/) for any suggestion and feedback.")
# Function to perform Postman search
def postman_search(keyword):
query = get_query(keyword, 15)
print(f"\n----- Postman Search -----\n")
print(f"Postman search URL: {query}")
webbrowser.open(query)
# Interactive menu
print("Welcome to Dork Search!")
print("This tool allows you to perform various Google dorks to search for specific information.")
print("Dork Search is developed by Shubham Pandey.")
print("Give credit to the developer and provide feedback to improve the tool.")
print("GitHub URL: https://github.com/shubhamvpandey")
print("LinkedIn URL: https://www.linkedin.com/in/shubham-pandey-10704014b/")
print("Please provide a keyword or domain name to search for.")
keyword = input("Keyword or domain name: ")
print("\nAvailable dorks:")
print("1. GitHub, GitLab, Bitbucket Dork")
print("2. S3 Bucket Dork")
print("3. Subdomain Dork")
print("4. Pastebin Dork")
print("5. intitle:phpinfo Dork")
print("6. Logs Dork")
print("7. SQL Errors Dork")
print("8. Apache Config Files Dork")
print("9. Index and Directory Dork")
print("10. Database Files Dork")
print("11. File Extensions Dork")
print("12. Specific Files in URLs Dork")
print("13. PHP Info and .htaccess Files Dork")
print("14. Atlassian and Bitbucket Dork")
print("15. Postman Search")
print("Enter 'all' to run all dorks.")
dork_input = input("Select a dork number or enter 'all': ")
if dork_input == "all":
for i in range(1, 16):
run_dork(keyword, i)
else:
try:
dork_number = int(dork_input)
run_dork(keyword, dork_number)
except ValueError:
print("Invalid input. Please select a valid dork number.")
print("\nThank you for using Dork Search!")
print("Give credit to Shubham Pandey (GitHub: shubhamvpandey, LinkedIn: https://www.linkedin.com/in/shubham-pandey-10704014b/) for any suggestion and feedback.")