Emotet

joined 2 months ago
[–] Emotet@slrpnk.net 43 points 2 days ago (2 children)

Because this repo is going viral from time to time to developers, I'm open for discussion if you want to promote a product/service in this README file. Just mail me at XXXX

Ew.

[–] Emotet@slrpnk.net 2 points 2 days ago (2 children)

I've been tempted by Tailscale a few times before, but I don't want to depend on their proprietary clients and control server. The latter could be solved by selfhosting Headscale, but at this point I figure that going for a basic Wireguard setup is probably easier to maintain.

I'd like to have a look at your rules setup, I'm especially curious if/how you approached the event of the commercial VPN Wireguard tunnel(s) on your exit node(s) going down, which depending on the setup may send requests meant to go through the commercial VPN through your VPS exit node.

Personally, I ended up with two Wireguard containers in the target LAN, a wireguard-server and a **wireguard-client **container.

They both share a docker network with a specific subnet {DOCKER_SUBNET} and wireguard-client has a static IP {WG_CLIENT_IP} in that subnet.


The wireguard-client has a slightly altered standard config to establish a tunnel to an external endpoint, a commercial VPN in this case:

[Interface]
PrivateKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Address = XXXXXXXXXXXXXXXXXXX

PostUp = iptables -t nat -A POSTROUTING -o wg+ -j MASQUERADE
PreDown = iptables -t nat -D POSTROUTING -o wg+ -j MASQUERADE

PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT

PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT

[Peer]
PublicKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AllowedIPs = 0.0.0.0/0,::0/0
Endpoint = XXXXXXXXXXXXXXXXXXXX

where

PostUp = iptables -t nat -A POSTROUTING -o wg+ -j MASQUERADE
PreDown = iptables -t nat -D POSTROUTING -o wg+ -j MASQUERADE

are responsible for properly routing traffic coming in from outside the container and

PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT

PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT

is your standard kill-switch meant to block traffic going out of any network interface except the tunnel interface in the event of the tunnel going down.


The wireguard-server container has these PostUPs and -Downs:

PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

default rules that come with the template and allow for routing packets through the server tunnel

PostUp = wg set wg0 fwmark 51820

the traffic out of the tunnel interface get marked

PostUp = ip -4 route add 0.0.0.0/0 via {WG_CLIENT_IP} table 51820

add a rule to routing table 51820 for routing all packets through the wireguard-client container

PostUp = ip -4 rule add not fwmark 51820 table 51820

packets not marked should use routing table 51820

PostUp = ip -4 rule add table main suppress_prefixlength 0

respect manual rules added to main routing table

PostUp = ip route add {LAN_SUBNET} via {DOCKER_SUBNET_GATEWAY_IP} dev eth0

route packages with a destination in {LAN_SUBNET} to the actual {LAN_SUBNET} of the host

PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip route del {LAN_SUBNET} via {DOCKER_SUBNET_GATEWAY_IP} dev eth0

delete those rules after the tunnel goes down

PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark 0xca6c -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -I OUTPUT ! -o %i -m mark ! --mark 0xca6c -m addrtype ! --dst-type LOCAL -j REJECT
PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark 0xca6c -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -D OUTPUT ! -o %i -m mark ! --mark 0xca6c -m addrtype ! --dst-type LOCAL -j REJECT

Basically the same kill-switch as in wireguard-client, but with the mark manually substituted since the command it relied on didn't work in my server container for some reason and AFAIK the mark actually doesn't change.


Now do I actually need the kill-switch in wireguard-server? Is the kill-switch in wireguard-client sufficient? I'm not even sure anymore.

[–] Emotet@slrpnk.net 7 points 2 days ago

In der üblichen paradoxen Kombination aus Politikverdrossenheit und -interesse meinen Kopf schütteln, weiterhin wählen gehen und versuchen, mich so wenig davon im Alltag beinflussen zu lassen wie möglich.

[–] Emotet@slrpnk.net 2 points 3 days ago

Oh I'm fully aware. I personally don't care, but one could add a capable VPS and deploy the Wireguard Host Container + two Client Containers, one for the LAN and one for the commercial VPN (like so), if the internet connection of the LAN in question isn't sufficient.

[–] Emotet@slrpnk.net 3 points 4 days ago

Oh, neat! Never noticed that option in the Wireguard app before. That's very helpful already. Regarding your opnsense setup:

I've dabbled in some (simple) routing before, but I'm far from anything one could call competent in that regard and even if I'd read up properly before writing my own routes/rules, I'd probably still wouldn't trust that I hadn't forgotten something to e.g. prevent IP/DNS leaks.

I'm mainly relying on a Docker and was hoping for pointers on how to configure a Wireguard host container to route only internet traffic through another Wireguard Client container.

I found this example, which is pretty close to my ideal setup. I'll read up on that.

 

Currently, I have two VPN clients on most of my devices:

  • One for connecting to a LAN
  • One commercial VPN for privacy reasons

I usually stay connected to the commercial VPN on all my devices, unless I need to access something on that LAN.

This setup has a few drawbacks:

  • Most commercial VPN providers have a limit on the number of simulations connected clients
  • I either obfuscate my IP or am able to access resources on that LAN, including my Pi-Hole fur custom DNS-based blocking

One possible solution for this would be to route all internet traffic through a VPN client on the router in the LAN and figuring out how to still be able to at least have a port open for the VPN docker container allowing access to the LAN. But then the ability to split tunnel around that would be pretty hard to achieve.

I want to be able to connect to a VPN host container on the LAN, which in turn routes all internet traffic through another VPN client container while allowing LAN traffic, but still be able to split tunnel specific applications on my Android/Linux/iOS devices.

Basically this:

   +---------------------+ internet traffic   +--------------------+           
   |                     | remote LAN traffic |                    |           
   | Client              |------------------->|VPN Host Container  |           
   | (Android/iOS/Linux) |                    |in remote LAN       |           
   |                     |                    |                    |           
   +---------------------+                    +--------------------+           
                      |                         |     |                        
                      |       remote LAN traffic|     | internet traffic       
split tunneled traffic|                 |--------     |                        
                      |                 |             v                        
                      v                 |         +---------------------------+
  +---------------------+               v         |                           |
  | regular LAN or      |     +-----------+       | VPN Client Container      |
  | internet connection |     |remote LAN |       | connects to commercial VPN|
  +---------------------+     +-----------+       |                           |
                                                  |                           |
                                                  +---------------------------+

Any recommendations on how to achieve this, especially considering client apps for Android and iOS with the ability to split tunnel per application?

Update:

~~Got it by following this guide.~~

Ended up modifying this setup to have better control over potential IP leakage

[–] Emotet@slrpnk.net 7 points 4 days ago

Ball-Gags mit O-Ringen, wann?

[–] Emotet@slrpnk.net 8 points 4 days ago

Weil ich keine Lust habe das Profitape in H-Form zu kaufen (ein Monat Mund zukleben für 19,99 Euro), schneide ich Pflastertape in zwei schmale Streifen und klebe sie als X über meine Lippen.

Schnell fühlt sich meine Zunge schwer an, als wäre sie zu groß für meinen Mund. Ich versuche es zu ignorieren, wie wenn es im Sommer zu heiß zum Einschlafen ist. Nicht bewegen und aushalten.

Im Schlaf muss ich mich von dem Klebeband befreit haben. Am Morgen klebt es über meinem Bett an der Wand. Auch die zweite Nacht halte ich nicht durch. Ich werde fast stündlich wach und gebe auf.

[–] Emotet@slrpnk.net 18 points 5 days ago (10 children)

Zu den bei Dieben besonders beliebten Warengruppen in Supermärkten und Discountern zählen Spirituosen, Tabakwaren, Kosmetikprodukte, Rasierklingen, Energydrinks sowie Babynahrung und Kaffee. Fleisch, Wurst und Käse werden ebenfalls häufiger genannt.

Meist handelt es sich um Gelegenheitstäter, für mindestens ein Viertel der Diebstähle sind professionelle Täter verantwortlich, die bandenmäßig agieren.

Bei Lebensmitteln kann ich die Position zumindest so halbwegs nachvollziehen, aber bei Spirituosen, Tabakwaren, Kosmetikprodukte, Rasierklingen, Energydrinks und Kaffee? Warum steht das Menschen zu, wenn als Folge des Diebstahls lediglich die Preise für die ehrlichen Kunden angezogen werden?

Ladendiebstahl ist kein nobler Protest oder gar eine Art Freiheitskampf gegen das böse kapitalistische Problem. Wenn das überhandnimmt, schließt einfach die lokale Filiale. Die meisten Diebe finden es wohl einfach geil, sich auf Kosten anderer zu bereichern. Fuck all of you, I got mine. Höchst asozial.

[–] Emotet@slrpnk.net 43 points 5 days ago

“Wir brauchen eine Debattenkultur, in der Menschen ihre Meinung und ihre Sorgen sagen können, ohne in Schubladen gesteckt zu werden”

Menschen über ihr Tun, ihr Wirken und nicht über ihre Herkunft zu definieren, dafür stehe für sie das neue Grundsatzprogramm der CDU, so die Politikerin.

Ah, die werte Frau Sekmen will also eine Debattenkultur ohne Schubladendenken und wechselt deswegen zur Union. Die sind ja bekanntlich sehr aufgeschlossen, besonders was populistische Positionen, Korruption und Verquickung von Mandat und persönlichen Interessen angeht.

Das hat garantiert nichts damit zu tun, dass die Ampel, und damit auch die Grünen, bei der nächsten Wahl höchstwahrscheinlich nicht mehr die regierende Koalition sein wird und die werte Frau Sekmen sich bessere Chancen zum Ausbauen von politischer Macht und persönlicher Bereicherung bei der politisch quasi gegenläufigen Union erhofft.

Das Landeslistenmandat, welches durch grüne Stimmen errungen wurde und durch welches sie nicht direkt gewählt wurde, niederlegen? Ne, Anstand ist out, gerade als neuer Parteifreund von Scheuer lernt man ja recht schnell, dass das Fußvolk lediglich ein zu manipulierender Pöbel ist, auf dessen Rücken man so viel besser nach mehr Macht grabschen kann.

[–] Emotet@slrpnk.net 31 points 5 days ago (3 children)

Absolute Randgruppe, aber als jemand, der mit GrapheneOS unterwegs ist:

Wäre toll, wenn Wero die Möglichkeit bietet, ohne Google Pay NFC Bezahlungen abzuwickeln.

[–] Emotet@slrpnk.net 12 points 5 days ago

To add to this:

We have to differentiate between physical and cybersecurity.

Are you more likely to physically lose your smartphone you carry around with you all day than your full ATX desktop standing in your office? Yeah.

But let's consider the consequences for a moment.

If someone physically stole your desktop, chances are that at least a part of your data isn't encrypted, the boot sequence probably isn't (at least completely) verified, and your OS is wide open. There is little to no real isolation in most desktop setups. Once somebody managed to gain access to your system, it is outright trivial to steal your browser sessions, modify commands or run some code, at least in userland.

Physically stealing your smartphone is easy. But a modern smartphone is usually protected by verified boot and a password+fingerprint/Face ID combo. Unless you take active steps to compromise the security of the phone like rooting/jailbreaking it, disabling verified boot or disabling the passcode, it's pretty hard if not near impossible to gain access to your data or modify it in a harmful way. If you visit an infected site or install an infected app, the damage is usually confined to that app's data and the data accessible to it by permissions you probably had to allow to be set in the first place.

Now that's speaking to your usual bad actors and usual setups. Exceptions, as always, make the rule. As soon as a sufficiently motivated and technically able actor with access to 0-day exploits, like a state actor, targets you for some reason, all bets are off. But even in this case, due to the advanced verified boot chain on most modern smartphones, those exploits rarely have the ability to survive beyond a reboot.

[–] Emotet@slrpnk.net 83 points 6 days ago

That's the joke.

 

@elvith@feddit.org und ich haben mehr oder weniger unabhängig zwei Web Apps entwickelt , welche beide bis auf gewisse Extrafeatures den Accountumzug so einfach wie möglich gestalten sollten:

https://stablenarwhal.github.io/Lemmy-Userdata-Migration/

Features:

  • Don't trust me or GitHub? Clone the project and host it yourself or run it locally (Example in Wiki)
  • Export user data from any Lemmy instance (>=v0.19)
  • Download user data as a text file
  • Modify user data, e.g. to add or remove followed users/communites (Example in Wiki)
    • "display_name" ​
    • "bio" ​
    • "avatar" ​
    • "banner" ​
    • "matrix_id" ​
    • "bot_account" ​
    • "settings" ​
    • "followed_communities" ​
    • "saved_posts" ​
    • "saved_comments" ​
    • "blocked_communities" ​
    • "blocked_users" ​
    • "blocked_instances"
  • Transfer user data to the target account on the target instance

https://elvith-de.github.io/lemmy-migration/

Features:

  • Login and export settings from any Lemmy instance (e.g. feddit.de)
  • Optionally: Find local communities on the target instance that match followed communities
  • Optionally: Backup your settings to a file (can be imported on any Lemmy instance in your profile)
  • Login and import settings to any Lemmy instance (e.g. feddit.org)
 

@elvith@feddit.org und ich haben mehr oder weniger unabhängig zwei Web Apps entwickelt , welche beide bis auf gewisse Extrafeatures den Accountumzug so einfach wie möglich gestalten sollten:

https://stablenarwhal.github.io/Lemmy-Userdata-Migration/

Features:

  • Export user data from any Lemmy instance (>=v0.19)
  • Download user data as a text file
  • Modify user data, e.g. to add or remove followed users/communites (Example in Wiki)
    • "display_name" ​
    • "bio" ​
    • "avatar" ​
    • "banner" ​
    • "matrix_id" ​
    • "bot_account" ​
    • "settings" ​
    • "followed_communities" ​
    • "saved_posts" ​
    • "saved_comments" ​
    • "blocked_communities" ​
    • "blocked_users" ​
    • "blocked_instances"
  • Transfer user data to the target account on the target instance

https://elvith-de.github.io/lemmy-migration/

Features:

  • Login and export settings from any Lemmy instance (e.g. feddit.de)
  • Optionally: Find local communities on the target instance that match followed communities
  • Optionally: Backup your settings to a file (can be imported on any Lemmy instance in your profile)
  • Login and import settings to any Lemmy instance (e.g. feddit.org)
 

cross-posted from: https://slrpnk.net/post/10823519

So I wrote a little web app that allows a user to move their user data, like settings and subscribed/banned communities, from one account/instance to another.

It runs completely client-side, but is hosted on GitHub for the moment. Maybe it'll be of some use!

Features:

  • Don't trust me or GitHub? Clone the project and host it yourself or run it locally (Example in Wiki)
  • Export user data from any Lemmy instance (>=v0.19)
  • Download user data as a text file
  • Modify user data, e.g. to add or remove followed users/communites (Example in Wiki)
    • "display_name" ​
    • "bio" ​
    • "avatar" ​
    • "banner" ​
    • "matrix_id" ​
    • "bot_account" ​
    • "settings" ​
    • "followed_communities" ​
    • "saved_posts" ​
    • "saved_comments" ​
    • "blocked_communities" ​
    • "blocked_users" ​
    • "blocked_instances"
  • Transfer user data to the target account on the target instance
 

So I wrote a little web app that allows a user to move their user data, like settings and subscribed/banned communities, from one account/instance to another.

It runs completely client-side, but is hosted on GitHub for the moment. Maybe it'll be of some use!

 

An dieser Stelle reposte ich auch auf der neuen deutschen Main-Instanz zwei einfache Wege, um seinen User (Settings und abonnierte/geblockte Communities) von einer Lemmy Instanz auf eine andere umzuziehen, beispielsweise von feddit.de auf feddit.org, von meinem ursprünglichen Post unter feddit.de/c/main ( https://alexandrite.app/feddit.de/post/11325409)

Update: Ich habe für die erhöhte Userfreundlichkeit noch eine Web Applikation erstellt, welche den Prozess so einfach wie möglich gestalten soll. Zu finden hier:

https://stablenarwhal.github.io/Lemmy-Userdata-Migration/

Features:

  • Export user data from any Lemmy instance (>=v0.19)
  • Download user data as a text file
  • Modify user data in the browser, e.g. to add or remove followed instances
  • Transfer user data to the target account on the target instance

Update 2: @elvith@feddit.org hat auch eine Web Applikation mit ähnlicher Funktionalität entwickelt. Zu finden hier:

https://elvith-de.github.io/lemmy-migration/

Features:

  • Login and export settings from any Lemmy instance (e.g. feddit.de)
  • Optionally: Find local communities on the target instance that match followed communities
  • Optionally: Backup your settings to a file (can be imported on any Lemmy instance in your profile)
  • Login and import settings to any Lemmy instance (e.g. feddit.org)

Weg 1, falls man noch einen Browser mit aktiver Session auf feddit.de hat:

Lemmy bietet seit Version 0.19 eine Funktion an, um die user data zu ex- und importieren. Das geht normalerweise über einen Button in den Settings des Webinterfaces, das geht aktuell bei feddit.de nicht.

Aber der zugrundeliegende API-Aufruf funktioniert noch, solange man noch mit einem Browser auf feddit.de eingeloggt ist:

  1. Man gehe auf https://feddit.de/api/v3/user/export_settings und speichert die zurückgegebene Datei als irgendwas.json
  2. Man nehme einen (neuen) Account auf einer stabilen Instanz der Wahl, gehe auf /settings und lade irgendwas.json über den Import-Button hoch.
  3. Voilà, man genieße die neue Instanz.

Das funktioniert mit jeder Instanz >=0.19, man muss lediglich das "feddit.de" in der URL ersetzen. Und wenn das Webinterface funktioniert, geht das auch über den Export- Button in den Settings.


Weg 2:

Für die Leute, die keine offene Browser Session haben, hier ein kleines, aber funktionales Bash Script, welches im Ausführungsverzeichnis eine myFedditUserData.json erstellt, welche bei anderen Instanzen importiert werden kann.

Anforderungen:

  • Linux/Mac OS X /Windows mit WSL
  • jq installiert (Unter Ubuntu/Debian/Mint z.B. per sudo apt install -y jq

Anleitung:

  • Folgendes Script unter einem beliebigen Namen mit .sh Endung abspeichern, z.B. getMyFedditUserData.sh
  • Script in beliebigen Textprogramm öffnen, Username/Mail und Passwort ausfüllen (optional Instanz ändern)
  • Terminal im Ordner des Scripts öffnen und chmod +x getMyFedditUserData.sh ausführen (Namen eventuell anpassen)
  • ./getMyFedditUserData.sh im Terminal eingeben
  • Nun liegt im Ordner neben dem Script eine frische myFedditUserData.json

Anmerkung: Das Script ist recht simpel, es wird ein JWT Bearer Token angefragt und als Header bei dem GET Aufruf von https://feddit.de/api/v3/user/export_settings mitgegeben. Wer kein Linux/Mac OS X zur Verfügung hat, kann den Ablauf mit anderen Mitteln nachstellen.

Das Script:

#!/bin/bash

# Basic login script for Lemmy API

# CHANGE THESE VALUES
my_instance="https://feddit.de"			# e.g. https://feddit.nl
my_username=""			# e.g. freamon
my_password=""			# e.g. hunter2

########################################################

# Lemmy API version
API="api/v3"

########################################################

# Turn off history substitution (avoid errors with ! usage)
set +H

########################################################

# Login
login() {
	end_point="user/login"
	json_data="{\"username_or_email\":\"$my_username\",\"password\":\"$my_password\"}"

	url="$my_instance/$API/$end_point"

	curl -H "Content-Type: application/json" -d "$json_data" "$url"
}

# Get userdata as JSON
getUserData() {
	end_point="user/export_settings"

	url="$my_instance/$API/$end_point"

	curl -H "Authorization: Bearer ${JWT}" "$url"
}

JWT=$(login | jq -r '.jwt')

printf 'JWT Token: %s\n' "$JWT"

getUserData | jq > myFedditUserData.json

@elvith@feddit.org hat mein Script auch in PowerShell nachgebaut, welches unter Windows ohne WSL auskommt: https://gist.github.com/elvith-de/89107061661e001df659d7a7d413092b

# CHANGE THESE VALUES
$my_instance="https://feddit.de" # e.g. https://feddit.nl
$target_file = "C:\Temp\export.json"

########################################################
#Ask user for username and password
$credentials = Get-Credential -Message "Logindata for $my_instance" -Title "Login"

$my_username= $credentials.UserName
$my_password= $credentials.GetNetworkCredential().Password

# Lemmy API version
$API="api/v3"

# Login
function Get-AuthToken() {
    $end_point="user/login"
    $json_data= @{
        "username_or_email" = $my_username;
        "password" = $my_password
    } | ConvertTo-Json

    $url="$my_instance/$API/$end_point"

    (Invoke-RestMethod -Headers @{"Content-Type" = "application/json"} -Body $json_data -Method Post -Uri $url).JWT
}

# Get userdata as JSON
function Get-UserData() {
    $end_point="user/export_settings"

    $url="$my_instance/$API/$end_point"

    Invoke-RestMethod -Headers @{"Authorization"="Bearer $($JWT)"} -Method Get -Uri $url
}

$JWT= Get-AuthToken

Write-Host "Got JWT Token: $JWT"

Write-Host "Exporting data to $target_file"
Get-UserData | ConvertTo-Json | Out-File -FilePath $target_file
view more: next ›