Created
June 11, 2025 14:46
-
-
Save kn1cht/1ee8ae9f2d7d810dafe3e2c4d39d172e to your computer and use it in GitHub Desktop.
diver-osint-2025-louvre
This file contains hidden or 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
import pandas as pd | |
import requests | |
import time | |
from getpass import getpass | |
from mac_vendor_lookup import MacLookup # pip install mac-vendor-lookup | |
def send_request(): | |
token = getpass("Enter your WiGLE API token (Authorization: Basic <token>): ") | |
headers = {"Authorization": f"Basic {token}"} | |
query_params = { | |
"ssidlike": "%Louvre_WiFi_Gratuit", | |
"lasttime": "20250228", | |
"lat_range_1": 48.86, | |
"lat_range_2": 48.8625, | |
"long_range_1": 2.3326, | |
"long_range_2": 2.34, | |
"resultsperpage": 100, | |
} | |
result_count = 0 | |
total_count = 0 | |
result_df = pd.DataFrame() | |
while result_count < total_count or result_count == 0: | |
res = requests.get("https://api.wigle.net/api/v2/network/search", params=query_params, headers=headers) | |
if res.status_code == 200: | |
data = res.json() | |
results = data["results"] | |
total_count = data["totalResults"] | |
result_count += len(results) | |
print(f"{result_count} / {total_count}") | |
df = pd.DataFrame(results) | |
df = df[df["lasttime"].str.contains("2025-02-28")] | |
result_df = pd.concat([result_df, df]) | |
query_params["searchAfter"] = data["searchAfter"] | |
time.sleep(1) | |
else: | |
print(f"Error {res.status_code}") | |
break | |
bssids = result_df[["netid", "ssid"]].drop_duplicates() | |
for _, row in bssids.iterrows(): | |
vendor_text = MacLookup().lookup(row["netid"]) | |
print(f"SSID: {row['ssid']}, BSSID: {row['netid']}, Vendor: {vendor_text}") | |
if __name__ == "__main__": | |
send_request() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment