Created
November 10, 2017 11:29
-
-
Save gwillem/d57c61e735b09999792830f73b97b9b0 to your computer and use it in GitHub Desktop.
censys coinhive query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import censys.websites, censys.ipv4 | |
UID = os.getenv('CENSYS_UID') | |
KEY = os.getenv('CENSYS_KEY') | |
NEEDLE='coinhive.min.js' | |
def websites(): | |
api = censys.websites.CensysWebsites(api_id=UID, api_secret=KEY) | |
return api.search(NEEDLE) | |
def ipv4(): | |
api = censys.ipv4.CensysIPv4(api_id=UID, api_secret=KEY) | |
return api.search(NEEDLE) | |
if __name__ == '__main__': | |
print("Nr of websites found: {}".format(len(list(websites())))) | |
print("Nr of IPv4 hits found: {}".format(len(list(ipv4())))) |
Hello, I'm pretty new to Python and completely new to censys. I am to the point where I run this script with no errors but I want to review the actual list of results instead of just the number found. Is there an easy way for me to do that? For example, can I output the websites or IPV4 results to a txt or csv file?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Results:
And this is total sites (which includes lots of porn/torrent/stream/grey stuff), while I did study stores, which are in the legitimate domain.