
PoC and technical analysis of CVE-2024-6387 (regreSSHion), with a Python harness that checks OpenSSH version and measures the LoginGraceTime race window.
regreSSHionA signal-handler race in sshd: remote, unauthenticated code execution as root on glibc-based Linux.
| CVE | CVE-2024-6387 ("regreSSHion") |
| CVSS v3.1 | 8.1 (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H) |
| Impact | Pre-authentication remote code execution as root |
| CWE | CWE-364 (Signal Handler Race Condition), CWE-828 |
| Public fix | OpenSSH 9.8 / 9.8p1, released 2024-07-01 |
| Discovery | Qualys Threat Research Unit |
malloc/syslog behaviour.sshd's SIGALRM handler fires when a connection exceeds LoginGraceTime.
That handler calls syslog() (and through it, signal-unsafe malloc/free paths)
— functions that are not async-signal-safe. When the signal lands while the
main packet-handling code is inside the heap, the allocator state can be corrupted.
The vulnerable pattern was reintroduced in OpenSSH 8.5p1 after having been fixed
in 2006 (CVE-2006-5051, hence "regreSSHion").
MaxStartups permits more than one unauthenticated child at a time
(the default 10:30:100 does — only a strict MaxStartups 1 closes the door).LoginGraceTime (default 120 s) widens the window in which the
alarm can fire while the child is in a heap operation.root in the forked child serving the malicious connection.Exploitation is probabilistic: the race must be hit, and a per-target
ASLR/heap layout question must be solved; published analyses quote large
numbers of attempts (tens of thousands of connections, hours) for reliable hits.
Unauthenticated network attacker reaching sshd obtains remote code execution
as root, i.e. full host compromise before any credential is presented.
sshd's privilege separation does not save the target: the vulnerable code runs
in the privileged parent context.
Most catalogued material stops at triggering the condition (open many
connections, wait for LoginGraceTime, watch for a crash). This repository adds:
MaxStartups and
LoginGraceTime together define the exploitable interval, and what the attacker
must overlap to win it;poc/regresshion_check.py) that decides
whether a given host is in vulnerable preconditions, not just whether a banner
says "OpenSSH": it parses the version against 9.8, and can measure the real
grace-time close delay of the target, which is the quantity that determines
the size of the window.Requires only Python 3 standard library.
# Passive check: banner + version verdict
python3 poc/regresshion_check.py 10.0.0.10
# Additionally measure the grace-time window (opens N connections, no auth)
python3 poc/regresshion_check.py 10.0.0.10 -n 20 -p 2222 -t 150
The script is non-destructive: it opens TCP connections, reads the banner, sends
the client identification line and (optionally) waits for the server to close.
Exit code 0 = server looks vulnerable, 1 = not vulnerable/unknown,
2 = connection error.
LoginGraceTime 0 removes the
alarm entirely (the socket then has no grace period and idle connections are
not timed out by that handler), at the cost of long-lived unauthenticated slots.MaxStartups to 1 narrows but does not fully remove the exposure.Gabriele D'Attile — https://github.com/GabrieleDattile

Tiefgehende Angriffsflächenkartierung und Asset-Erkennung

Schnelles passives Tool zur Subdomain-Enumeration.

reconFTW ist ein Tool, das entwickelt wurde, um automatisiertes Recon auf einer Zieldomäne durchzuführen, indem es die beste Auswahl an Tools zum Scannen und Auffinden von Schwachstellen ausführt.