jonson1986

Google Safe Browsing MalwareDetection API

6 posts in this topic

Hello,

I've thousands of URLs to check them these are safe, malware infected or any other type of error, that's why I searched and found Google Safe browsing API with this we can send HTTP GET request so different code will return to make us clear is it our sent URL is safe or not. Please guide me how can i make this possible I know basics of Auotit but don't know how to use this API to fulfill above mentioned purpose. Your help will be much appreciated. Thanks

Here is API URL;

https://developers.google.com/safe-browsing/v3/lookup-guide

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("GET", "WEBSITE_HERE", False)
$oHTTP.Send()

$oStatusCode = $oHTTP.Status

ConsoleWrite($oStatusCode & @CRLF)

You need the API key, then you can replace WEBSITE_HERE with the complete URL like:

https://sb-ssl.google.com/safebrowsing/api/lookup?client=demo-app&key=12345&appver=1.5.2&pver=3.1&url=http%3A%2F%2Fianfette.org%2F

 

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites
38 minutes ago, Terenz said:
$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("GET", "WEBSITE_HERE", False)
$oHTTP.Send()

$oStatusCode = $oHTTP.Status

ConsoleWrite($oStatusCode & @CRLF)

You need the API key, then you can replace WEBSITE_HERE with the complete URL like:

https://sb-ssl.google.com/safebrowsing/api/lookup?client=demo-app&key=12345&appver=1.5.2&pver=3.1&url=http%3A%2F%2Fianfette.org%2F

Thanks for kind response:

but then I start this, I got 403 response even I put working key but not able to get required response

here is code;

$oHTTP.Open("GET", "https://sb-ssl.google.com/safebrowsing/api/lookup?client=AdminCP&key=MYKEY&appver=1.5.2&pver=3.1&url=http%3A%2F%2Fexample.com", False)

Quoted somewhere by google;

HTTP Status Codes

HTTP status codes the server can generate in response to an HTTP POST or HTTP GET request:

  • 200 OK: Successful request.
  • 400 Bad Request: Invalid argument (invalid request payload).
  • 403 Forbidden: Permission denied (invalid API key/quota exceeded).
  • 500 Internal Server Error: Internal server error (retry your request).
  • 503 Service Unavailable: Unavailable.
  • 504 Gateway Timeout: Deadline exceeded (retry your request).

Share this post


Link to post
Share on other sites

How often have your tried? maybe used up your quota?
Maybe check with the google support forum for details on this error?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Hello,

I never used any quota even if you use anything or get anything ever then you can considered might have been used but this is my first time I activate API and got its keys and asked autoit experts for help and when i tried i got this error.

even i tried after sometime nothing happen same response don't know why but it's happening all the time 403 error.

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

You likely are only allowed to query the API an X number of times per day (Quota), just check that on their site.
Also first make it work in a browser manually before trying to automate it.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • falcontechnics
      By falcontechnics
      Dear master, hello,
      I got the speech API from Google. But I could not find how to use. Could you help me with a simple example?
      "https://speech.googleapis.com/v1/speech:recognize?key=MyKey"
    • ct253704
      By ct253704
      Good morning,
      I am struggling to find a way to force a ControlClick on a particular hidden element within a Google Slides window. Using Au3Info doesn't work as the hidden text won't appear when attempting to gather the data. Using inspect element will show the class/title of the button, but using the class in the ControlClick function doesn't seem to do anything. Since this script is going to be running on multiple machines with different resolutions, MouseClick isn't a good option either. Can someone help me figure out how to click this full screen button?
      One more note - It says "Ctrl + Shift + F" for full screen, however sending that combo doesn't work - nor does actually using those keys on the keyboard. Possible conflict with AutoIT hotkeys? 
      Here's some sample code / screenshots to help:
      ControlClick($Title, "", "[CLASS:punch-viewer-icon punch-viewer-full-screen goog-inline-block]")  


    • jonson1986
      By jonson1986
      Hello,
      I'm trying to translate with google translator but not able to translate my text file from Russian to English and my output saved in text file is 0 instead of any translated text.
      I'm using a text file which contains 5 lines of Russian language and I want to translate it into English language and want to save it in other text file translated.txt but I'm not able to let it happen.
      Please help me how can I make this possible same code was working several months ago but not now especially don't know what's going wrong with my code of google translator.
       
      Here are my codes
      #RequireAdmin #include <IE.au3> #include <String.au3> #include <Array.au3> ProcessClose ( 'iexplore.exe') $File1 = @ScriptDir & "\kat01.txt" $txt = FileRead($File1) ;-------------------------------Translation Started------------------------- Local $tag="* # * # *" Local $oIE=_IECreate("https://translate.google.com/#ru/en", 1, 1) Local $oForm=_IEFormGetCollection($oIE,0) Local $oQuery=_IEGetObjByName($oForm,"text") _IEFormElementSetValue($oQuery, $tag & @CR & $txt & @CR & $tag) _IEFormSubmit($oForm) _IELoadWait($oIE) Local $oText=_IEGetObjById($oIE,"gt-res-data") $lines=StringSplit(_IEPropertyGet($oText,"innerText"),@CRLF,1) ;_IEQuit($oIE) _ArrayDelete($lines,_ArraySearch($lines,$tag,1,0,0,1,0) & "-" & $lines[0]) _ArrayDelete($lines,"1-" & _ArraySearch($lines,$tag,1,0,0,1,1)) $lines[0]=UBound($lines)-1 _ArrayDisplay($lines) Local $sFilePath = @ScriptDir & "\Translated.txt" _FileWriteFromArray($sFilePath, $lines, 1)  
    • LeloDragneel
      By LeloDragneel
      Hey guys,
      I'm looking to implement an accurate voice recognition method in my program. I tried to understand the Microsoft SAPI API, read their online documentation and found it very confusing and unclear. (Like seriously, it's so bad and vague, but that's just my opinion). I have also tried using UTTER UDF, but could not get a grasp either, because you know, that's an extension UDF to Microsoft SAPI.
      Let's face it, the Google Speech Recognition is much more accurate than Microsoft SAPI (by far). Right now, I am determined to just use the Google Speech API. I have dug deep in regards to implementing the Google Speech API in AutoIT and I haven't found even one post about it. I suppose it's because the Google Speech API was only recently made available to the public. In case you don't know what I'm talking about, here's the link to google api. On that page, notice that there is language support for various languages such as Java, C#, and PHP. However, there's no support for AutoIT. So my question is; how can I go about implementing the Google Speech API into my AutoIT program? Is it even possible?
      Cheers guys!
    • jonson1986
      By jonson1986
      Hello I'm trying to translate few text using below code, I found it working previously couple of months ago but Now these days it's not working at all and I'm getting below errors when I run the script and Array display at the end of text also not able to show any translated text instead of value 0 & 1;
      --> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (gt-res-data)
      --> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
      Here is code,
      #include <IE.au3> #include <Array.au3> Local $tag="* # * # *" Local $oIE=_IECreate("https://translate.google.com/#auto/es") Local $oForm=_IEFormGetCollection($oIE,0) Local $oQuery=_IEGetObjByName($oForm,"text") _IEFormElementSetValue($oQuery, $tag & @CR & "Hello World" & @CR & "This is a test" & @CR & $tag) _IEFormSubmit($oForm) _IELoadWait($oIE) Local $oText=_IEGetObjById($oIE,"gt-res-data") $lines=StringSplit(_IEPropertyGet($oText,"innerText"),@CRLF,1) _IEQuit($oIE) _ArrayDelete($lines,_ArraySearch($lines,$tag,1,0,0,1,0) & "-" & $lines[0]) _ArrayDelete($lines,"1-" & _ArraySearch($lines,$tag,1,0,0,1,1)) $lines[0]=UBound($lines)-1 _ArrayDisplay($lines)