oll98 / phpgsb

Automatically exported from code.google.com/p/phpgsb
Other
1 stars 0 forks source link

Test fails "http://www.gumblar.cn" #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
You have stated in lookup.php that 
"var_dump($phpgsb->doLookup('http://www.gumblar.cn'));" should be true, but it 
returns false.

Original issue reported on code.google.com by me...@mavitunasecurity.com on 11 Dec 2011 at 7:47

GoogleCodeExporter commented 8 years ago
How long have you been running listupdater.php for?

Original comment by cleaver....@gmail.com on 11 Dec 2011 at 7:48

GoogleCodeExporter commented 8 years ago
I think it has been running about 15 minutes. Can I make request during the 
first list-updater.php run ?

Original comment by me...@mavitunasecurity.com on 11 Dec 2011 at 8:00

GoogleCodeExporter commented 8 years ago
I'm afraid not, Google mandate that the database has to be updated in "chunks" 
(mainly to reduce the load on their server).
See note in the INSTALL file:

NOTE: The database is updated in chunks, because of this you need
to leave the updater script (listupdater.php) on the 1 minute cron
for at least 12 hours (24 hours is safest). This it to allow it to
syncronise with Google's servers. This must be done before you can
use the lookup functions.

If your your script can't wait that long then you could use their Lookup API 
but its nowhere near as efficient in terms of lookup speeds (and I think they 
cap the lookups at a certain number). 
http://code.google.com/apis/safebrowsing/lookup_guide.html

Original comment by cleaver....@gmail.com on 11 Dec 2011 at 8:06

GoogleCodeExporter commented 8 years ago
Just to clarify, the script doesn't actually "run" every minute but the minute 
cron is needed to take into account back-off procedures in case of errors etc.

Original comment by cleaver....@gmail.com on 11 Dec 2011 at 8:07

GoogleCodeExporter commented 8 years ago
>>This must be done before you can
use the lookup functions.

I have used lookup functions and started the cron job. On that case, isn't it 
possible to make lookups after the cron job or would there a problem ?

>>Just to clarify, the script doesn't actually "run" every minute but the 
minute cron is needed to take into account back-off procedures in case of 
errors etc.

Yeah, I see notes from cron job says that :

<br/>Must wait another 213 seconds before another request...<br/>

Original comment by me...@mavitunasecurity.com on 11 Dec 2011 at 8:11

GoogleCodeExporter commented 8 years ago
Strictly speaking, you can use the lookup functions but they won't be 
accurate/fully working until a minimum of 12 hours. They may return false when 
in fact the URL is malicious. 

So after listupdater.php has been running on cron for at least 12 hours (24 
hours is safer) your lookup requests should be accurate. Obviously after 12/24 
hours you still need to keep the cron running to ensure your database stays in 
sync with Google's.

Not the tidiest way of doing it but I don't think Google thought everything 
through fully when designing the API!

Original comment by cleaver....@gmail.com on 11 Dec 2011 at 8:19

GoogleCodeExporter commented 8 years ago
>>I have used lookup functions and started the cron job. On that case, isn't it 
>>possible to make lookups after the cron job or would there a problem ?

If you want to make lookups at scheduled intervals I would probably setup a 
seperate cron (and you probably wouldn't want to check every minute!). 

Original comment by cleaver....@gmail.com on 11 Dec 2011 at 8:26

GoogleCodeExporter commented 8 years ago
Okay then, I clearly understand the setup.

Thanks for answering my questions.

Original comment by me...@mavitunasecurity.com on 11 Dec 2011 at 8:30

GoogleCodeExporter commented 8 years ago
No problem, just create a new ticket if you have any more issues. 
Best of luck with your project.

Original comment by cleaver....@gmail.com on 11 Dec 2011 at 8:32