Opening windows in linux with sockets, bare hands and 200 lines of C
https://hereket.com/posts/from-scratch-x11-windowing/ [hereket.com]
2024-05-09 18:57
tags:
c
format
networking
programming
x11
In this post I want to create a single file C file program to open a windows inside Linux without using xlib or any similar libraries. The idea is to explore X11 protocol and see how it is used to interact with X server to create windows.
source: HN
PuTTY vulnerability vuln-p521-bias
https://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/vuln-p521-bias.html [www.chiark.greenend.org.uk]
2024-04-15 20:42
tags:
crypto
hash
networking
security
In all of those cases except P521, the bias introduced by reducing a 512-bit number mod q is negligible. But in the case of P521, where q has 521 bits (i.e. more than 512), reducing a 512-bit number mod q has no effect at all – you get a value of k whose top 9 bits are always zero.
CVE-2024-31497
https://marc.info/?l=oss-security&m=171321011524021&w=2
HTTP/2 CONTINUATION Flood: Technical Details
https://nowotarski.info/http2-continuation-flood-technical-details/ [nowotarski.info]
2024-04-04 23:35
tags:
networking
security
standard
web
Deep technical analysis of the CONTINUATION Flood: a class of vulnerabilities within numerous HTTP/2 protocol implementations. In many cases, it poses a more severe threat compared to the Rapid Reset: a single machine (and in certain instances, a mere single TCP connection or a handful of frames) has the potential to disrupt server availability, with consequences ranging from server crashes to substantial performance degradation. Remarkably, requests that constitute an attack are not visible in HTTP access logs.
source: HN
Preventing Cross-Service UDP Loops in QUIC
https://bughunters.google.com/blog/5960150648750080/preventing-cross-service-udp-loops-in-quic [bughunters.google.com]
2024-03-26 19:09
tags:
networking
security
standard
turtles
Infinite loops between servers are something that must be carefully avoided to prevent performance degradation or network overload.
In light of the heightened awareness of this attack vector, now is a good time to discuss looping behavior which impacted our implementation of QUIC and review the postmortem action items that followed each event. Our experience diagnosing and mitigating attacks, as well as deploying fixes, may assist others attempting to address similar threats.
An interactive study of common retry methods
https://encore.dev/blog/retries [encore.dev]
2023-11-23 04:00
tags:
development
networking
visualization
In this post we’re going to visually explore different methods of retrying requests, demonstrating why some common approaches are dangerous and ultimately ending up at what the best practice is. At the end of this post you will have a solid understanding of what makes safe retry behaviour, and a vivid understanding of what doesn’t.
source: L
Smashing the state machine: the true potential of web race conditions
https://portswigger.net/research/smashing-the-state-machine [portswigger.net]
2023-08-10 16:24
tags:
concurrency
exploit
networking
security
web
HTTP request processing isn’t atomic - any endpoint might be sending an application through invisible sub-states. This means that with race conditions, everything is multi-step. The single-packet attack solves network jitter, making it as though every attack is on a local system. This exposes vulnerabilities that were previously near-impossible to detect or exploit.
source: L
The day my ping took countermeasures
https://blog.cloudflare.com/the-day-my-ping-took-countermeasures/ [blog.cloudflare.com]
2023-07-12 00:08
tags:
development
investigation
linux
networking
swtools
While this doesn’t happen too often, a computer clock can be freely adjusted either forward or backward. However, it’s pretty rare for a regular network utility, like ping, to try to manage a situation like this. It’s even less common to call it “taking countermeasures”. I would totally expect ping to just print a nonsensical time value and move on without hesitation.
Ping developers clearly put some thought into that. I wondered how far they went. Did they handle clock changes in both directions? Are the bad measurements excluded from the final statistics? How do they test the software?
source: L
See this page fetch itself, byte by byte, over TLS
https://subtls.pages.dev/ [subtls.pages.dev]
2023-05-11 21:08
tags:
interactive
networking
security
visualization
This page performs a live, annotated https: request for its own source. It’s inspired by The Illustrated TLS 1.3 Connection and Julia Evans’ toy TLS 1.3.
source: L
whoarethey: Determine Who Can Log In to an SSH Server
https://www.agwa.name/blog/post/whoarethey [www.agwa.name]
2023-01-11 04:12
tags:
networking
opsec
security
As a proof of concept, I’ve created whoarethey, a small Go program that takes the hostname:port of an SSH server, an SSH username, and a list of GitHub usernames, and prints out the GitHub username which is authorized to connect to the server.
source: HN
A Tale Of A Trailing Dot
https://daniel.haxx.se/blog/2022/05/12/a-tale-of-a-trailing-dot/ [daniel.haxx.se]
2022-05-14 00:41
tags:
networking
security
standard
text
turtles
web
Trailing dots on host names in URLs is the gift that keeps on giving. Let me take you through a dwindling story of how the dot is handled differently in different places through the stack of an Internet client. The evil trailing dot.
source: L
How I'm Using SNI Proxying and IPv6 to Share Port 443 Between Webapps
https://www.agwa.name/blog/post/using_sni_proxying_and_ipv6_to_share_port_443 [www.agwa.name]
2022-04-16 05:33
tags:
admin
networking
I’ve written about SNI proxying before, but in a nutshell: a proxy server can use the first message in a TLS connection (the Client Hello message, which is unencrypted and contains the server name (SNI) that the client wants to connect to) to decide where to route the connection.
source: L
Harder Drive: Hard drives we didn't want or need
http://tom7.org/harder/ [tom7.org]
2022-04-13 04:29
tags:
hardware
networking
random
retro
solder
storage
video
The perils of the “real” client IP
https://adam-p.ca/blog/2022/03/x-forwarded-for/ [adam-p.ca]
2022-03-05 22:36
tags:
cloud
networking
security
turtles
web
The state of getting the “real client IP” using X-Forwarded-For and other HTTP headers is terrible. It’s done incorrectly, inconsistently, and the result is used inappropriately. This leads to security vulnerabilities in a variety of projects, and will certainly lead to more in the future.
source: HN
The 5-hour CDN
https://fly.io/blog/the-5-hour-content-delivery-network/ [fly.io]
2021-03-22 02:51
tags:
cloud
networking
web
The term “CDN” (“content delivery network“) conjures Google-scale companies managing huge racks of hardware, wrangling hundreds of gigabits per second. But CDNs are just web applications. That’s not how we tend to think of them, but that’s all they are. You can build a functional CDN on an 8-year-old laptop while you’re sitting at a coffee shop. I’m going to talk about what you might come up with if you spend the next five hours building a CDN.
It’s useful to define exactly what a CDN does. A CDN hoovers up files from a central repository (called an origin) and stores copies close to users. Back in the dark ages, the origin was a CDN’s FTP server. These days, origins are just web apps and the CDN functions as a proxy server. So that’s what we’re building: a distributed caching proxy.
SSH and User-mode IP WireGuard
https://fly.io/blog/ssh-and-user-mode-ip-wireguard/ [fly.io]
2021-03-12 03:23
tags:
admin
cloud
development
go
library
networking
For a couple hundred lines of code (not counting the entire user-mode Linux you’ll be pulling in from gVisor, HEY! Dependencies! What are you gonna do!) you can bring up a new, cryptographically authenticated network, any time you want to, in practically any program.
There really are some fun libraries out there if you want to build something crazy.
source: HN
Uncovering a 24-year-old bug in the Linux Kernel
https://engineering.skroutz.gr/blog/uncovering-a-24-year-old-bug-in-the-linux-kernel/ [engineering.skroutz.gr]
2021-02-15 18:16
tags:
bugfix
c
linux
networking
programming
When one side’s receive buffer (Recv-Q) fills up (in this case because the rsync process is doing disk I/O at a speed slower than the network’s), it will send out a zero window advertisement, which will put that direction of the connection on hold. When buffer space eventually frees up, the kernel will send an unsolicited window update with a non-zero window size, and the data transfer continues. To be safe, just in case this unsolicited window update is lost, the other end will regularly poll the connection state using the so-called Zero Window Probes (the persist mode we are seeing here).
Apparently, the bug was in the bulk receiver fast-path, a code path that skips most of the expensive, strict TCP processing to optimize for the common case of bulk data reception. This is a significant optimization, outlined 28 years ago² by Van Jacobson in his “TCP receive in 30 instructions” email. Apparently the Linux implementation did not update snd_wl1 while in the receiver fast path. If a connection uses the fast path for too long, snd_wl1 will fall so far behind that ack_seq will wrap around with respect to it. And if this happens while the receive window is zero, there is no way to re-open the window, as demonstrated above. What’s more, this bug had been present in Linux since v2.1.8, dating back to 1996!
source: trivium
KEMTLS: Post-quantum TLS without signatures
https://blog.cloudflare.com/kemtls-post-quantum-tls-without-signatures/ [blog.cloudflare.com]
2021-01-16 02:37
tags:
beta
crypto
networking
quantum
security
web
KEMTLS, therefore, achieves the same goals as TLS 1.3 (authentication, confidentiality and integrity) in the face of quantum computers. But there’s one small difference compared to the TLS 1.3 handshake. KEMTLS allows the client to send encrypted application data in the second client-to-server TLS message flow when client authentication is not required, and in the third client-to-server TLS message flow when mutual authentication is required. Note that with TLS 1.3, the server is able to send encrypted and authenticated application data in its first response message (although, in most uses of TLS 1.3, this feature is not actually used). With KEMTLS, when client authentication is not required, the client is able to send its first encrypted application data after the same number of handshake round trips as in TLS 1.3.
Intuitively, the handshake signature in TLS 1.3 proves possession of the private key corresponding to the public key certified in the TLS 1.3 server certificate. For these signature schemes, this is the straightforward way to prove possession; another way to prove possession is through key exchanges. By carefully considering the key derivation sequence, a server can decrypt any messages sent by the client only if it holds the private key corresponding to the certified public key. Therefore, implicit authentication is fulfilled. It is worth noting that KEMTLS still relies on signatures by certificate authorities to authenticate the long-term KEM keys.
How NAT traversal works
https://tailscale.com/blog/how-nat-traversal-works/ [tailscale.com]
2021-01-11 23:30
tags:
article
networking
We covered a lot of ground in our post about How Tailscale Works. However, we glossed over how we can get through NATs (Network Address Translators) and connect your devices directly to each other, no matter what’s standing between them. Let’s talk about that now!
Very detailed.
node.example.com Is An IP Address
https://tuckersiemens.com/posts/node-example-com-is-an-ip-address/ [tuckersiemens.com]
2020-12-30 02:19
tags:
bugfix
networking
programming
python
type-system
This takes a bit to get to the punchline, but man, good old duck typing for the win.
It turns out that, under certain conditions, the ipaddress module can create IPv6 addresses from raw bytes. My assumption is that it offers this behavior as a convenient way to parse IP addresses from data fresh off the wire.
Does node.example.com meet those certain conditions? You bet it does. Because we’re using Python 2 it’s just bytes and it happens to be 16 characters long.
source: L
NAT Slipstreaming
https://samy.pl/slipstream/ [samy.pl]
2020-11-01 19:51
tags:
browser
exploit
networking
security
turtles
web
NAT Slipstreaming allows an attacker to remotely access any TCP/UDP service bound to a victim machine, bypassing the victim’s NAT/firewall (arbitrary firewall pinhole control), just by the victim visiting a website.
This is neat, although you have to dig in a bit to learn it requires the NAT gateway to do some fancy SIP proxying.
source: L