workan on py
This commit is contained in:
@@ -4,6 +4,7 @@ from datetime import datetime
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
webhook_url = "https://discord.com/api/webhooks/1403525015818862602/Jh0G0pS9MXzOYRBTmqwH18Qcg0Jg7Ayvw9At3uGe4IauTK1eqRdt8whTXAjvfIDPT9K5" # replace with your actual webhook URL
|
webhook_url = "https://discord.com/api/webhooks/1403525015818862602/Jh0G0pS9MXzOYRBTmqwH18Qcg0Jg7Ayvw9At3uGe4IauTK1eqRdt8whTXAjvfIDPT9K5" # replace with your actual webhook URL
|
||||||
|
discord_tag_role = "<@&1369280290203373670>" # replace with your actual Discord role ID (.\@rolename to get it)
|
||||||
|
|
||||||
# bunch of random prefixes for testing
|
# bunch of random prefixes for testing
|
||||||
VENDOR_PREFIXES = ['00:25:DF', '00:58:28', '00:C0:D4', '84:70:03', 'C0:1C:6A', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0B', '77', '99', '0A', '0B', '0C', '0D', '0E', '0F', 'AB', 'C0']
|
VENDOR_PREFIXES = ['00:25:DF', '00:58:28', '00:C0:D4', '84:70:03', 'C0:1C:6A', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0B', '77', '99', '0A', '0B', '0C', '0D', '0E', '0F', 'AB', 'C0']
|
||||||
@@ -17,12 +18,13 @@ async def main():
|
|||||||
devices = await BleakScanner.discover()
|
devices = await BleakScanner.discover()
|
||||||
filtered_devices = [device for device in devices if any(device.address.upper().startswith(prefix) for prefix in VENDOR_PREFIXES)]
|
filtered_devices = [device for device in devices if any(device.address.upper().startswith(prefix) for prefix in VENDOR_PREFIXES)]
|
||||||
if filtered_devices:
|
if filtered_devices:
|
||||||
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3] # includes miliseconds
|
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f %z %f %F")[:-3] # includes miliseconds
|
||||||
webhook_payload = {
|
webhook_payload = {
|
||||||
"content": f"VLAT HAS BEEN SPOTTED MAC: {filtered_devices[0].address} TIME: {now}"
|
"content": f"{discord_tag_role} VLAT HAS BEEN SPOTTED MAC: {filtered_devices[0].address} TIME: {now}"
|
||||||
}
|
}
|
||||||
print(f"VLAT HAS BEEN SPOTTED MAC: {filtered_devices[0].address} TIME: {now}")
|
print(f"VLAT HAS BEEN SPOTTED MAC: {filtered_devices[0].address} TIME: {now}")
|
||||||
requests.post(webhook_url, json=webhook_payload)
|
requests.post(webhook_url, json=webhook_payload)
|
||||||
|
break
|
||||||
except BleakError as e:
|
except BleakError as e:
|
||||||
print(f"Error during scanning: {e}")
|
print(f"Error during scanning: {e}")
|
||||||
await asyncio.sleep(10) # wait before next scan
|
await asyncio.sleep(10) # wait before next scan
|
||||||
|
|||||||
Reference in New Issue
Block a user