Archiv der Kategorie: Misc

Read Windows licence serial from UEFI Bios

For hardware with preinstalled (OEM) Windows 8.x and Windows 10, buyers don’t get a valid key printed on the device’s back or under the battery (for notebooks). The windows installer doesn’t even ask for a key anymore or the answer is skippable. If you still want to know your key to validate your fresh installation (on another pc) you can read it using the acpidump command under linux. For ubuntu install the package with:

sudo aptitude install acpidump

and read your serial with:

sudo acpidump -n MSDM

Reverse ssh tunnel

My ISP started to roll out broken IPv6 for home users, so my services aren’t available from outside anymore. I don’t need a full vpn solution, but sometimes I just want to ssh home to check a file etc. The simplest solution was to create a reverse ssh tunnel. The raspberry pi inside my home network connects to my public server via ssh. Logged in on the server I can connect to a local port and get forwarded to the raspberry. That works for me really well.

Since wifi is a little bit flaky, I need to make sure, that the ssh connection is reopened when there is a connection loss. You can write a very simple script like this and use a cronjob to execute it.

#!/bin/bash

COUNT=$(ps ax | grep 'ssh -Nf -R' | wc -l)

if [ $COUNT -eq 1 ]
then
    echo "No tunnel yet. Creating..."
    ssh -Nf -R LOCALPORT:localhost:PORT user@remote
else
    echo "Tunnel already exists. Aborting."
fi

But I just found out about autossh. Which does the monitoring for you. I tried to get it working with systemd, but without any success. Ideas are welcome.

$ cat /etc/systemd/system/autossh-tunnel.service
[Unit]
Description=reverse ssh tunnel
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=localuser
ExecStart=/usr/bin/autossh -f -M 0 remote -l remoteuser -N -o "ServerliveInterval 60" -o "ServerAliveCountMax 3" -R LOCALPORT:localhost:PORT
ExecStop=/usr/bin/pkill autossh
Restart=always

$ sudo systemctl enable autossh-tunnel.service
$ systemctl start autossh-tunnel.service

Looking at journalctl, I can see the exit but no reason. Executing the command manually works fine.

systemd[1]: Starting reverse ssh tunnel...
systemd[1]: Started reverse ssh tunnel.
autossh[2468]: port set to 0, monitoring disabled
autossh[2474]: starting ssh (count 1)
ssh child pid is 2476
received signal to exit (15)

In the end I modified the bash script to use autossh.

#!/bin/bash

COUNT=$(ps ax | grep 'autossh' | wc -l)

if [ $COUNT -eq 1 ]
then
  echo "No tunnel yet. Creating..."
  /usr/bin/autossh -f -M 0 remote -l remoteuser -N -o "ServerliveInterval 60" -o "ServerAliveCountMax 3" -R LOCALPORT:localhost:PORT
else
  echo "Tunnel already exists. Aborting."
fi

If you have a better solution, let me know.

freedns an der Fritz!Box

Die Fritz!Box bietet Unterstützung für dynDNS. Eine ganze Reihe an Anbietern ist bereits hinterlegt. Mit der Auswahl „benutzerdefiniert“ lassen sich aber auch andere Anbieter einrichten. Benutzt man freedns als Provider benötigt man als URL den „direct URL“ für die subdomain. In der FAQ und an anderen Stellen wird erwähnt, dass sich diese rechts neben dem hostnamen befinden. Nach langer Suche habe ich festgestellt, dass das Layout geändert wurde und der Link nicht mehr angezeigt wird.

Auf der alten Übersichtsseite findet man den Link aber noch.

Blog migration

I’m moving the whole blog (hosting and domain) to new providers. The hoster has already been changed, dns transfer should follow in a few days.

I also changed the domain of the blog from http://www.carrier-lost.org/blog to just http://www.carrier-lost.org.

Please let me know, if you encounter any error.

Must-have Firefox Add-ons

Ich wurde vor einiger Zeit gefragt welche Firefox Add-Ons ich verwende und diese Frage möchte ich heute beantworten. Da sich einige Add-Ons nicht exakt einer Kategorie zuordnen lassen, habe ich die Kategorien nur grob eingeteilt.

Allgemein
Adblock Plus – Blockt lästige Werbung und Pop-Ups
NoScript – Selektives Erlauben/Verbieten von Javascript, Java etc. für einzelne Seiten
Omnibar – Integriert die Suchfunktion in die Adresszeile
OptimizeGoogle – Verbessert die Google Suchergebnisse und entfernt Werbung und Spam
Session Manager – Speichert geöffnete Tabs/Fenster und stellt Sie nach einem Absturz wieder her
Tab Preview – Seitenvorschau wenn der Mauszeiger über das Tab fährt
ColorfulTabs – Färbt Tabs in verschiedene Farben und verschafft so Überblick
FaviconizeTab – Verkleinert Tabs auf die Größe der Favicons
Xmarks – Synchronisiert Lesezeichen/Passwörter zwischen mehreren Firefox Installationen
Firefox Sync – Siehe Xmarks
Fast Dial – Miniaturansicht von Lesezeichen als Startseite
FEBE – Sicherung der Firefox Einstellungen, Add-Ons etc.
FlashGot – Downloadmanager
VTzilla – Untersucht download per Rechtsklick auf Viren mit VirusTotal

Entwicklung
Web Developer – Menüleiste mit verschiedenen Tools zur Webentwicklung
ColorZilla – Pipette, ColorPicker etc.
Firebug – Webentwicklungs „suite“
CodeBurner for Firebug – Erweitert Firebug um HTML und CSS Referenzen

Sicherheit / Penetration Testing
Access Me – Testet Lücken im Session Handling
Add N Edit Cookies – Kann Sessions und Cookies hinzufügen/bearbeiten
Fireforce – GET/POST Formular BruteForcer
FoxyProxy Standard – Proxy Manager
FxIF – Zeigt die EXIF Daten in den Bildeigenschaften an
HackBar – Toolbar zur Unterstützung bei der Suche nach SQL Injections
HTTPS-Everywhere – Verwendet automatisch SSL auf vielen Seiten
Live HTTP headers – Zeigt die HTTP Header einer Seite
PassiveRecon – Information Gathering Tool
ShowIP – Zeigt die IP Adresse der aktuellen Seite in der Statusleiste
SQL Inject Me – Testet verschiedene SQL Injection Schwachstellen
Tamper Data – Kann HTTP(S) Header bearbeiten und verfolgen
Wappalyzer – Erkennt die verwendete Software auf einer Webseite
XSS Me – Testet eine Seite auf XSS Schwachstellen

humans.txt

Vor ein paar Tagen bin ich auf die Seite humanstxt.org gestoßen und mir gefällt die Idee.

It’s an initiative for knowing the people behind a website.
It’s a TXT file that contains information about the different people who have contributed to building the website.

„About“ Seite meets robots.txt… oder so ähnlich. Ich finds gut: humans.txt.

UPDATE: Hier gibt es auch ein Plugin für WordPress.