How to use the shodan.wps.Skyhook function in shodan

To help you get started, we’ve selected a few shodan examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github golismero / golismero / plugins / testing / recon / geoip.py View on Github external
    @staticmethod
    def query_skyhook(bssid):
        Logger.log_more_verbose(
            "Querying Skyhook for: %s" % bssid)
        try:
            r = Skyhook().locate(bssid)
            if r:
                xml = ET.fromstring(r)
                ns = "{http://skyhookwireless.com/wps/2005}"
                err = xml.find(".//%serror" % ns)
                if err is not None:
                    Logger.log_error_verbose(
                        "Response from Skyhook: %s" % err.text)
                    return
                return {
                    "latitude": float(xml.find(".//%slatitude" % ns).text),
                    "longitude": float(xml.find(".//%slongitude" % ns).text),
                    "hpe": float(xml.find(".//%shpe" % ns).text),
                    "state": xml.find(".//%sstate" % ns).text,
                    "state_code": xml.find(".//%sstate" % ns).get("code"),
                    "country": xml.find(".//%scountry" % ns).text,
                    "country_code": xml.find(".//%scountry" % ns).get("code"),
github cr0hn / golismero-legacy / plugins / testing / recon / geoip.py View on Github external
    @staticmethod
    def query_skyhook(bssid):
        Logger.log_more_verbose(
            "Querying Skyhook for: %s" % bssid)
        try:
            r = Skyhook().locate(bssid)
            if r:
                xml = ET.fromstring(r)
                ns = "{http://skyhookwireless.com/wps/2005}"
                err = xml.find(".//%serror" % ns)
                if err is not None:
                    Logger.log_error_verbose(
                        "Response from Skyhook: %s" % err.text)
                    return
                return {
                    "latitude": float(xml.find(".//%slatitude" % ns).text),
                    "longitude": float(xml.find(".//%slongitude" % ns).text),
                    "hpe": float(xml.find(".//%shpe" % ns).text),
                    "state": xml.find(".//%sstate" % ns).text,
                    "state_code": xml.find(".//%sstate" % ns).get("code"),
                    "country": xml.find(".//%scountry" % ns).text,
                    "country_code": xml.find(".//%scountry" % ns).get("code"),