text
stringlengths 1
93.6k
|
|---|
print(q.dns_spf(argv[0]))
|
except TempError as x:
|
print("Temporary DNS error: ", x)
|
except PermError as x:
|
print("PermError: ", x)
|
elif len(argv) == 3:
|
i, s, h = argv
|
q = query(i=i, s=s, h=h,receiver=socket.gethostname(),verbose=verbose,
|
strict=strict)
|
r = q.check()
|
print('result:',r,q.mechanism)
|
if r[0] == 'none':
|
print('guessed:',q.best_guess(),q.mechanism)
|
if q.perm_error and q.perm_error.ext:
|
print('lax:',q.perm_error.ext)
|
if q.iplist:
|
for ip in ipaddress.collapse_addresses(q.iplist):
|
print(ip)
|
elif len(argv) == 4:
|
i, s, h = argv[1:]
|
q = query(i=i, s=s, h=h, receiver=socket.gethostname(),
|
strict=False, verbose=verbose)
|
r = q.check(argv[0])
|
print('result:',r,q.mechanism)
|
if r[0] == 'none':
|
print('guessed:',q.best_guess(),q.mechanism)
|
if q.perm_error and q.perm_error.ext:
|
print('lax:',q.perm_error.ext)
|
if q.iplist:
|
for ip in ipaddress.collapse_addresses(q.iplist):
|
print(ip)
|
else:
|
print(USAGE)
|
# <FILESEP>
|
# Generate random device information for use with the Amazon api. Since acquiring highest
|
# quality books requires sending device information, sending random information is a good way
|
# to avoid fingerprinting
|
import hashlib
|
import random
|
import secrets
|
import string
|
MANUFACTURERS = [
|
"Asus", "Google", "HTC", "Huawei", "Motorola", "Nokia", "NVIDIA", "OPPO", "OnePlus", "Samsung", "Sony", "Xiaomi"
|
]
|
ANDROID_API_LEVELS = {
|
9: 28,
|
10: 29,
|
11: 30,
|
12: 31,
|
13: 33,
|
14: 34,
|
}
|
def get_random_string(length, uppercase=False):
|
letters = string.ascii_uppercase if uppercase else string.ascii_lowercase
|
letters += string.digits
|
return ''.join(random.choice(letters) for i in range(length))
|
def get_random_amazon_device():
|
device_id = secrets.token_hex(16)
|
manufacturer = random.choice(MANUFACTURERS)
|
name = get_random_string(random.randint(4, 10), uppercase=True)
|
codename = get_random_string(random.randint(4, 6), uppercase=False)
|
os_version = random.randint(9, 14) # Android OS version
|
build_id = str(random.randint(100000, 99999999)) # 6-8 digits
|
return {
|
"device_id": device_id,
|
"pid": hashlib.sha256(device_id.encode()).hexdigest()[23:31].upper(),
|
"manufacturer": manufacturer,
|
"name": name,
|
"codename": codename,
|
"name_full": f"{codename}/{manufacturer}/{name}",
|
"os_version": os_version,
|
"os_api": ANDROID_API_LEVELS[os_version],
|
"build_id": build_id,
|
"build_fingerprint": f"{manufacturer}/{codename}/{codename}:{os_version}/{build_id}/{str(random.randint(100000, 99999999))}:user/release-keys",
|
"width": 2160,
|
"height": 3840,
|
"app_name": "com.amazon.kindle",
|
"app_version": "1285671411",
|
"device_type": "A1MPSLFC7L5AFK",
|
"device_type2": "A2Y8LFC259B97P",
|
"pfm": "A1F83G8C2ARO7P",
|
"sw_version": "130050002"
|
}
|
def get_capabilities(device):
|
return {
|
"capabilities": {
|
"attributes": {
|
"android.hardware.ram.normal": "true",
|
"model": device["name"],
|
"brand": device["manufacturer"],
|
"build.id": device["build_id"],
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.