Safe browsing api python

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

An example usage of google safe browsing

Читайте также:  Вывод даты php date

License

quellobiondo/Example-GoogleSafeBrowsingV4

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Google safe browsing usage example

This is an example usage of Google Safe Browsing API, using python 2.7.

Here there is the possibility to test its functions online

The code has been developed using the Google API Python Client

Google identifies this 5 as type of threat

  • THREAT_TYPE_UNSPECIFIED
  • MALWARE
  • SOCIAL_ENGINEERING
  • UNWANTED_SOFTWARE
  • POTENTIALLY_HARMFUL_APPLICATION

For accounting purposes the requests are authenticated with an API key.

Get an API Key as indicated here for Google Safe Browsing v4

  1. Create a project
  2. Activate Google Safe Browsing Api here
  3. Create credential
  4. Get API Key

NB: For the Lookup API the amount of daily requests is capped to 10 000.

SAFE_BROWSING_API_KEY="XXXX" python check_safety.py url1 [url2 . ] 
docker build -t safebrowsingsample . docker run -e SAFE_BROWSING_API_KEY="XXXX" safebrowsingsample url1 [url2 . ] 
$ docker run -e SAFE_BROWSING_API_KEY=$API_KEY safebrowsingsample "d99q.cn" "google.com" < "matches": [ < "cacheDuration": "300s", "platformType": "ANY_PLATFORM", "threat": < "url": "d99q.cn" >, "threatEntryType": "URL", "threatType": "MALWARE" > ] >

About

An example usage of google safe browsing

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Python Module: Google Safe Browsing Lookup v4

junv/safebrowsing

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

safebrowsing.py — Google Safe Browsing Lookup API (v4)

The safebrowsing python module is a rudimentary interface to the Google Safe Browsing lookup API version 4 (v4), for a complete implementation you may opt to use the Google API Client Libraries.

Please feel free to contribute in improving this code.

import safebrowsing apikey = 'YOUR_KEY' sb = safebrowsing.LookupAPI(apikey) resp = sb.threat_matches_find('ihaveaproblem.info') print resp 

Copyright (c) 2016 Jun C. Valdez — Code is distributed under the terms of an MIT sytle license http://www.opensource.org/licenses/mit-license

About

Python Module: Google Safe Browsing Lookup v4

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Python client library for Google Safe Browsing API

License

afilipovich/gglsbl

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Python client library for Google Safe Browsing Update API v4.

The code was developed according to official Developers Guide, however this is not a reference implementation.

Instructions to procure API key can be found here. Please note that v3/v4 key is different from v2.2 API. API v3 key may work with current API v4.

To sync local hash prefix cache

from gglsbl import SafeBrowsingList sbl = SafeBrowsingList('API KEY GOES HERE') sbl.update_hash_prefix_cache()
from gglsbl import SafeBrowsingList sbl = SafeBrowsingList('API KEY GOES HERE') threat_list = sbl.lookup_url('http://github.com/') if threat_list == None: print("no threat') else: print('threats: ' + str(threat_list))

bin/gglsbl_client.py can be used for a quick check or as a code example.

To immediately sync local cache with Safe Browsing API.

 gglsbl_client.py --api-key 'API KEY GOES HERE' --onetime 

Please mind Request Frequency policy if you are going to use this command for more than a one-time test.

 gglsbl_client.py --api-key 'API KEY GOES HERE' --check-url http://github.com/ 

Fore more options please see

Running in Distributed Environment

For cases when multiple apps and/or servers would benifit from sharing same GSB cache please see gglsbl-rest project maintained by Alexandre Sieira.

Current version of library is fully compatible with both python2.7 and python3.

If you prefer to use older v3 version of Safe Browsing API there is a python3 port of the legacy version made by Stefan.

About

Python client library for Google Safe Browsing API

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Python 3 Google Safe Browsing library

License

Te-k/pysafebrowsing

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Limited python3 library for Google Safe Browsing API v4. For now, only the online lookup is developed. Check here to get an API key.

To install, you can just install it from pypi with pip install pysafebrowsing , or download the code with git clone https://github.com/Te-k/pysafebrowsing.git and then pip install .

from pysafebrowsing import SafeBrowsing s = SafeBrowsing(KEY) r = s.lookup_urls(['http://malware.testing.google.test/testing/malware/']) print(r) > 'http://malware.testing.google.test/testing/malware/': 'platforms': ['ANY_PLATFORM'], 'threats': ['MALWARE', 'SOCIAL_ENGINEERING'], 'malicious': True, 'cache': '300s'>>
$ safebrowsing config --key dfdsfdsfds In /home/user/.config/safebrowsing: [SafeBrowsing] key = dfdsfdsfds $ safebrowsing url http://malware.testing.google.test/testing/malware/ Malicious: Yes Platforms: ANY_PLATFORM Threats: SOCIAL_ENGINEERING, MALWARE $ safebrowsing url https://github.com/ Malicious: No $ safebrowsing file testlist.txt http://malware.testing.google.test/testing/malware/ Malicious http://twitter.com/ Ok https://github.com/ Ok http://www.google.com/ Ok http://www.yahoo.com/ Ok http://ianfette.org Malicious 

This code is published under MIT license: do whatever you want with it, but don’t blame me if it fails 😉

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Python google safe browsing — afilipovich/gglsbl ported to python 3

License

Stefan-Code/gglsbl3

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

This project uses the deprecated Google Safe Browsing v3 API. Consider using afilipovich/gglsbl which supports the v4 API and has also been updated to also support Python 3

Python 3 client library for the Google Safe Browsing API (v3)

The original code this project is based on can be found here in afilipovich’s repo. It was changed to support Python 3 (exclusively) and stuff like Unit Tests was added and a few more features introduced (like the ability to get the metadata for a match in the Google Safe Browsing List) The master branch is used for development, use a release if you want stability.

While the code was developed according to official Developers Guide this is not a reference implementation and is not affiliated with google in any way. You also may want to check the Acceptable Use Policy for Safe Browsing API. Use this software at your own risk!

This is not an implementation for the Google Safe Browsing Lookup API. The lookup API would be using HTTP requests for each lookup you perform. The implementation used here instead, downloads an offline copy of a part of the database, which allows you to exceed the rate limit of the lookup API. Because of that you have to synchronise the database on the first run though.

Instructions can be found here

Источник

Оцените статью