Skip to content

Instantly share code, notes, and snippets.

View teknoraver's full-sized avatar
🖥️
coding

Matteo Croce teknoraver

🖥️
coding
View GitHub Profile

Trashing the Vodafone Station

How to replace the Vodafone Station with your very own router

Vodafone forces its customers to use their modem/router, the "Vodafone Station": using any other router is impossible because authentication is being done via a custom PPPoE setup.
In the PPPoE packet there is a field named Host-Uniq which is used to separate packets from different PPPoE sessions: Vodafone requires the Station serial number to be put in this field as authentication.

Hardware setup

A Linux router with root access is needed to replace the Station with. With an xDSL connection a modem with a custom firmware like OpenWrt has to be used, most likely one based on a Lantiq SoC.
For a FTTH internet connection then every machine with at least two gigabit ethernet interface and a decent CPU will do it.

@teknoraver
teknoraver / unixhttpc.go
Last active March 21, 2024 11:48
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@teknoraver
teknoraver / gitshare
Last active March 18, 2024 06:20
Share objects between git repositories
#!/bin/sh
if [ $# -ne 2 ]; then
echo "usage: ${0##*/} <source> <target>"
echo " alias shared objects from repository 'source' to 'target'"
exit 1
fi
for i; do
if ! [ -d "$i/.git/objects" ]; then
@teknoraver
teknoraver / forkrepo.sh
Last active December 19, 2023 18:56
Fork repo locally
#!/bin/sh
if [ $# -ne 2 ]; then
echo "usage: ${0##*/} <source> <target>"
echo " clone 'source' to 'target' sharing objects"
exit 1
fi
src=$1
trg=$2
@teknoraver
teknoraver / xdp_manglepong.c
Last active December 19, 2023 08:38
Sample XDP program to mangle ICMP echo replies
/*
* xdp_manglepong.c - sample XDP program
* Copyright (C) 2019 Matteo Croce <mcroce@redhat.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
#!/bin/sh
[ -f "$1" ] || exec echo "can't find '$1'"
for i in exiv2 identify; do
which $i >/dev/null || exec "$i is not installed"
done
jpg=/tmp/photosphere-$$.jpg
@teknoraver
teknoraver / mannaggia-ng.sh
Created October 25, 2023 16:00
Improved mannaggia.sh
#!/bin/bash
# Versione riveduta e corretta di mannaggia.sh
# problemi di mannaggia.sh:
# * scarica solo la prima pagina di ogni lettera dell'alfabeto
# * usa /dev/urandom per scegliere una lettera casuale (LOL!), quando Bash ha il supporto al random
# * inutilmente complesso, il parsing dei tag veniva fatto con CINQUE PIPE, quando basta un solo awk scritto bene
# released under GNU-GPLv3
prescegli() {
@teknoraver
teknoraver / parentdev.sh
Created July 13, 2023 13:17
Given a partitioned block device, return the device representing the whole disk
#!/bin/sh
dev=$1
dev=$(realpath "$dev")
dev=$(basename "$dev")
sys="/sys/class/block/$dev"
if [ -f "$sys/partition" ]; then
@teknoraver
teknoraver / tcp_psh.c
Created August 5, 2019 10:13
Sample XDP/tc program, sets the TCP PSH flag on some TCP packets
#include <stdint.h>
#include <arpa/inet.h>
#include <asm/byteorder.h>
#include <linux/bpf.h>
#include <linux/if_ether.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/pkt_cls.h>
/*
@teknoraver
teknoraver / extensions.conf
Last active January 17, 2023 13:30
Magnotta based voice mail
[general]
static=yes
writeprotect=yes
clearglobalvars=no
[globals]
[outgoing_context]
exten => _[+]X.,1,Dial(PJSIP/${EXTEN}@vodafone-out)
exten => _X.,1,Dial(PJSIP/${EXTEN}@vodafone-out)