Skip to content

Instantly share code, notes, and snippets.

View BigNerd95's full-sized avatar

Lorenzo Santina BigNerd95

View GitHub Profile
@BigNerd95
BigNerd95 / belkin_enable_telnetd.py
Created February 20, 2017 18:01
Belkin router exploits to bypass login and persistent remote command execution
#!/usr/bin/env python3
# Belkin Router Persistent Remote Command Execution (0day)
# Tested models: F7D4401, F7D4301
# Tested firmware: 1.00.46 (latest firmware)
# You bust be loggedin to run this exploit (you can use belkin_login_bypass.py exploit)
# Author BigNerd95
import sys, requests, re
@BigNerd95
BigNerd95 / base64encode.sh
Created May 25, 2017 23:18
Base64 encode implementation entirely in bash
#/bin/bash
base64encode(){
local base64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
local res=""
for i in $(seq 0 3 $((${#1}-1)))
do
local n1=$(printf '%d' "'${1:i+0:1}")
local n2=$(printf '%d' "'${1:i+1:1}")
@BigNerd95
BigNerd95 / Tecnoalarm.py
Last active May 11, 2020 21:16
Protocol dumper and cipher for Tecnoalarm Security Systems
#!/usr/bin/env python3
from Crypto.Cipher import AES
class TACipher():
def __init__(self, key, iv):
self._key = key # bytes
self._iv = iv # bytes
self._tail = bytes()
self._padding = 0
##### WiIvrea Authentication for OpenWRT ####
is_authenticated(){
local res=$(wget -q -O - http://172.172.172.1/login | grep "You are logged in" | wc -l)
if [ $res = "1" ]
then
return 0 # true
else
return 1 # false
fi
@BigNerd95
BigNerd95 / ar9003_eeprom_diff.c
Last active December 5, 2021 14:36
Atheros ART bypass reading the modified dump from /etc/config/my_eeprom (the file must contain only the struct ar9300_eeprom [1088 bytes])
// Add these lines after the Copyright
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <asm/segment.h>
#include <linux/buffer_head.h>
// Copy these functions before ar9300_eeprom_restore_flash function
struct file *file_open(const char *path, int flags, int rights)
{
struct file *filp = NULL;
@BigNerd95
BigNerd95 / regd_diff.c
Last active March 1, 2023 09:05
Atheros Country Code ART bypass passing a custom Country Name when loading the driver (e.g.: insmod ath cn=AU)
char *user_country_name = ""; // [MOD]
module_param_named(cn, user_country_name, charp, S_IRUGO); // [MOD]
MODULE_PARM_DESC(cn, "Country Name"); // [MOD]
static int __ath_regd_init(struct ath_regulatory *reg)
{
struct country_code_to_enum_rd *country = NULL;
u16 regdmn;
if (!reg)
@BigNerd95
BigNerd95 / 800-ath9k-bypass-eeprom-power.patch
Last active March 23, 2024 09:32
Atheros ART power limit bypass, linux regulatory will be applied (e.g.: iw phy phy0 set txpower fixed 3100)
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -5142,6 +5142,11 @@ static void ar9003_hw_set_power_per_rate
scaledPower = ath9k_hw_get_scaled_power(ah, powerLimit,
antenna_reduction);
+ minCtlPower = (u8) min(MAX_RATE_POWER, scaledPower);
+ for (i = 0; i < ar9300RateSize; i++)
+ pPwrArray[i] = (u8) minCtlPower;
+ return;
@BigNerd95
BigNerd95 / glddnsupdater.sh
Last active May 1, 2019 00:24
GL.iNet ddns update script [will associate your wan IP to puXXXXX.gl-inet.com where XXXXX are the latest 5 bytes of the mac address]
#!/bin/sh
# OpenWRT support libs
. /lib/functions.sh
. /lib/functions/network.sh
. /usr/share/libubox/jshn.sh
ip_regex="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"
ddns=
code=
@BigNerd95
BigNerd95 / recv_fw.sh
Last active May 11, 2020 18:20
Fast update scripts for LEDE/OpenWRT
#!/bin/sh
# run this script on ROUTER
ipaddr=$1
# recv checksum
check=$(nc $ipaddr 1235)
echo "Received checksum: $check"
@BigNerd95
BigNerd95 / tethering_enabler.txt
Created November 27, 2017 20:40
ADB shell commands to enable tethering on Android Nougat [root required]
echo "Android Nougat Tethering enabler by BigNerd95"
echo
echo "Backingup build.prop in /sdcard/build.prop.backup"
cp /system/build.prop /sdcard/build.prop.backup
cp /system/build.prop /sdcard/build.prop
echo "Editing build.prop"
echo net.tethering.noprovisioning=true >> /sdcard/build.prop