forked from samcleaver/phpGSB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlookup.php
More file actions
21 lines (19 loc) · 761 Bytes
/
lookup.php
File metadata and controls
21 lines (19 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/**
* phpGSB - PHP Google Safe Browsing Implementation
* Released under New BSD License (see LICENSE)
* Copyright (c) 2010-2012, Sam Cleaver (Beaver6813, Beaver6813.com)
* All rights reserved.
*
* LOOKUP EXAMPLE
*/
include('config.php');
require("phpgsb.class.php");
$phpgsb = new phpGSB($config['db'], $config['user'], $config['pass'], $config['host']);
// Obtain an API key from: http://code.google.com/apis/safebrowsing/key_signup.html
$phpgsb->apikey = $config['api_key'];
$phpgsb->usinglists = array('googpub-phish-shavar','goog-malware-shavar');
// Should return false (not phishing or malware)
var_dump($phpgsb->doLookup('http://www.google.com'));
// Should return true, malicious URL
var_dump($phpgsb->doLookup('http://www.gumblar.cn'));