opsdisk / pagodo

pagodo (Passive Google Dork) - Automate Google Hacking Database scraping and searching
GNU General Public License v3.0
2.77k stars 493 forks source link

[-] ERROR with dork: #10

Closed MelissaMV closed 6 years ago

MelissaMV commented 6 years ago

I'm getting this error with each dork after every query is that normal?

[-] ERROR with dork: about.php?cartID=

opsdisk commented 6 years ago

Hi @MelissaMV

Could you provide me the python version (python -V) you are running, the full command line with switches, and the output you're seeing?

MelissaMV commented 6 years ago

@opsdisk Sure here are the details:

Kali Linux Python 2.7.14

(Note: I asterisk out the site name)

root@kali:~/Desktop/pagodo# python pagodo.py -d http://********.co.tt -g google_dorks.txt -l 50 -s -e 30.0 -j 1.1

[] Initiation timestamp: 20171229_211706 [] Search ( 1 / 100 ) for Google dork [ "Error Diagnostic Information" intitle:"Error Occurred While" site:http://********.co.tt ] and waiting 61.7573006391 seconds between searches [-] ERROR with dork: "Error Diagnostic Information" intitle:"Error Occurred While"

[*] Search ( 2 / 100 ) for Google dork [ intitle:index.of finances.xls site:http://********.co.tt ] and waiting 62.7753368763 seconds between searches [-] ERROR with dork: intitle:index.of finances.xls

...and the errors continues until it reaches the full 50 dorks.

opsdisk commented 6 years ago

Hi @MelissaMV - sorry it took a while to get back. Try without the http:// prepended to the domain. So just the domain python pagodo.py -d example.com. If that doesn't fix that, it may be that Google is detecting it as a bot, so you need to wait an hour or so.

MelissaMV commented 6 years ago

@opsdisk thx for your response - i tried what you said without the "http://" but I'm getting the same error, so I guess Google is detecting it as a bot.

Is there a way around this?

opsdisk commented 6 years ago

Hmmm...what version of the google module do you have?

pip freeze | egrep google

It looks like the latest is 2.0.1 and I was getting some errors with that one. You mind throwing some debug print statements around each main block of code to see where it stops executing and paste that output? I'm trying to determine which line is causing the issues. Something like this:

print("1")
for url in google.search(query, start=0, stop=self.search_max, num=100, pause=pause_time, extra_params={'filter': '0'}, user_agent=google.get_random_user_agent()):
    self.links.append(url)
print("2")

# Since google.search method retreives URLs in batches of 100, ensure the file list only contains the requested amount
if len(self.links) > self.search_max:
    self.links = self.links[:-(len(self.links) - self.search_max)]
print("3")

print("[*] Results: " + str(len(self.links)) + " sites found for Google dork: " + dork)
print("4")
for foundDork in self.links:
    print(foundDork)
print("5")
self.total_dorks += len(self.links)
print("6")
# Only save links with valid results to an output file
if self.save_links and (self.links):
    f = open(self.log_file, 'a')
    f.write('#: ' + dork + "\n")
    for link in self.links:
        f.write(link + "\n")
    f.write("=" * 50 + "\n")
f.close
print("7")
opsdisk commented 6 years ago

Just pushed up some new code. Let me know if it is still giving you issues.

MelissaMV commented 6 years ago

yup got the same "ERROR with dork" on every dork in my list including your "google_dorks.txt list and i'm using google 2.0.1...well i guess if its working on your side and not my side its prolly my Kali Linux has some screwed up configuration somewhere lol but thx anywayz for trying to help me :)

Do you know any script that can open dorks in a file in multiple x tabs in firefox or googlechrome?? I mean you can just load a dork file in a script, run the script and it will open a browser that will search for all the dorks in different tabs. May be that doesn't make sense but i was just wondering lol

thesilas commented 6 years ago

I get the same error as @MelissaMV.

opsdisk commented 6 years ago

@MelissaMV @thesilas Can you put some print statements between the lines as suggested by https://github.com/opsdisk/pagodo/issues/10#issuecomment-357535182

Trying to figure out where it's failing.

thesilas commented 6 years ago

@opsdisk I just added the statements as you suggested and got the following output:

python pagodo.py -d ***.** -g google_dorks.txt -l 50 -s -e 35.0 -j 1.1
[*] Initiation timestamp: 20180206_230930
[*] Search ( 1 / 3612 ) for Google dork [ netflix site:***.** ] and waiting 73.4667123037 seconds between searches
1 
[-] ERROR with dork: netflix
[*] Search ( 2 / 3612 ) for Google dork [ "Error Diagnostic Information" intitle:"Error Occurred While" site:***.** ] and waiting 71.2552759055 seconds between searches
1
[-] ERROR with dork: "Error Diagnostic Information" intitle:"Error Occurred While"
[*] Search ( 3 / 3612 ) for Google dork [ intitle:index.of finances.xls site:***.** ] and waiting 72.4720777609 seconds between searches

I added the "netflix" test dork because I manually verified that it returns a result.

python -V
Python 2.7.14+
pip freeze | egrep google
Warning: cannot find svn location for chirp===daily-20170714
google==2.0.0
opsdisk commented 6 years ago

@thesilas thanks for that info...looks like it's something with googlesearch.search function. Couple of things:

1) You're using the latest script with googlesearch.search and not google.search 2) Can you run pip freeze | egrep google again? It should be version 2.0.1. 3) Install requirements again: pip install -r requirements.txt 4) Start the python interpreter (by typing python) and run the four lines.

# python
>>> import googlesearch
>>> urls = googlesearch.search("test")
>>> for x in urls:
...     print(x)

That should return some urls.

5) I doubt it, but it may be something with the domain you're searching for. If you're comfortable sharing it, send me an email at the address found here: https://www.opsdisk.com/#contact and I can try it.

@MelissaMV if you pass a domain to firefox it will open it. So running firefox github.com from the command line will open github.com in a new tab. You could loop through the google dork list and spawn a new tab for each one.

thesilas commented 6 years ago

@opsdisk thanks for the instructions. It turns out that I didn't install the requirements using

pip install -r requirements.txt

after I did so I didnt get the error anymore and the tool works. So for me the issue could be closed. @MelissaMV did you too run pagodo without first installing the requirements?

@opsdisk I made a pull request with an updated version of the readme that includes a short section regarding the installation because I think that other people might too miss installing the requirements and could end up facing the same error as I did.

cr4zyd3v commented 6 years ago

I'm getting the same error and when print(x) is used i get 503 service unavaible.. the same thing that happens on doork project.. google is banning our requests i think \o/ would be cool if it was possible to request pages with diferent headers like v3n0m does

thesilas commented 6 years ago

@marciks after some request I too get 503. not sure yet what a good -e delay value is. I just tried with 65 but after some successfull request I get the 503 error again. Then you have to wait a while or switch to another public source IP. @opsdisk do you use the default values or can you recommend other values that prevent the google detection?

opsdisk commented 6 years ago

@marciks What HTTP headers are you specifying? Do you mean the User-Agent? I implemented this in my metagoofil fork (https://github.com/opsdisk/metagoofil/blob/master/metagoofil.py#L173) and just realized (thanks to you) I hadn't implemented it in this one. If that's the case, please create an issue and I'll add it in.

@thesilas to answer your question, the defaults (jitter and delay) have worked for me in the past. It took almost 2 days to completely run it my first time through. It's definitely not a quick kill script. Maybe switching up the User-Agent like I suggested above would help.

opsdisk commented 6 years ago

Closing this issue.