Better HN
topnewbestaskshowjobs
Log inSign up

LinuxBender

57,650 karma · joined Jun 16, 2015 (11y ago) · 19,241 submissions

I am not for everyone. To ignore me in uBlock Origin, add to "My filters":

   news.ycombinator.com##tr.athing.comtr:has(a.hnuser):has-text(/\bLinuxBender\b/)
For HN usage questions see https://github.com/minimaxir/hacker-news-undocumented for HN tips (not my repo)

    (\_/)
    (='.'=)
    (")_(")
Submissions

comment 7y ago · link · parent

Co2 into fuel [1]

[1] - https://www.cnbc.com/2018/06/07/carbon-engineering-and-harva...

comment 7y ago · link · parent

I've seen a few sites that suggest much of this is based on our orbit [1]. If that is true, then the oceans may be about to dump ludicrous amounts of Co2. Hopefully we can find a way to turn that into fuel.

[1] - https://www.youtube.com/results?search_query=milankovitch+cy...

comment 7y ago · link · parent

None of this was ever really required. All that was required was:

1) Make a law requiring all websites that allow user contributed content to enable RTA headers within {n} period of time.

2) Then make a law requiring all browsers and web apps look for that header and enforce parental controls within {y} period of time.

That's it. That puts the control in the hands of the parents and lets them decide if their progeny are ready for adult content. No need to give up PII.

comment 7y ago · link · parent

I see. Thankyou for the explanation.

comment 7y ago · link · parent

I suppose I am confused. Ether currency is supposed to be a hard to create thing, much like the theory of gold being a scarce mineral. If someone can just "mint" it without mining, then it is not a scarce resource and should not be worth anything.

16326.

US and Russia clash over power grid 'hack attacks'(bbc.com ↗)

2 points · by LinuxBender · 7y ago · discuss

16327.

Venmo transaction scraped in privacy warning to consumers(scmagazine.com ↗)

2 points · by LinuxBender · 7y ago · discuss

comment 7y ago · link · parent

A coworker suggested matrix, but I have been fine with murmur/mumble for my use cases. If a lot of people needed text chat, I would crank up the ol' IRC daemons and put TheLounge in front of it.

comment 7y ago · link · parent

Someone has to mine them though, right?

comment 7y ago · link · parent

Yeah, I prefer IRC too. I ended up shutting down all my IRC servers. Most folks moved to Discord/Slack and it just wasn't worth the effort to maintain them for my use case.

I only suggest murmur / mumble because they are super east to set up.

comment 7y ago · link · parent

I enjoy the idea of them staring at me all day long.

That said, it's not the CIA I would be overly concerned about. It's the skiddies that learn how to implement the same level of access. Imagine a child predator watching your kids in their room. Worse, they know when a latch-key kids parent is not there. Combine this with Wifi SSID data from wigle.net and they have your street address.

comment 7y ago · link · parent

For chat, consider setting up your own Murmur server [1] and use Mumble to do voice and text chat. It is not has happy-clicky as Discord, but the sound quality is great and you can have thousands of people on a tiny VM. It is very easy to deploy. It looks like people have created ansible playbooks for this too. [2]

[1] - https://wiki.mumble.info/wiki/Main_Page

[2] - https://github.com/systemli/ansible-role-mumble

P.S. use their 1.3 RC version. It is very stable and much better than 1.2.

comment 7y ago · link · parent

So Mark Z. wants me to buy his Chuck-E-Cheese(c) tokens, then see where I spend them. /s

In all seriousness, are they offsetting the coin generation with windmills, sea turbines, or geothermal plants? How much power is being consumed by FB and the small handful of banks that are cranking out these tokens?

comment 7y ago · link · parent

I'd have to dig into the source code of that module. It makes sense to not raise it artificially higher than the requesting host. I just didn't expect them to have that logic. IPTables usually blindly does whatever bad idea I give it. :-)

comment 7y ago · link · parent

Theirs is just more specific. Both should mitigate the attack, but I would follow theirs instead of my example. They are certainly a better authority on the subject. If something goes wrong, much better to say "Followed vendor suggestions" than random HN poster. :-) That said, I would still use the raw table vs input.

comment 7y ago · link · parent

Good catch, I totally missed that.

comment 7y ago · link · parent

Thats a great idea. That would certainly help if someone unwittingly had some malware that enabled this behavior on their host, but you still wanted them to reach you.

comment 7y ago · link · parent

I've not done this in nftables, but this might give some ideas: [1]

[1] - https://wiki.nftables.org/wiki-nftables/index.php/Mangle_TCP...

comment 7y ago · link · parent

Well, anything that gets a vulnerable device to talk to a malicious device would be an issue. Probably best to check with each vendor and see what their story is if you can't filter the traffic between your devices and potentially malicious devices.

comment 7y ago · link · parent

In the event anyone needs this, you can also override outbound mss in case someone is telling your client to use a low mss.

This goes in the mangle table. DO NOT use this example unless you know for sure what you are doing.

    iptables -t mangle -I POSTROUTING -o eth0 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -m tcpmss --mss 1:100 -j TCPMSS --set-mss 1360
This example should work for most use cases, but don't do this unless you for sure know the implications. Dropping bad inbound options is easy, but outbound can get more complicated. I am just showing this in case anyone asks and I am asleep. :-) Talk to your network admins and ask what is the highest mss/mtu your VPN's and 3rd party networks support.

This may not even help, as the packet has already been generated and we are too late in the process. I just figure someone might ask. There are probably use cases where this may help (for proxies, edge firewalls, hypervisors, docker hosts, maybe)

Or just log and drop the connections, or send yourself (your app) a tcp-reset.

comment 7y ago · link · parent

If you are not exposing any tcp ports or reaching out directly from those devices to a malicious host, then very unlikely. Either way, it's best to check the vendors site or open a ticket with them, if that is an option.

An alternate option would be to put the device behind another firewall or load balancer or proxy that you know is not vulnerable.

comment 7y ago · link · parent

You are probably seeing scanners. Most of them probably have the same source port. There are some really poorly coded scanners that set minimal tcp options so they can scan super fast. It seems they don't care about the RFC's when writing those tools. I bet if you set the logging options in iptables to log ip options, you will see very similar options used across most of them. My theory is that they are compensating for the transcontinental latency.

     YOUR_RULE -m limit --limit 2/sec -j LOG --log-prefix="MALFORMED_MSS: " --log-ip-options --log-tcp-options --log-level 7

comment 7y ago · link · parent

Thats cool. In CentOS the default is 256. The settings are a little different though.

    net.ipv4.route.min_adv_mss = 256
    net.ipv4.tcp_base_mss = 512
    net.ipv6.route.min_adv_mss = 1220

comment 7y ago · link · parent

The raw tables does not contain INPUT. For the raw table you would have to use PREROUTING. If you are using the default table of filter, then you can use INPUT.

So for the raw table, it would be

    iptables -t raw -I PREROUTING -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m tcpmss --mss 1:500 -j DROP
For the default (filter) table

    iptables -t filter -I INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m tcpmss --mss 1:500 -j DROP
Generally speaking, if you know you are going to drop everything that matches a pattern or address, it is useful to put that in the raw table, so that malicious traffic can't spike your CPU load as easily. Every packet to the filter table will incur potentially CPU expensive conntrack table lookups. As your conntrack table gets bigger, this gets more expensive.

The reason I use the opposite method is that we not the normal range we want. Programs can also set super high values or not set mss at all (which is not the same as 0).

I explicitly set the interface, so that we don't match interfaces such as lo, tun, tap, vhost, veth, etc... because you never know what weird behavior some program depends on. In my example, eth0 is directly on the internet. In your systems, that might be bond0.

comment 7y ago · link · parent

Good point. I don't have a place to test ipv6. You would also have to create ip6tables rules to test that. If you have a test server on ipv6, please apply the rule and link it here. Well, test first, then link here. :-)

comment 7y ago · link · parent

And people thought I was weird for dancing by myself in front of my TV. The poor folks at the CIA will never un-see that.

comment 7y ago · link · parent

I've used several of these for years in conjunction with

    ip route add blackhole "${ip}"
Blocking via route uses less CPU and memory than iptables+iplist hashes, but iplist hashes can be useful if you want to track what is being blocked. If using iptables, be sure to block in the raw table to avoid connection tracking table CPU hits.

comment 7y ago · link · parent

This is the way I block such things on my own VM's (not at work) using iptables:

    iptables -t raw -I PREROUTING -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m tcpmss ! --mss 640:65535 -j DROP
Here it is in action:

    iptables -L -n -v -t raw | grep mss  
    84719 3392K DROP       tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            tcp flags:0x17/0x02 tcpmss match !640:65535

My settings may be a little aggressive and may block some old pptp/ppoe users. Perhaps 520 would be a safer low end. As a funny side note, this also blocks hping3's default settings (ping floods) as it doesn't set mss. This also blocks a slew of really poorly coded scanners.

For everything else at work, we are behind a layer 7 load balancer that is not vulnerable.

You may also find it useful to block fragmented packets. I've done this for years and never had an issue:

    iptables -t raw -I PREROUTING -i eth0 -f -j DROP
If you have the PoC, then feel free to first verify you can browse to https://tinyvpn.org/ then send the small MSS packets to that domain, then see if you can still browse to it. I don't care if the server reboots or crashes. Just don't send DDoS please, as the provider will complain to me.

To see the counters increase, here is a quick and silly cron job that will show you the MSS DROPs in the last minute, that I will disable after a couple days: [1]

[1] - https://tinyvpn.org/up/mss/

comment 7y ago · link · parent

It can proxy and cache them.

There is a hacky way to serve single page static files directly via haproxy, by creating a http file (including headers) and add it to a custom back-end. This is really only useful if you have one or two pages you need to serve and don't want to run another web server. Some people use this for outage or maintenance pages.

    acl landing path_beg /demo
    use_backend landing if landing

    backend landing
        mode http
        fullconn        10000
        errorfile 503 /opt/ha/landing_page.http
        http-request    set-log-level silent


    # cat landing_page.http

    HTTP/1.1 200 Ok
    Cache-Control: no-cache, no-store
    Connection: close
    Content-Type: text/plain

    This is a static text file served directly from HAproxy 1.9

    I will catch grief for showing this.

Then use acl's to send specific requests to that page. Obviously change/add headers as required for the content in the file and use-case. Perhaps useful for outage or maintenance pages. Use your imagination for other use cases where you might want to automatically serve such a page.

Here it is in use: [1]

[1] - https://tinyvpn.org/demo

16350.

Measles cases in United States rise to 1,044(lite.cnn.io ↗)

2 points · by LinuxBender · 7y ago · discuss

1
544545546
642