Skip to content

Instantly share code, notes, and snippets.

View av1d's full-sized avatar
🎯
Focusing

av1d

🎯
Focusing
View GitHub Profile
@av1d
av1d / bluetooth_repair.md
Last active February 27, 2024 18:16
Troubleshooting / repairing Bluetooth on Linux, bluetoothctl connection issues

Make sure you check dmesg periodically between these steps for errors...

First try this:

sudo apt-get update
sudo apt-get install --reinstall linux-modules-$(uname -r)
sudo apt-get install --reinstall linux-headers-$(uname -r)
sudo dkms autoinstall
hciconfig -a

if still nothing

@av1d
av1d / extract_links.py
Created February 24, 2024 06:22
extract relative & absolute paths from CSS and JS files
@av1d
av1d / find_gaps.py
Created February 20, 2024 19:03
file & page gap finder for sequentially-named files and archives
import os
import re
"""
Finds page gaps in pages / archives / research papers / publications / books / numerical archives / files / ranges.
Use it to find if you are missing any items in an archive.
You can use this on multi-volume archives or files of any type, it simply just searches for strings in the filename.
Example output:
@av1d
av1d / ble_probe.py
Last active February 19, 2024 18:53
Connect to Bluetooth LE (BLE) device, read all its data for each UUID/Characteristic/Handle/Descriptor/Property/Value
from bluepy.btle import Peripheral, UUID, BTLEInternalError # bluepy==1.3.0
device_address = "00:00:00:00:00:00"
try:
# check if address is 'random' or 'public' type
octets = device_address.split(':')
first_octet_binary = bin(int(octets[0], 16))[2:]
if first_octet_binary[-1] == '1':
addr_type = 'random'
@av1d
av1d / ble_services.py
Created February 18, 2024 23:43
List all Bluetooth LE (BLE) services and properties of a device
from bluepy.btle import Peripheral, UUID
device_address = "00:00:00:00:00:00"
peripheral = Peripheral(device_address, addrType='random')
services = peripheral.getServices()
for service in services:
characteristics = service.getCharacteristics()
@av1d
av1d / bluetooth_service_scan.py
Last active December 17, 2024 10:27
List Service UUID, Characteristic UUID and Properties of Bluetooth BLE device using bluepy
import sys
from bluepy.btle import Scanner, DefaultDelegate, Peripheral
# the address of your device. Find it using nRF Connect or in your Bluetooth settings
device_address = "00:00:00:00:00:00"
# example output:
"""
Device found with address: 00:00:00:00:00:00
@av1d
av1d / spylinks.html
Last active February 5, 2024 08:13
Extract Aliexpres (s.click.aliexpress.com) links from Google (googleadservices) spy tracking referral links
@av1d
av1d / find_unique_files.py
Created January 12, 2024 17:30
Scan directories recursively, create checksum of each file. Compare checksums, copy differing files to another folder while maintaining directory heirarchy.
import os
import hashlib
import shutil
def get_file_md5(filename):
"""Calculate the MD5 hash for a file."""
md5_hash = hashlib.md5()
with open(filename, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
md5_hash.update(chunk)
@av1d
av1d / keysnatcher.py
Created December 31, 2023 20:52
Key Snatcher v0.1 - a Linux keylogger which records all keystrokes and macros
import csv
import keyboard
import os
import signal
import sys
from datetime import datetime
"""
Key Snatcher v0.1 - a Linux keylogger - by av1d
@av1d
av1d / refresh.sh
Created December 26, 2023 15:24
use acme.sh to 'automatically' grab an SSL certificate and deploy it for a list of domains
#!/bin/bash
# use acme.sh to 'automatically' grab an SSL certificate and deploy it for a list of domains
# https://github.com/acmesh-official/acme.sh
# domains.txt contains the domain and its path, space-separated, one per line:
# example.com /home/luser/example.com
# example.org /home/luser/public_html
file="domains.txt"