Live data from Hacker News

Circumventing Deep Packet Inspection with Socat and Rot13

gist.github.com

31–39 of 39 posts

Re: Circumventing Deep Packet Inspection with Socat and Rot13

#31
post #29

> They permit SSL to some known websites (for https), but the moment I try to create an SSL or SSH connection to an unknown server (eg. to the bastion box), their gateway instantly terminates the TCP connection! They are clearly already whitelisting connections, but still allow unidentified connections through?! What sort of logic is that?

Probably to not break on unknown protocols.

Re: Circumventing Deep Packet Inspection with Socat and Rot13

#32
post #17

I once did rot13 on /lib/firmware/* (not just 13 but 0-255), piped it via 'strings' command and find longest word in English corpus (/usr/share/dict/*). I forget what I found but it's trivial to replicate.

This was my best attempt at this:

  cd /lib/firmware
  ( find -name '*.xz' -exec xzcat {} \; ; find -type f -a \! -name '*.xz' -a -exec cat {} \; ) |
    rot13 |
    grep -aEo '\w+' |
    awk '{print length, $0 }' |
    sort -nsru |
    head -20
I didn't see anything very interesting in the top results.

Edit: The sort -u option hides words of the same length. Removing that option (and the head command) gives more results, but nothing that interesting.

Re: Circumventing Deep Packet Inspection with Socat and Rot13

#33
post #29

> They permit SSL to some known websites (for https), but the moment I try to create an SSL or SSH connection to an unknown server (eg. to the bastion box), their gateway instantly terminates the TCP connection! They are clearly already whitelisting connections, but still allow unidentified connections through?! What sort of logic is that?

Why block all HTTP(non-S) traffic when you can inspect its plaintext? At least I assume that was their thinking.

Re: Circumventing Deep Packet Inspection with Socat and Rot13

#34
post #30
post #14

I love this! Using a 2000+ year cipher to circumvent Deep Packet Inspection seems almost poetic. I feel like the article missed out on mentioning one key thing: Using a deny-list doesn’t work. It’s much more viable to default block and allow the stuff you know you’ll allow. Defaulting to allow and blocking stuff you don’t want is how you end up being owned by rot13.

http://www.ranum.com/security/computer_security/editorials/d... "The Six Dumbest Ideas in Computer Security" > #1) Default Permit > #2) Enumerating Badness

Reading point #4 on a site called "Hacker News" seems rather ironic.

I wonder how you might encourage deeper introspection into software infrastructure security vulnerabilities, both from closed source companies and from obscure open source projects, without "spreading breadcrumbs for the roaches"

Re: Circumventing Deep Packet Inspection with Socat and Rot13

#35
This is why rolling your own crypto often works in practice if you are a smaller operator: Nobody ****ing expects it, and there's a good chance nobody cares enough to investigate manually what you did or add support to commercial products to handle it.

Re: Circumventing Deep Packet Inspection with Socat and Rot13

#36
post #30
post #14

I love this! Using a 2000+ year cipher to circumvent Deep Packet Inspection seems almost poetic. I feel like the article missed out on mentioning one key thing: Using a deny-list doesn’t work. It’s much more viable to default block and allow the stuff you know you’ll allow. Defaulting to allow and blocking stuff you don’t want is how you end up being owned by rot13.

http://www.ranum.com/security/computer_security/editorials/d... "The Six Dumbest Ideas in Computer Security" > #1) Default Permit > #2) Enumerating Badness

Thank you for sharing the post. It made my day so far, I actually want to re-read it and take notes.

Re: Circumventing Deep Packet Inspection with Socat and Rot13

#39
post #28
post #25

Earlier quoted context omitted.

double rot13 has an unfortunate meet-in-the-middle weakness but triple rot13 was invented for this very purpose. I hope he makes the upgrade.

For anyone not in on the joke, this is a real crypto concept/weakness/attack https://en.m.wikipedia.org/wiki/Meet-in-the-middle_attack (obviously only a joke with rot13). It's most famously the reason that 3DES is a thing, instead of just double.

Thanks, and I'm happy this joke I've been saving landed on its feet when I threw it out.
Post reply on HN