Skip to content

Instantly share code, notes, and snippets.

@ca4ti
ca4ti / 1st_wr703n-image-create.sh
Created October 14, 2023 14:32 — forked from probonopd/1st_wr703n-image-create.sh
Working way to create a simple Ethernet/WLAN web radio player using a cheap tiny WR703N router and a cheap USB C-Media soundcard. Switch radio stations with the reset switch. -- THE ACTUAL CODE ON THIS PAGE IS ***OUTDATED***, use https://github.com/probonopd/minikrebs instead!
# http://www.aliexpress.com/item/New-Mini-Portable-Wireless-3G-Router-TP-LINK-TL-WR703N-150M-150Mbps-WR703N-Pocket-size-Wifi/948558329.html
# Someone should convince TP-Link to build this with more Flash, serial headers, bare board, *duino style...
# This is the starting point for a webradio appliance in the works
# TODO: Preconfigure everything, hook up Arduino for IR control sending and receiving
wget http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/OpenWrt-ImageBuilder-ar71xx_generic-for-linux-i486.tar.bz2
tar xfj OpenWrt-ImageBuilder*
cd "$HOME/Downloads/OpenWrt-ImageBuilder-ar71xx_generic-for-linux-i486"
@ca4ti
ca4ti / openwrt-qemu.md
Created October 12, 2023 10:46 — forked from extremecoders-re/openwrt-qemu.md
Running OpenWRT ARM under QEMU

Environment

The steps shown below are done on a Ubuntu VM using Qemu 3.0

$ qemu-system-arm -version
QEMU emulator version 3.0.0
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers

To quit Qemu at any time press Ctrl+a x, i.e. Ctrl+a and then x

Requirements:
Winbond W25Q128FV (or other compatible chip, see pepe2k's uboot readme)
SPI Programmer (ie a Revelprog IS)
Serial Console (ie a CP2102)
HEX editor (ie Bless)
32bit vm to compile pepe2k's uboot
tftp server
Note: I already had pepe2k's uboot + LEDE r930 flashed on the original 4MiB flash chip. I assume I made a mistake with the data partition due to already having pepe2k's uboot installed. More is explained later on.
@ca4ti
ca4ti / unbrick-debrick-tp-link-3020-in-osx.md
Created September 29, 2023 14:55 — forked from ziguane/unbrick-debrick-tp-link-3020-in-osx.md
Unbrick|Debrick TP-LINK 3020 in OS X (includes fun things like breaking warranty)
@ca4ti
ca4ti / freeradius-setup.md
Created September 29, 2023 09:32 — forked from nasirhafeez/freeradius-setup.md
FreeRADIUS Setup

FreeRADIUS Setup

Install FreeRADIUS:

apt-get install freeradius freeradius-mysql freeradius-utils

Allow all NAS clients to connect to it:

@ca4ti
ca4ti / coova-chilli-commands.md
Created September 29, 2023 09:32 — forked from nasirhafeez/coova-chilli-commands.md
Coova Chilli Commands

Coova Chilli Commands

Installation

Recommended OpenWRT firmware version: OpenWRT 19. Newer versions do not have iptables installed by default so Coova Chilli will not work out of the box

opkg update
opkg install coova-chilli nano
@ca4ti
ca4ti / iptables-multicast.sh
Created September 3, 2023 14:14 — forked from juliojsb/iptables-multicast.sh
Allow multicast communications in iptables
Run the following:
iptables -A INPUT -m pkttype --pkt-type multicast -j ACCEPT
iptables -A FORWARD -m pkttype --pkt-type multicast -j ACCEPT
iptables -A OUTPUT -m pkttype --pkt-type multicast -j ACCEPT
Or:
iptables -A INPUT -s 224.0.0.0/4 -j ACCEPT
iptables -A FORWARD -s 224.0.0.0/4 -d 224.0.0.0/4 -j ACCEPT
@ca4ti
ca4ti / upnp-tomfoolery.md
Created September 3, 2023 14:09 — forked from brannondorsey/upnp-tomfoolery.md
UPnP Tomfoolery

UPnP Tomfoolery

Turns out, UPnP is terrible when it comes to security. The entire protocol exists to have devices easily find and connect to one another without any authentication at all. This is all good fun to poke around with. Here are a few tools and notes I've found along the way.

UPnP devices can be found by listening to UDP packets on port 1900. To actively discover these services on your network, send an HTTP M-SEARCH request to the default UDP mulicast address: 239.255.255.250.

There are some great Linux tools that make interfacing with all of these stuff a synch:

sudo apt update
@ca4ti
ca4ti / upnpPortMapper.sh
Created September 3, 2023 13:22 — forked from mvadu/upnpPortMapper.sh
THis script uses upnp client (upnpc) to talk to router and open ports
#!/bin/bash
#~/bin/upnpPortMapper.sh
#sudo apt-get install miniupnpc
#crontab -l | grep upnp || echo $(crontab -l ; echo '*/5 * * * * ~/bin/upnpPortMapper.sh >/dev/null 2>&1') | crontab -
export LC_ALL=C
router=$(ip r | grep default | cut -d " " -f 3)
gateway=$(upnpc -l | grep "desc: http://$router:[0-9]*/rootDesc.xml" | cut -d " " -f 3)
ip=$(upnpc -l | grep "Local LAN ip address" | cut -d: -f2)
@ca4ti
ca4ti / envoy_http_dynamic_forward_proxy.yaml
Created August 1, 2023 12:34 — forked from reetasingh/envoy_http_dynamic_forward_proxy.yaml
Envoy to operate as an HTTP dynamic forward proxy
admin:
access_log_path: /tmp/admin_access.log
address:
socket_address:
address: 127.0.0.1
protocol: TCP
port_value: 9901
static_resources:
listeners:
- name: listener_0