Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $apiKey = 'AIzaSyA70vFWBqo9sM-itSDfahGmmByIxdGlkDI';
- $url ='http://www.bbc.com/';
- $url = urlencode($url);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://sb-ssl.google.com/safebrowsing/api/lookup?client=firefox&key='. $apiKey.'&appver=1.5.2&pver=4.0&url='.$url");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POST, 1);
- $headers = array();
- $headers[] = "Content-Type: application/json";
- $headers[] = "Content-length: auto";
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $result = curl_exec($ch);
- if (curl_errno($ch)) {
- echo 'Error:' . curl_error($ch);
- }
- curl_close ($ch);
- echo print_r($result, true);
- $url = 'http://911.sos-empleados.net';
- $apiKey = 'Your API';
- $apiUrl = 'https://safebrowsing.googleapis.com/v4/threatMatches:find?key='.$apiKey;
- $params = [
- 'client' => [
- 'clientId' => 'foobar',
- 'clientVersion' => '1.2.3'
- ],
- 'threatInfo' => [
- "threatTypes" =>["MALWARE", "SOCIAL_ENGINEERING"],
- "platformTypes" => ["WINDOWS"],
- 'threatEntryTypes' => ['URL'],
- 'threatEntries' => [
- [ 'url' => $url ]
- ]
- ]
- ];
- $ch = curl_init($apiUrl);
- curl_setopt_array($ch, [
- CURLOPT_POST => 1,
- CURLOPT_RETURNTRANSFER => 1,
- CURLOPT_HEADER => 1,
- CURLOPT_POSTFIELDS => json_encode($params),
- CURLOPT_HTTPHEADER => [
- 'Content-Type: text/json'
- ]
- ]);
- $res = curl_exec($ch);
- ?> <pre><?php echo print_r($res, true); ?></pre> <?php
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement