Sunday, 1. November 2020 Week 44
15 years ago this weblog received the current o5 design (or theme as it would be called nowadays).
During this time the design has aged quite well and also survived the move of the backend from a self-written PHP blog-engine to Jekyll.
Although it still works surprisingly well and presents the content nicely every day, there are some parts where better usage of contemporary technologies would be desirable.
It has no mobile version nor a responsive layout as the design was created before the now omnipresent smartphones were invented. Similar is the font-size hardcoded and not very adequate for todays retina displays. And yes, it uses the XHTML 1.0 strict standard with all its quirks and CSS tricks from 2002 (which luckily are still supported in current browsers).
Overall I'm quite happy that the o5 design has turned out to be so timeless and that I did not have to come up with a new one every other year (btw: I don't remember where the o5 name came from, likely the 5 is a reference to 2005 when it was created).
With the current Corona situation forcing me to spend more time at home again, I have the feeling that some things might change around the weblog (not quite sure what or when exactly, first I need to re-learn how websites are built in 2020 :-).
Saturday, 31. October 2020 Week 44
Compared to the previous post where intentional NAT traversal was discussed, here now comes an article about 'unintentional' (malicious) NAT traversal.
Samy Kamar describes in his NAT Slipstreaming article how a combination of TCP packet segmentation and smuggling SIP requests in HTTP, can be used to trick the NAT ALG of your router into opening arbitrary ports for inbound connections from the Internet to your computer.
The article analyses in detail the SIP ALG of the Linux netfilter stack in it's default configuration, but likely similar attacks could also be possible with ALGs of other protocols and vendors.
Important to note: the Linux SIP ALG module has two parameters (sip_direct_media and sip_direct_signalling), which restrict the IP address for which additional ports are opened to the one sending the original SIP packet. By default they are set to 1, but if any of these is set to 0 in a router's configuration, the described NAT Slipstreaming attack will not only allow to make inbound connections to your computer, but also to any other device in the local network!
Sunday, 23. August 2020 Week 34
How NAT traversal works – is a very well written and detailed article from Dave Anderson explaining the different NAT scenarios and the tricks that can be used to establish a peer-to-peer UDP connection between machines sitting behind them.
Sunday, 7. June 2020 Week 23
Recently the disk holding the root (/) filesystem on one of my linux systems started to report increased SMART raw read error rates, seek error rates and ECC recovered hardware errors.
As these are early indications of a failing disk, it became time to replace the disk.
Normally replacing a disk comes down to plugging in the new one, coyping over the data, umount the old disk, mount the new one in place, unplug the old disk.
But when it is the disk with the root filesystem a couple extra steps are needed.
The steps below worked for my Debian system without problems (even used the opportunity to upgrade to an SSD :-)
(source is this thread on StackExchange)
The following makes some assumptions:
- All commands ran as root when possible
- You are on a physical console to the host (need to type in grub commands to boot up the new disk!)
- You want an ext4 files system
- You are loosely familiar on a basic level with all commands run
- You are NOT booting from a RAID device
So here we go.
- Physically install new disk into computer and connect to available port leaving old disk in existing position.
- Boot computer into old OS.
- Prepare and mount new disk; first identify new disk
fdisk -l
- Partition new disk
fdisk /dev/(newdisk)
Make partition primary partition with type "83" file system type.
- Create filesystem
mkfs.ext4 /dev/(newpartition)
- Mount new filesystem
mkdir /mnt/(newpartitionmountpoint)
mount /dev/(newpartition) /mnt/(newpartitionmountpoint)
- Copy disk:
/sbin/init 1 (drop to single user mode)
rsync -avxHAX / /mnt/(newpartitionmountpoint)
- Update FSTAB on newdisk
blkid (note UUID of new partition)
vi /mnt/(newpartitionmountpoint)/etc/fstab
Replace existing UUID of / in FSTAB to new disk UUID
- Configure grub and install to new disk boot loader:
grub-mkconfig
update-grub
grub-install /dev/(newdisk)
- Copy grub.cfg from old disk to new
cp -ax /boot/grub/grub.cfg /mnt/(newpartitionmountpoint)/boot/grub/grub.cfg
- Open grub.cfg on new disk and replace all UUIDs with new disk
vi /mnt/(newpartitionmountpoint)/boot/grub/grub.cfg
Replace all old UUIDs with the UUID of the new disk
- Shut down computer
shutdown
- Physically move the new drive to the 1st drive location and remove old drive
- Start computer and grub should present:
error: no such device: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
GRUB rescue>
- Manually boot new OS from grub; first identify the drive and partition of the boot files
ls [to identify your drive and partition options]
ls (hdx,p)/ [to identify which partition has the /boot folder]
- Then, you can load the boot menu manually from the drive and partition you found above. Typically this would be (hd0,msdos1).
set prefix="(hdx,p)/boot/grub"
set root="(hdx,p)"
insmod normal
normal
- Login to OS on new drive
- Configure grub again
fdisk -l (note dev of newdisk)
grub-mkconfig
update-grub
grub-install /dev/newdisk
And that should be it!
Sunday, 24. May 2020 Week 21
On my Linux hosts I'm running rkhunter. On a newly configured host it lately reported the following warning:
Warning: The SSH and rkhunter configuration options should be the same:
SSH configuration option 'PermitRootLogin': no
Rkhunter configuration option 'ALLOW_SSH_ROOT_USER': no
On first sight the warning does not seem to make much sense, as both configuration options seem to be set to the same value (no
).
But digging further reveals that they are stored slightly different:
# file /etc/rkhunter.conf
/etc/rkhunter.conf: ASCII text
# file /etc/ssh/sshd_config
/etc/ssh/sshd_config: ASCII text, with CRLF line terminators
Turns out that rkhunter is also checking the line terminators as part of the configuration values, and warns because they are different.
Knowing this, the fix is simple: run dos2unix on the CRLF file
Thursday, 21. May 2020 Week 21
While doing some maintenance on my server, I got tired of searching through the output of ip addr show
to find the IP addresses configured on the interfaces.
Thus I wrote a simple CLI tool to display the information I needed in a concise and human friendly form: ipaddr
$ ipaddr
lo 127.0.0.1/8
ens5 198.51.100.160/24
tun24008 10.123.199.78/32
tun71991639 10.200.123.5/32
tun26724 10.100.100.235/32
tun3883710 10.123.111.7/32
A nice side-effect of writing this in Go is that it works out-of-the-box also on non-Linux systems :-)
Saturday, 18. April 2020 Week 16
Sometimes you need to be notified about reboots of a machine without having the luxury of a proper monitoring system.
The following crontab entry triggers an e-mail when the host has been rebooted in the last 5 minutes.
*/5 * * * * [ $(sed -e 's/\..*//' /proc/uptime) -lt 540 ] && echo "Host has been rebooted! Uptime: $(uptime)"
Sunday, 12. April 2020 Week 15
Inspired by this recipe, I made some yummy Crostini using Cottage cheese (instead of Ricotta cheese) and Avocado with some drops of Aceto balsamico.

Saturday, 28. March 2020 Week 13
die ärzte - Ein Lied für Jetzt
Saturday, 21. March 2020 Week 12
Somehow I always end up working with lists of IP networks and needing to minimize and compare them.
Some of my Perl scripts for this might still be hidden in a corporate source repository, and somewhere in the backups of my old Linux laptop should be even earlier attempts in Bash.
Both of them are not very useful to me where they are, thus I've written yet another version.
This time in Go using the ipaddr package.
Say hello to ip_compact and ip_diff :-)