Saturday, August 22, 2020

Pagodo - Automate Google Hacking Database Scraping And Searching


The goal of this project was to develop a passive Google dork script to collect potentially vulnerable web pages and applications on the Internet. There are 2 parts. The first is ghdb_scraper.py that retrieves Google Dorks and the second portion is pagodo.py that leverages the information gathered by ghdb_scraper.py.

What are Google Dorks?
The awesome folks at Offensive Security maintain the Google Hacking Database (GHDB) found here: https://www.exploit-db.com/google-hacking-database. It is a collection of Google searches, called dorks, that can be used to find potentially vulnerable boxes or other juicy info that is picked up by Google's search bots.

Installation
Scripts are written for Python 3.6+. Clone the git repository and install the requirements.
git clone https://github.com/opsdisk/pagodo.git
cd pagodo
virtualenv -p python3 .venv # If using a virtual environment.
source .venv/bin/activate # If using a virtual environment.
pip install -r requirements.txt

Google is blocking me!
If you start getting HTTP 503 errors, Google has rightfully detected you as a bot and will block your IP for a set period of time. The solution is to use proxychains and a bank of proxies to round robin the lookups.
Install proxychains4
apt install proxychains4 -y
Edit the /etc/proxychains4.conf configuration file to round robin the look ups through different proxy servers. In the example below, 2 different dynamic socks proxies have been set up with different local listening ports (9050 and 9051). Don't know how to utilize SSH and dynamic socks proxies? Do yourself a favor and pick up a copy of The Cyber Plumber's Handbook to learn all about Secure Shell (SSH) tunneling, port redirection, and bending traffic like a boss.
vim /etc/proxychains4.conf
round_robin
chain_len = 1
proxy_dns
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000
[ProxyList]
socks4 127.0.0.1 9050
socks4 127.0.0.1 9051
Throw proxychains4 in front of the Python script and each lookup will go through a different proxy (and thus source from a different IP). You could even tune down the -e delay time because you will be leveraging different proxy boxes.
proxychains4 python3 pagodo.py -g ALL_dorks.txt -s -e 17.0 -l 700 -j 1.1

ghdb_scraper.py
To start off, pagodo.py needs a list of all the current Google dorks. A datetimestamped file with the Google dorks and the indididual dork category dorks are also provided in the repo. Fortunately, the entire database can be pulled back with 1 GET request using ghdb_scraper.py. You can dump all dorks to a file, the individual dork categories to separate dork files, or the entire json blob if you want more contextual data about the dork.
To retrieve all dorks
python3 ghdb_scraper.py -j -s
To retrieve all dorks and write them to individual categories:
python3 ghdb_scraper.py -i
Dork categories:
categories = {      1: "Footholds",      2: "File Containing Usernames",      3: "Sensitives Directories",      4: "Web Server Detection",      5: "Vulnerable Files",      6: "Vulnerable Servers",      7: "Error Messages",      8: "File Containing Juicy Info",      9: "File Containing Passwords",      10: "Sensitive Online Shopping Info",      11: "Network or Vulnerability Data",      12: "Pages Containing Login Portals",      13: "Various Online devices",      14: "Advisories and Vulnerabilities",  }  

pagodo.py
Now that a file with the most recent Google dorks exists, it can be fed into pagodo.py using the -g switch to start collecting potentially vulnerable public applications. pagodo.py leverages the google python library to search Google for sites with the Google dork, such as:
intitle:"ListMail Login" admin -demo  
The -d switch can be used to specify a domain and functions as the Google search operator:
site:example.com  
Performing ~4600 search requests to Google as fast as possible will simply not work. Google will rightfully detect it as a bot and block your IP for a set period of time. In order to make the search queries appear more human, a couple of enhancements have been made. A pull request was made and accepted by the maintainer of the Python google module to allow for User-Agent randomization in the Google search queries. This feature is available in 1.9.3 and allows you to randomize the different user agents used for each search. This emulates the different browsers used in a large corporate environment.
The second enhancement focuses on randomizing the time between search queries. A minimum delay is specified using the -e option and a jitter factor is used to add time on to the minimum delay number. A list of 50 jitter times is created and one is randomly appended to the minimum delay time for each Google dork search.
categories = {
1: "Footholds",
2: "File Containing Usernames",
3: "Sensitives Directories",
4: "Web Server Detection",
5: "Vulnerable Files",
6: "Vulnerable Servers",
7: "Error Messages",
8: "File Containing Juicy Info",
9: "File Containing Passwords",
10: "Sensitive Online Shopping Info",
11: "Network or Vulnerability Data",
12: "Pages Containing Login Portals",
13: "Various Online devices",
14: "Advisories and Vulnerabilities",
}
Latter in the script, a random time is selected from the jitter array and added to the delay.
intitle:"ListMail Login" admin -demo
Experiment with the values, but the defaults successfully worked without Google blocking my IP. Note that it could take a few days (3 on average) to run so be sure you have the time.
To run it:
site:example.com

Conclusion
Comments, suggestions, and improvements are always welcome. Be sure to follow @opsdisk on Twitter for the latest updates.




via KitPloit

Related word


  1. Hacker Hardware Tools
  2. Hacker Techniques Tools And Incident Handling
  3. Pentest Tools List
  4. Computer Hacker
  5. Pentest Tools For Mac
  6. Hack Tools Mac
  7. Pentest Tools Nmap
  8. Hacker Tools Mac
  9. Pentest Tools For Windows
  10. Pentest Tools Nmap
  11. Pentest Tools For Windows
  12. Hackers Toolbox
  13. Hacking App
  14. Hack App
  15. Pentest Tools For Windows
  16. Hacking Tools Kit
  17. Tools Used For Hacking
  18. Pentest Tools
  19. Pentest Tools Online
  20. Hacking Tools For Windows Free Download
  21. Hacker Techniques Tools And Incident Handling
  22. Pentest Tools Website
  23. Best Hacking Tools 2019
  24. Top Pentest Tools
  25. Hack Apps
  26. Hackrf Tools
  27. Pentest Tools Kali Linux
  28. Blackhat Hacker Tools
  29. Hack App
  30. Hacker Tools Hardware
  31. Hacker Tools Online
  32. Black Hat Hacker Tools
  33. Github Hacking Tools
  34. Hack Tools
  35. Hack Tools Online
  36. Tools For Hacker
  37. Tools 4 Hack
  38. Pentest Tools Windows
  39. Pentest Tools Github
  40. Pentest Box Tools Download
  41. Hack And Tools
  42. Pentest Tools For Ubuntu
  43. Pentest Tools Linux
  44. Hack Tools Mac
  45. Pentest Tools Subdomain
  46. Computer Hacker
  47. Pentest Tools Tcp Port Scanner
  48. Pentest Tools Website
  49. Best Hacking Tools 2020
  50. Hacker Security Tools
  51. World No 1 Hacker Software
  52. How To Make Hacking Tools
  53. Hack Apps
  54. Hack Website Online Tool
  55. How To Hack
  56. Tools For Hacker
  57. Ethical Hacker Tools
  58. Pentest Tools Website
  59. Pentest Tools Framework
  60. Tools For Hacker
  61. Github Hacking Tools
  62. Hacker Tools Free
  63. Hack Tools Github
  64. Hacker Tools Free
  65. Pentest Tools Subdomain
  66. Github Hacking Tools
  67. Hack Apps
  68. Hacking Tools For Beginners
  69. Hacker Tools List
  70. Hacker Tool Kit
  71. Wifi Hacker Tools For Windows
  72. Pentest Tools Github
  73. Pentest Tools For Windows
  74. Hacking Tools Name
  75. Hacker Tools For Ios
  76. Hack Tools For Ubuntu
  77. Hacker Tools Free Download
  78. Hak5 Tools
  79. How To Install Pentest Tools In Ubuntu
  80. Hack Tools For Mac
  81. Hacker Tools Online
  82. Hack Tools Mac
  83. Pentest Tools Kali Linux
  84. What Is Hacking Tools
  85. Blackhat Hacker Tools
  86. Hacking Apps
  87. Hacks And Tools
  88. Hack Tools
  89. Pentest Tools Windows
  90. How To Hack
  91. Hacker Tools For Windows
  92. Pentest Tools Port Scanner
  93. Pentest Tools Subdomain
  94. Hacker Tools Mac
  95. Pentest Tools Apk
  96. Github Hacking Tools
  97. Hack Rom Tools
  98. Best Hacking Tools 2019
  99. Hacking Tools Download
  100. Pentest Tools Download
  101. Hackers Toolbox
  102. New Hacker Tools
  103. Hack Tools For Pc
  104. Pentest Tools Github
  105. Hacking Tools For Kali Linux
  106. Hack Tools For Pc
  107. Pentest Tools For Ubuntu
  108. Hacker Tools For Pc
  109. Pentest Automation Tools
  110. Wifi Hacker Tools For Windows
  111. Usb Pentest Tools
  112. Nsa Hack Tools Download
  113. Hacker Tools Mac
  114. Pentest Tools Bluekeep
  115. Android Hack Tools Github
  116. Pentest Tools Review
  117. Pentest Tools Port Scanner
  118. Hacker Tools Github
  119. Pentest Tools For Android
  120. Hack Apps
  121. Hack App
  122. Hack App
  123. Hacking Tools Github
  124. Hacking Tools Name
  125. Hack Tools
  126. Hack Tools 2019
  127. Pentest Tools Find Subdomains
  128. Hacker Tools Free
  129. Hack Tools For Windows
  130. Hacker Tools Online
  131. Hack Tools Github
  132. Pentest Tools Github
  133. Best Hacking Tools 2020
  134. Hacking Tools Hardware
  135. Pentest Tools Website Vulnerability
  136. Hack Rom Tools
  137. Pentest Tools Free
  138. Hacking Tools For Games
  139. Pentest Tools Github
  140. Hacker Tools Linux
  141. Hacker Tool Kit
  142. Easy Hack Tools
  143. Hacking Tools For Pc
  144. Hack Tools Github
  145. Hacking Tools Windows 10
  146. Nsa Hack Tools
  147. Install Pentest Tools Ubuntu
  148. Pentest Tools Port Scanner
  149. Pentest Recon Tools
  150. Pentest Tools Bluekeep
  151. Underground Hacker Sites
  152. What Is Hacking Tools
  153. Hacker Tools Apk
  154. Hack Tools Pc
  155. Bluetooth Hacking Tools Kali
  156. Hacker Security Tools
  157. Hacking Tools Usb
  158. Hack Tools For Games
  159. How To Make Hacking Tools
  160. Hacker Search Tools
  161. Pentest Tools Tcp Port Scanner
  162. Hacking Tools For Windows
  163. Hacker Security Tools
  164. Hack Tools
  165. Pentest Tools Alternative
  166. Pentest Tools List
  167. New Hacker Tools
  168. Nsa Hack Tools
  169. Pentest Automation Tools
  170. Black Hat Hacker Tools
  171. Hack Tools For Pc
  172. Pentest Tools Nmap
  173. Pentest Tools Website
  174. Pentest Tools Website
  175. Hack Tool Apk No Root
  176. Pentest Tools Online

No comments: