Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: PoC for alive test. #1822

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add: PoC for alive test. #1822

wants to merge 3 commits into from

Conversation

jjnicola
Copy link
Member

What:
PoC for alive test.
It only support icmpv4
Jira: SC-1104

Why:

How:
For testing, compile with nasl-builtin-raw-ip feature and run
sudo target/debug/scannerctl alivetest --icmp -t 192.168.0.1,192.168.0.2,192.168.0.3 --timeout 5000 --verbose

Checklist:

  • Tests
  • PR merge commit message adjusted

@jjnicola jjnicola requested a review from a team as a code owner January 17, 2025 18:06
Copy link

github-actions bot commented Jan 17, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA c24c433.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

OpenSSF Scorecard

PackageVersionScoreDetails
cargo/rayon >= 1.8.0, < 2.0.0 🟢 5.1
Details
CheckScoreReason
Code-Review🟢 3Found 5/13 approved changesets -- score normalized to 3
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 102 commit(s) and 11 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Packaging⚠️ -1packaging workflow not detected
Security-Policy⚠️ 0security policy file not detected
Binary-Artifacts🟢 10no binaries found in the repo
License🟢 10license file detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Vulnerabilities🟢 100 existing vulnerabilities detected
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • rust/Cargo.toml

@github-actions github-actions bot added minor_release creates a minor release and removed minor_release creates a minor release labels Jan 17, 2025
@github-actions github-actions bot added minor_release creates a minor release and removed minor_release creates a minor release labels Jan 17, 2025
@github-actions github-actions bot added minor_release creates a minor release and removed minor_release creates a minor release labels Jan 17, 2025
Copy link

github-actions bot commented Jan 17, 2025

🔍 Vulnerabilities of harbor-os.greenbone.net/community/openvas-scanner:1822-merge-amd64

📦 Image Reference harbor-os.greenbone.net/community/openvas-scanner:1822-merge-amd64
digestsha256:ab1046adf36fe950a0973416719f8a78f6c11a7c9882d2ca907456a8c4085f0d
vulnerabilitiescritical: 0 high: 1 medium: 0 low: 49 unspecified: 2
size144 MB
packages261
📦 Base Image debian:stable-20250113-slim
also known as
  • stable-slim
digestsha256:9dfddad9f09eadd2541a567e0865bd223387cf490b1c8d9d1f08d3b413766841
vulnerabilitiescritical: 0 high: 0 medium: 0 low: 23
critical: 0 high: 1 medium: 0 low: 1 libxml2 2.9.14+dfsg-1.3~deb12u1 (deb)

pkg:deb/debian/[email protected]%2Bdfsg-1.3~deb12u1?os_distro=bookworm&os_name=debian&os_version=12

high : CVE--2022--49043

Affected range>=2.9.14+dfsg-1.3~deb12u1
Fixed versionNot Fixed
EPSS Score0.04%
EPSS Percentile11th percentile
Description

xmlXIncludeAddNode in xinclude.c in libxml2 before 2.11.0 has a use-after-free.


[experimental] - libxml2 2.12.3+dfsg-0exp1

low : CVE--2024--34459

Affected range>=2.9.14+dfsg-1.3~deb12u1
Fixed versionNot Fixed
EPSS Score0.04%
EPSS Percentile12th percentile
Description

An issue was discovered in xmllint (from libxml2) before 2.11.8 and 2.12.x before 2.12.7. Formatting error messages with xmllint --htmlout can result in a buffer over-read in xmlHTMLPrintFileContext in xmllint.c.


critical: 0 high: 0 medium: 0 low: 7 glibc 2.36-9+deb12u9 (deb)

pkg:deb/debian/[email protected]%2Bdeb12u9?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2019--9192

Affected range>=2.36-9+deb12u9
Fixed versionNot Fixed
EPSS Score0.10%
EPSS Percentile42nd percentile
Description

In the GNU C Library (aka glibc or libc6) through 2.29, check_dst_limits_calc_pos_1 in posix/regexec.c has Uncontrolled Recursion, as demonstrated by '(|)(\1\1)*' in grep, a different issue than CVE-2018-20796. NOTE: the software maintainer disputes that this is a vulnerability because the behavior occurs only with a crafted pattern


low : CVE--2019--1010025

Affected range>=2.36-9+deb12u9
Fixed versionNot Fixed
EPSS Score0.35%
EPSS Percentile72nd percentile
Description

GNU Libc current is affected by: Mitigation bypass. The impact is: Attacker may guess the heap addresses of pthread_created thread. The component is: glibc. NOTE: the vendor's position is "ASLR bypass itself is not a vulnerability.


low : CVE--2019--1010024

Affected range>=2.36-9+deb12u9
Fixed versionNot Fixed
EPSS Score2.33%
EPSS Percentile90th percentile
Description

GNU Libc current is affected by: Mitigation bypass. The impact is: Attacker may bypass ASLR using cache of thread stack and heap. The component is: glibc. NOTE: Upstream comments indicate "this is being treated as a non-security bug and no real threat.


low : CVE--2019--1010023

Affected range>=2.36-9+deb12u9
Fixed versionNot Fixed
EPSS Score0.84%
EPSS Percentile82nd percentile
Description

GNU Libc current is affected by: Re-mapping current loaded library with malicious ELF file. The impact is: In worst case attacker may evaluate privileges. The component is: libld. The attack vector is: Attacker sends 2 ELF files to victim and asks to run ldd on it. ldd execute code. NOTE: Upstream comments indicate "this is being treated as a non-security bug and no real threat.


low : CVE--2019--1010022

Affected range>=2.36-9+deb12u9
Fixed versionNot Fixed
EPSS Score0.59%
EPSS Percentile78th percentile
Description

GNU Libc current is affected by: Mitigation bypass. The impact is: Attacker may bypass stack guard protection. The component is: nptl. The attack vector is: Exploit stack buffer overflow vulnerability and use this bypass vulnerability to bypass stack guard. NOTE: Upstream comments indicate "this is being treated as a non-security bug and no real threat.


low : CVE--2018--20796

Affected range>=2.36-9+deb12u9
Fixed versionNot Fixed
EPSS Score0.30%
EPSS Percentile69th percentile
Description

In the GNU C Library (aka glibc or libc6) through 2.29, check_dst_limits_calc_pos_1 in posix/regexec.c has Uncontrolled Recursion, as demonstrated by '(\227|)(\1\1|t1|\\2537)+' in grep.


low : CVE--2010--4756

Affected range>=2.36-9+deb12u9
Fixed versionNot Fixed
EPSS Score0.88%
EPSS Percentile83rd percentile
Description

The glob implementation in the GNU C Library (aka glibc or libc6) allows remote authenticated users to cause a denial of service (CPU and memory consumption) via crafted glob expressions that do not match any pathnames, as demonstrated by glob expressions in STAT commands to an FTP daemon, a different vulnerability than CVE-2010-2632.


  • glibc (unimportant)
  • eglibc (unimportant)
    That's standard POSIX behaviour implemented by (e)glibc. Applications using
    glob need to impose limits for themselves
critical: 0 high: 0 medium: 0 low: 5 pcre3 2:8.39-15 (deb)

pkg:deb/debian/pcre3@2:8.39-15?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2019--20838

Affected range>=2:8.39-15
Fixed versionNot Fixed
EPSS Score0.58%
EPSS Percentile78th percentile
Description

libpcre in PCRE before 8.43 allows a subject buffer over-read in JIT when UTF is disabled, and \X or \R has more than one fixed quantifier, a related issue to CVE-2019-20454.


low : CVE--2017--7246

Affected range>=2:8.39-15
Fixed versionNot Fixed
EPSS Score0.65%
EPSS Percentile79th percentile
Description

Stack-based buffer overflow in the pcre32_copy_substring function in pcre_get.c in libpcre1 in PCRE 8.40 allows remote attackers to cause a denial of service (WRITE of size 268) or possibly have unspecified other impact via a crafted file.


low : CVE--2017--7245

Affected range>=2:8.39-15
Fixed versionNot Fixed
EPSS Score0.65%
EPSS Percentile79th percentile
Description

Stack-based buffer overflow in the pcre32_copy_substring function in pcre_get.c in libpcre1 in PCRE 8.40 allows remote attackers to cause a denial of service (WRITE of size 4) or possibly have unspecified other impact via a crafted file.


low : CVE--2017--16231

Affected range>=2:8.39-15
Fixed versionNot Fixed
EPSS Score0.11%
EPSS Percentile46th percentile
Description

In PCRE 8.41, after compiling, a pcretest load test PoC produces a crash overflow in the function match() in pcre_exec.c because of a self-recursive call. NOTE: third parties dispute the relevance of this report, noting that there are options that can be used to limit the amount of stack that is used


  • pcre3 (unimportant)

low : CVE--2017--11164

Affected range>=2:8.39-15
Fixed versionNot Fixed
EPSS Score0.32%
EPSS Percentile71st percentile
Description

In PCRE 8.41, the OP_KETRMAX feature in the match function in pcre_exec.c allows stack exhaustion (uncontrolled recursion) when processing a crafted regular expression.


critical: 0 high: 0 medium: 0 low: 4 systemd 252.33-1~deb12u1 (deb)

pkg:deb/debian/[email protected]~deb12u1?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2023--31439

Affected range>=252.33-1~deb12u1
Fixed versionNot Fixed
EPSS Score0.14%
EPSS Percentile50th percentile
Description

An issue was discovered in systemd 253. An attacker can modify the contents of past events in a sealed log file and then adjust the file such that checking the integrity shows no error, despite modifications. NOTE: the vendor reportedly sent "a reply denying that any of the finding was a security vulnerability."


low : CVE--2023--31438

Affected range>=252.33-1~deb12u1
Fixed versionNot Fixed
EPSS Score0.11%
EPSS Percentile45th percentile
Description

An issue was discovered in systemd 253. An attacker can truncate a sealed log file and then resume log sealing such that checking the integrity shows no error, despite modifications. NOTE: the vendor reportedly sent "a reply denying that any of the finding was a security vulnerability."


low : CVE--2023--31437

Affected range>=252.33-1~deb12u1
Fixed versionNot Fixed
EPSS Score0.09%
EPSS Percentile41st percentile
Description

An issue was discovered in systemd 253. An attacker can modify a sealed log file such that, in some views, not all existing and sealed log messages are displayed. NOTE: the vendor reportedly sent "a reply denying that any of the finding was a security vulnerability."


low : CVE--2013--4392

Affected range>=252.33-1~deb12u1
Fixed versionNot Fixed
EPSS Score0.04%
EPSS Percentile5th percentile
Description

systemd, when updating file permissions, allows local users to change the permissions and SELinux security contexts for arbitrary files via a symlink attack on unspecified files.


critical: 0 high: 0 medium: 0 low: 4 openldap 2.5.13+dfsg-5 (deb)

pkg:deb/debian/[email protected]%2Bdfsg-5?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2020--15719

Affected range>=2.5.13+dfsg-5
Fixed versionNot Fixed
EPSS Score0.16%
EPSS Percentile53rd percentile
Description

libldap in certain third-party OpenLDAP packages has a certificate-validation flaw when the third-party package is asserting RFC6125 support. It considers CN even when there is a non-matching subjectAltName (SAN). This is fixed in, for example, openldap-2.4.46-10.el8 in Red Hat Enterprise Linux.


low : CVE--2017--17740

Affected range>=2.5.13+dfsg-5
Fixed versionNot Fixed
EPSS Score0.49%
EPSS Percentile76th percentile
Description

contrib/slapd-modules/nops/nops.c in OpenLDAP through 2.4.45, when both the nops module and the memberof overlay are enabled, attempts to free a buffer that was allocated on the stack, which allows remote attackers to cause a denial of service (slapd crash) via a member MODDN operation.


low : CVE--2017--14159

Affected range>=2.5.13+dfsg-5
Fixed versionNot Fixed
EPSS Score0.05%
EPSS Percentile23rd percentile
Description

slapd in OpenLDAP 2.4.45 and earlier creates a PID file after dropping privileges to a non-root account, which might allow local users to kill arbitrary processes by leveraging access to this non-root account for PID file modification before a root script executes a "kill cat /pathname" command, as demonstrated by openldap-initscript.


low : CVE--2015--3276

Affected range>=2.5.13+dfsg-5
Fixed versionNot Fixed
EPSS Score0.30%
EPSS Percentile69th percentile
Description

The nss_parse_ciphers function in libraries/libldap/tls_m.c in OpenLDAP does not properly parse OpenSSL-style multi-keyword mode cipher strings, which might cause a weaker than intended cipher to be used and allow remote attackers to have unspecified impact via unknown vectors.


  • openldap (unimportant)
    Debian builds with GNUTLS, not NSS
critical: 0 high: 0 medium: 0 low: 3 unspecified: 1krb5 1.20.1-2+deb12u2 (deb)

pkg:deb/debian/[email protected]%2Bdeb12u2?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2024--26461

Affected range>=1.20.1-2+deb12u2
Fixed versionNot Fixed
EPSS Score0.04%
EPSS Percentile11th percentile
Description

Kerberos 5 (aka krb5) 1.21.2 contains a memory leak vulnerability in /krb5/src/lib/gssapi/krb5/k5sealv3.c.


low : CVE--2024--26458

Affected range>=1.20.1-2+deb12u2
Fixed versionNot Fixed
EPSS Score0.04%
EPSS Percentile11th percentile
Description

Kerberos 5 (aka krb5) 1.21.2 contains a memory leak in /krb5/src/lib/rpc/pmap_rmt.c.


low : CVE--2018--5709

Affected range>=1.20.1-2+deb12u2
Fixed versionNot Fixed
EPSS Score0.09%
EPSS Percentile39th percentile
Description

An issue was discovered in MIT Kerberos 5 (aka krb5) through 1.16. There is a variable "dbentry->n_key_data" in kadmin/dbutil/dump.c that can store 16-bit data but unknowingly the developer has assigned a "u4" variable to it, which is for 32-bit data. An attacker can use this vulnerability to affect other artifacts of the database as we know that a Kerberos database dump file contains trusted data.


unspecified : CVE--2025--24528

Affected range>=1.20.1-2+deb12u2
Fixed versionNot Fixed
Description
critical: 0 high: 0 medium: 0 low: 3 curl 7.88.1-10+deb12u8 (deb)

pkg:deb/debian/[email protected]%2Bdeb12u8?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2025--0725

Affected range>=7.88.1-10+deb12u8
Fixed versionNot Fixed
Description

low : CVE--2025--0167

Affected range>=7.88.1-10+deb12u8
Fixed versionNot Fixed
Description

low : CVE--2024--2379

Affected range>=7.88.1-10+deb12u8
Fixed versionNot Fixed
EPSS Score0.04%
EPSS Percentile15th percentile
Description

libcurl skips the certificate verification for a QUIC connection under certain conditions, when built to use wolfSSL. If told to use an unknown/bad cipher or curve, the error path accidentally skips the verification and returns OK, thus ignoring any certificate problems.


critical: 0 high: 0 medium: 0 low: 2 m4 1.4.19-3 (deb)

pkg:deb/debian/[email protected]?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2008--1688

Affected range>=1.4.19-3
Fixed versionNot Fixed
EPSS Score1.53%
EPSS Percentile87th percentile
Description

Unspecified vulnerability in GNU m4 before 1.4.11 might allow context-dependent attackers to execute arbitrary code, related to improper handling of filenames specified with the -F option. NOTE: it is not clear when this issue crosses privilege boundaries.


  • m4 (unimportant)
    The file name is passed through a cmdline argument and m4 doesn't run with
    elevated privileges.

low : CVE--2008--1687

Affected range>=1.4.19-3
Fixed versionNot Fixed
EPSS Score1.19%
EPSS Percentile85th percentile
Description

The (1) maketemp and (2) mkstemp builtin functions in GNU m4 before 1.4.11 do not quote their output when a file is created, which might allow context-dependent attackers to trigger a macro expansion, leading to unspecified use of an incorrect filename.


  • m4 (unimportant)
    This is more a generic bug and not a security issue: the random output would
    need to match the name of an existing macro
critical: 0 high: 0 medium: 0 low: 2 perl 5.36.0-7+deb12u1 (deb)

pkg:deb/debian/[email protected]%2Bdeb12u1?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2023--31486

Affected range>=5.36.0-7+deb12u1
Fixed versionNot Fixed
EPSS Score0.29%
EPSS Percentile69th percentile
Description

HTTP::Tiny before 0.083, a Perl core module since 5.13.9 and available standalone on CPAN, has an insecure default TLS configuration where users must opt in to verify certificates.


low : CVE--2011--4116

Affected range>=5.36.0-7+deb12u1
Fixed versionNot Fixed
EPSS Score0.14%
EPSS Percentile51st percentile
Description

_is_safe in the File::Temp module for Perl does not properly handle symlinks.


critical: 0 high: 0 medium: 0 low: 2 libpcap 1.10.3-1 (deb)

pkg:deb/debian/[email protected]?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2024--8006

Affected range>=1.10.3-1
Fixed versionNot Fixed
EPSS Score0.04%
EPSS Percentile11th percentile
Description

Remote packet capture support is disabled by default in libpcap. When a user builds libpcap with remote packet capture support enabled, one of the functions that become available is pcap_findalldevs_ex(). One of the function arguments can be a filesystem path, which normally means a directory with input data files. When the specified path cannot be used as a directory, the function receives NULL from opendir(), but does not check the return value and passes the NULL value to readdir(), which causes a NULL pointer derefence.


low : CVE--2023--7256

Affected range>=1.10.3-1
Fixed versionNot Fixed
EPSS Score0.04%
EPSS Percentile11th percentile
Description

In affected libpcap versions during the setup of a remote packet capture the internal function sock_initaddress() calls getaddrinfo() and possibly freeaddrinfo(), but does not clearly indicate to the caller function whether freeaddrinfo() still remains to be called after the function returns. This makes it possible in some scenarios that both the function and its caller call freeaddrinfo() for the same allocated memory block. A similar problem was reported in Apple libpcap, to which Apple assigned CVE-2023-40400.


critical: 0 high: 0 medium: 0 low: 2 gcc-12 12.2.0-14 (deb)

pkg:deb/debian/[email protected]?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2023--4039

Affected range>=12.2.0-14
Fixed versionNot Fixed
EPSS Score0.06%
EPSS Percentile30th percentile
Description

DISPUTEDA failure in the -fstack-protector feature in GCC-based toolchains that target AArch64 allows an attacker to exploit an existing buffer overflow in dynamically-sized local variables in your application without this being detected. This stack-protector failure only applies to C99-style dynamically-sized local variables or those created using alloca(). The stack-protector operates as intended for statically-sized local variables. The default behavior when the stack-protector detects an overflow is to terminate your application, resulting in controlled loss of availability. An attacker who can exploit a buffer overflow without triggering the stack-protector might be able to change program flow control to cause an uncontrolled loss of availability or to go further and affect confidentiality or integrity. NOTE: The GCC project argues that this is a missed hardening bug and not a vulnerability by itself.


low : CVE--2022--27943

Affected range>=12.2.0-14
Fixed versionNot Fixed
EPSS Score0.10%
EPSS Percentile43rd percentile
Description

libiberty/rust-demangle.c in GNU GCC 11.2 allows stack consumption in demangle_const, as demonstrated by nm-new.


critical: 0 high: 0 medium: 0 low: 2 sqlite3 3.40.1-2+deb12u1 (deb)

pkg:deb/debian/[email protected]%2Bdeb12u1?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2023--36191

Affected range>=3.40.1-2
Fixed versionNot Fixed
Description

sqlite3 v3.40.1 was discovered to contain a segmentation violation at /sqlite3_aflpp/shell.c.


REJECTED

low : CVE--2021--45346

Affected range>=3.40.1-2+deb12u1
Fixed versionNot Fixed
EPSS Score0.28%
EPSS Percentile69th percentile
Description

A Memory Leak vulnerability exists in SQLite Project SQLite3 3.35.1 and 3.37.0 via maliciously crafted SQL Queries (made via editing the Database File), it is possible to query a record, and leak subsequent bytes of memory that extend beyond the record, which could let a malicious user obtain sensitive information. NOTE: The developer disputes this as a vulnerability stating that If you give SQLite a corrupted database file and submit a query against the database, it might read parts of the database that you did not intend or expect.


critical: 0 high: 0 medium: 0 low: 1 libgcrypt20 1.10.1-3 (deb)

pkg:deb/debian/[email protected]?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2018--6829

Affected range>=1.10.1-3
Fixed versionNot Fixed
EPSS Score0.33%
EPSS Percentile71st percentile
Description

cipher/elgamal.c in Libgcrypt through 1.8.2, when used to encrypt messages directly, improperly encodes plaintexts, which allows attackers to obtain sensitive information by reading ciphertext data (i.e., it does not have semantic security in face of a ciphertext-only attack). The Decisional Diffie-Hellman (DDH) assumption does not hold for Libgcrypt's ElGamal implementation.


critical: 0 high: 0 medium: 0 low: 1 gnupg2 2.2.40-1.1 (deb)

pkg:deb/debian/[email protected]?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2022--3219

Affected range>=2.2.40-1.1
Fixed versionNot Fixed
EPSS Score0.05%
EPSS Percentile19th percentile
Description

GnuPG can be made to spin on a relatively small input by (for example) crafting a public key with thousands of signatures attached, compressed down to just a few KB.


critical: 0 high: 0 medium: 0 low: 1 gnutls28 3.7.9-2+deb12u3 (deb)

pkg:deb/debian/[email protected]%2Bdeb12u3?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2011--3389

Affected range>=3.7.9-2+deb12u3
Fixed versionNot Fixed
EPSS Score1.43%
EPSS Percentile87th percentile
Description

The SSL protocol, as used in certain configurations in Microsoft Windows and Microsoft Internet Explorer, Mozilla Firefox, Google Chrome, Opera, and other products, encrypts data by using CBC mode with chained initialization vectors, which allows man-in-the-middle attackers to obtain plaintext HTTP headers via a blockwise chosen-boundary attack (BCBA) on an HTTPS session, in conjunction with JavaScript code that uses (1) the HTML5 WebSocket API, (2) the Java URLConnection API, or (3) the Silverlight WebClient API, aka a "BEAST" attack.


critical: 0 high: 0 medium: 0 low: 1 net-tools 2.10-0.1 (deb)

pkg:deb/debian/[email protected]?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2002--1976

Affected range>=2.10-0.1
Fixed versionNot Fixed
EPSS Score0.06%
EPSS Percentile27th percentile
Description

ifconfig, when used on the Linux kernel 2.2 and later, does not report when the network interface is in promiscuous mode if it was put in promiscuous mode using PACKET_MR_PROMISC, which could allow attackers to sniff the network without detection, as demonstrated using libpcap.


  • net-tools (unimportant)
    This seems to be a misunderstanding of what the PROMISC flag
    is about. ifconfig reports properly when it is set using
    "ifconfig promisc".
critical: 0 high: 0 medium: 0 low: 1 nmap 7.93+dfsg1-1 (deb)

pkg:deb/debian/[email protected]%2Bdfsg1-1?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2018--15173

Affected range>=7.93+dfsg1-1
Fixed versionNot Fixed
EPSS Score2.67%
EPSS Percentile90th percentile
Description

Nmap through 7.70, when the -sV option is used, allows remote attackers to cause a denial of service (stack consumption and application crash) via a crafted TCP-based service.


  • nmap (unimportant)
    No security impact
critical: 0 high: 0 medium: 0 low: 1 util-linux 2.38.1-5+deb12u3 (deb)

pkg:deb/debian/[email protected]%2Bdeb12u3?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2022--0563

Affected range>=2.38.1-5+deb12u3
Fixed versionNot Fixed
EPSS Score0.05%
EPSS Percentile20th percentile
Description

A flaw was found in the util-linux chfn and chsh utilities when compiled with Readline support. The Readline library uses an "INPUTRC" environment variable to get a path to the library config file. When the library cannot parse the specified file, it prints an error message containing data from the file. This flaw allows an unprivileged user to read root-owned files, potentially leading to privilege escalation. This flaw affects util-linux versions prior to 2.37.4.


critical: 0 high: 0 medium: 0 low: 1 glib2.0 2.74.6-2+deb12u5 (deb)

pkg:deb/debian/[email protected]%2Bdeb12u5?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2012--0039

Affected range>=2.74.6-2+deb12u5
Fixed versionNot Fixed
EPSS Score0.16%
EPSS Percentile53rd percentile
Description

GLib 2.31.8 and earlier, when the g_str_hash function is used, computes hash values without restricting the ability to trigger hash collisions predictably, which allows context-dependent attackers to cause a denial of service (CPU consumption) via crafted input to an application that maintains a hash table. NOTE: this issue may be disputed by the vendor; the existence of the g_str_hash function is not a vulnerability in the library, because callers of g_hash_table_new and g_hash_table_new_full can specify an arbitrary hash function that is appropriate for the application.


critical: 0 high: 0 medium: 0 low: 1 shadow 1:4.13+dfsg1-1 (deb)

pkg:deb/debian/shadow@1:4.13%2Bdfsg1-1?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2007--5686

Affected range>=1:4.13+dfsg1-1
Fixed versionNot Fixed
EPSS Score0.17%
EPSS Percentile55th percentile
Description

initscripts in rPath Linux 1 sets insecure permissions for the /var/log/btmp file, which allows local users to obtain sensitive information regarding authentication attempts. NOTE: because sshd detects the insecure permissions and does not log certain events, this also prevents sshd from logging failed authentication attempts by remote attackers.


  • shadow (unimportant)
    See #290803, on Debian LOG_UNKFAIL_ENAB in login.defs is set to no so
    unknown usernames are not recorded on login failures
critical: 0 high: 0 medium: 0 low: 1 apt 2.6.1 (deb)

pkg:deb/debian/[email protected]?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2011--3374

Affected range>=2.6.1
Fixed versionNot Fixed
EPSS Score0.31%
EPSS Percentile70th percentile
Description

It was found that apt-key in apt, all versions, do not correctly validate gpg keys with the master keyring, leading to a potential man-in-the-middle attack.


critical: 0 high: 0 medium: 0 low: 1 tar 1.34+dfsg-1.2+deb12u1 (deb)

pkg:deb/debian/[email protected]%2Bdfsg-1.2%2Bdeb12u1?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2005--2541

Affected range>=1.34+dfsg-1.2+deb12u1
Fixed versionNot Fixed
EPSS Score0.69%
EPSS Percentile80th percentile
Description

Tar 1.15.1 does not properly warn the user when extracting setuid or setgid files, which may allow local users or remote attackers to gain privileges.


This is intended behaviour, after all tar is an archiving tool and you
need to give -p as a command line flag

critical: 0 high: 0 medium: 0 low: 1 coreutils 9.1-1 (deb)

pkg:deb/debian/[email protected]?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2017--18018

Affected range>=9.1-1
Fixed versionNot Fixed
EPSS Score0.04%
EPSS Percentile5th percentile
Description

In GNU Coreutils through 8.29, chown-core.c in chown and chgrp does not prevent replacement of a plain file with a symlink during use of the POSIX "-R -L" options, which allows local users to modify the ownership of arbitrary files by leveraging a race condition.


critical: 0 high: 0 medium: 0 low: 1 openssl 3.0.15-1~deb12u1 (deb)

pkg:deb/debian/[email protected]~deb12u1?os_distro=bookworm&os_name=debian&os_version=12

low : CVE--2010--0928

Affected range>=3.0.11-1~deb12u2
Fixed versionNot Fixed
EPSS Score0.07%
EPSS Percentile31st percentile
Description

OpenSSL 0.9.8i on the Gaisler Research LEON3 SoC on the Xilinx Virtex-II Pro FPGA uses a Fixed Width Exponentiation (FWE) algorithm for certain signature calculations, and does not verify the signature before providing it to a caller, which makes it easier for physically proximate attackers to determine the private key via a modified supply voltage for the microprocessor, related to a "fault-based attack."


http://www.eecs.umich.edu/~valeria/research/publications/DATE10RSA.pdf
openssl/openssl#24540
Fault injection based attacks are not within OpenSSLs threat model according
to the security policy: https://www.openssl.org/policies/general/security-policy.html

critical: 0 high: 0 medium: 0 low: 0 unspecified: 1net-snmp 5.9.3+dfsg-2 (deb)

pkg:deb/debian/[email protected]%2Bdfsg-2?os_distro=bookworm&os_name=debian&os_version=12

unspecified : CVE--2024--26464

Affected range>=5.9.3+dfsg-2
Fixed versionNot Fixed
Description

net-snmp 5.9.4 contains a memory leak vulnerability in /net-snmp/apps/snmpvacm.c.


REJECTED


use tracing::debug;

/// Define IPPROTO_RAW
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose removing this docstring. It doesn't say anything about what IPPROTO_RAW is, which it should if we really wanted a docstring, so it is probably meant as a comment, but as a comment it just states the obvious.

/// Define IPPROTO_RAW
const IPPROTO_RAW: i32 = 255;

/// Default timeout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

enum AliveTestCtl {
Stop,
// (IP and succesful detection method)
Alive(String, AliveTestMethods),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I prefer using either a new type inside the enum variant (Alive(Alive)) or, probably cleaner:

enum AliveTestCtl {
    Stop,
    Alive {
        ip: String,
        detection_method: AliveTestMethods,
    }
}

Moreover, I think representing the IP by a IpAddr instead of String makes the intent clear immediately without the need for a comment and moves the parsing logic to an earlier point in the code, which I strongly prefer.

Comment on lines 44 to 51
match Socket::new_raw(
Domain::IPV4,
socket2::Type::RAW,
Some(Protocol::from(IPPROTO_RAW)),
) {
Ok(s) => Ok(s),
Err(_) => Err(AliveTestError::NoSocket("no socket".to_string())),
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is

fn new_raw_socket() -> Result<Socket, AliveTestError> {
    Socket::new_raw(
        Domain::IPV4,
        socket2::Type::RAW,
        Some(Protocol::from(IPPROTO_RAW)),
    ).map_err(|_| AliveTestError::NoSocket("no socket".to_string()))
}

Even better, make the error message of the NoSocket variant useful by adding the context (and removing the custom string):

.map_err(|e| AliveTestError::NoSocket(e))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! thanks! Didn't know how to use it!

async fn forge_icmp(dst: IpAddr) -> Result<Vec<u8>, AliveTestError> {
if dst.is_ipv6() {
return Err(AliveTestError::InvalidDestinationAddr(
"Invalid destination address".to_string(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I think adding the error message to the error variant here just makes everything more verbose without adding any value. I think this should be something like

return Err(AliveTestError::IPv6AddressInICMPDestination)

with error message defined on the AliveTestError struct itself, to keep the application logic separated from the error messages.

Comment on lines 314 to 315
let _ = worker_handle.await;
let _ = worker_capture_handle.await;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These results should be handled and not ignored

rust/src/alive_test/error.rs Show resolved Hide resolved
rust/src/alive_test/mod.rs Show resolved Hide resolved
rust/src/scannerctl/alivetest/mod.rs Show resolved Hide resolved
rust/src/scannerctl/alivetest/mod.rs Show resolved Hide resolved
@github-actions github-actions bot added minor_release creates a minor release and removed minor_release creates a minor release labels Jan 22, 2025
@github-actions github-actions bot added minor_release creates a minor release and removed minor_release creates a minor release labels Jan 22, 2025
@github-actions github-actions bot added minor_release creates a minor release and removed minor_release creates a minor release labels Jan 22, 2025
@jjnicola jjnicola force-pushed the rs-alive-detection branch 2 times, most recently from f9edf9a to 27ee979 Compare January 22, 2025 16:39
@github-actions github-actions bot added minor_release creates a minor release and removed minor_release creates a minor release labels Jan 22, 2025
@github-actions github-actions bot removed the minor_release creates a minor release label Jan 22, 2025
@github-actions github-actions bot added the minor_release creates a minor release label Jan 22, 2025
@github-actions github-actions bot added minor_release creates a minor release and removed minor_release creates a minor release labels Jan 27, 2025
@jjnicola jjnicola requested a review from Tehforsch January 27, 2025 11:54
@github-actions github-actions bot added minor_release creates a minor release and removed minor_release creates a minor release labels Feb 4, 2025
@github-actions github-actions bot added minor_release creates a minor release and removed minor_release creates a minor release labels Feb 4, 2025

fn forge_icmp(dst: IpAddr) -> Result<Vec<u8>, AliveTestError> {
if dst.is_ipv6() {
return Err(AliveTestError::InvalidDestinationAddr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have this method take Ipv4Addr to get rid of this check (and the superfluous one below)

Comment on lines 62 to 76
// Create an icmp packet from a buffer and modify it.
let mut buf = vec![0; ICMP_LENGTH];
let mut icmp_pkt = make_mut_icmp_packet(&mut buf)?;
icmp_pkt.set_icmp_type(IcmpTypes::EchoRequest);
icmp_pkt.set_icmp_code(IcmpCode::new(0u8));

// Require an unmutable ICMP packet for checksum calculation.
// We create an unmutable from the buffer for this purpose
let icmp_aux = IcmpPacket::new(&buf).ok_or_else(|| AliveTestError::CreateIcmpPacket)?;
let chksum = pnet::packet::icmp::checksum(&icmp_aux);

// Because the buffer of original mutable icmp packet is borrowed,
// create a new mutable icmp packet to set the checksum in the original buffer.
let mut icmp_pkt = make_mut_icmp_packet(&mut buf)?;
icmp_pkt.set_checksum(chksum);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can save all of the auxilliary packets via

Suggested change
// Create an icmp packet from a buffer and modify it.
let mut buf = vec![0; ICMP_LENGTH];
let mut icmp_pkt = make_mut_icmp_packet(&mut buf)?;
icmp_pkt.set_icmp_type(IcmpTypes::EchoRequest);
icmp_pkt.set_icmp_code(IcmpCode::new(0u8));
// Require an unmutable ICMP packet for checksum calculation.
// We create an unmutable from the buffer for this purpose
let icmp_aux = IcmpPacket::new(&buf).ok_or_else(|| AliveTestError::CreateIcmpPacket)?;
let chksum = pnet::packet::icmp::checksum(&icmp_aux);
// Because the buffer of original mutable icmp packet is borrowed,
// create a new mutable icmp packet to set the checksum in the original buffer.
let mut icmp_pkt = make_mut_icmp_packet(&mut buf)?;
icmp_pkt.set_checksum(chksum);
// Create an icmp packet from a buffer and modify it.
let mut buf = vec![0; ICMP_LENGTH];
let mut icmp_pkt = make_mut_icmp_packet(&mut buf)?;
icmp_pkt.set_icmp_type(IcmpTypes::EchoRequest);
icmp_pkt.set_icmp_code(IcmpCode::new(0u8));
icmp_pkt.set_checksum(icmp::checksum(&icmp_pkt.to_immutable()));

(note: I imported pnet::packet::icmp, but we can also qualify the path if you prefer)

let mut buf = vec![0; ICMP_LENGTH];
let mut icmp_pkt = make_mut_icmp_packet(&mut buf)?;
icmp_pkt.set_icmp_type(IcmpTypes::EchoRequest);
icmp_pkt.set_icmp_code(IcmpCode::new(0u8));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's 0u8 here? Why do we set this code in particular? Would appreciate a comment or extracting the 0u8 to a descriptive constant

MutableIpv4Packet::new(&mut ip_buf).ok_or_else(|| AliveTestError::CreateIcmpPacket)?;

pkt.set_header_length(HEADER_LENGTH);
pkt.set_next_level_protocol(IpNextHeaderProtocol(IpNextHeaderProtocols::Icmp.0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a complicated way of just writing

Suggested change
pkt.set_next_level_protocol(IpNextHeaderProtocol(IpNextHeaderProtocols::Icmp.0));
pkt.set_next_level_protocol(IpNextHeaderProtocols::Icmp);

pkt.set_header_length(HEADER_LENGTH);
pkt.set_next_level_protocol(IpNextHeaderProtocol(IpNextHeaderProtocols::Icmp.0));
pkt.set_ttl(DEFAULT_TTL);
match dst.to_string().parse::<Ipv4Addr>() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already parsed? Simply match on the ip addr. In fact we've already checked that it's ipv4 above, so there is no need for any of this.

},
}
fn make_mut_icmp_packet(buf: &mut Vec<u8>) -> Result<MutableIcmpPacket, AliveTestError> {
MutableIcmpPacket::new(buf).ok_or_else(|| AliveTestError::CreateIcmpPacket)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the new method returns None only if the provided buffer is not large enough to contain the packet. Since we control the buffer size, we should be able to safely unwrap on this call to the new method (that includes some of the calls to Ipv4Packet::new and IcmpPacket::new below).

Also I regret suggesting the creation of this method, since it will only ever be called once in the revised version of the code, so maybe inlining is better after all.

Comment on lines 36 to 42
enum AliveTestCtl {
Stop,
// (IP and successful detection method)
Alive {
ip: String,
detection_method: AliveTestMethods,
},
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like having a type for this overall, but I would split this into two types, since, as far as I can tell, only the capturing thread ever sends the Alive variant and only the other task ever sends Stop. So I'd go with

pub struct Stop;

pub struct AliveHost {
   ip: IpAddr, // It's an IpAddr, not a string.
   detection_method: AliveTestMethods,
}

Comment on lines 311 to 320
match send_handle.await {
Ok(Ok(())) => (),
Ok(Err(e)) => return Err(e),
Err(e) => return Err(AliveTestError::JoinError(e.to_string())),
};
match capture_handle.await {
Ok(Ok(())) => (),
Ok(Err(e)) => return Err(e),
Err(e) => return Err(AliveTestError::JoinError(e.to_string())),
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's safe enough to unwrap the .await call here, since the JoinError means that something failed within the task, so gracefully returning doesn't seem too useful.

I'd go with

Suggested change
match send_handle.await {
Ok(Ok(())) => (),
Ok(Err(e)) => return Err(e),
Err(e) => return Err(AliveTestError::JoinError(e.to_string())),
};
match capture_handle.await {
Ok(Ok(())) => (),
Ok(Err(e)) => return Err(e),
Err(e) => return Err(AliveTestError::JoinError(e.to_string())),
};
send_handle.await.unwrap()?;
capture_handle.await.unwrap()?;

Comment on lines 277 to 282
// TODO: Replace with a Storage type to store the alive host list
let mut alive = Vec::<(String, String)>::new();

if self.methods.contains(&AliveTestMethods::ConsiderAlive) {
for t in self.target.iter() {
alive.push((t.clone(), AliveTestMethods::ConsiderAlive.to_string()));
println!("{t} via {}", AliveTestMethods::ConsiderAlive.to_string())
}
return Ok(());
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if alive simply were Vec<AliveHost> (with AliveHost defined as above, i.e. the Alive variant in AliveTestCtl)? That seems to contain all the data we need and be cleaner than a collection of anonymous strings.


let timeout = self.timeout.unwrap_or(DEFAULT_TIMEOUT_MS);
let methods = self.methods.clone();
let send_handle = tokio::spawn(send_task(methods, trgt, timeout, tx_ctl));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that, in the current implementation, a malformed ip address in the trgt vector leads to an error much later in the program, when in fact we already know that this isn't supposed to happen. I propose doing something like

let trgt = trgt.into_iter().map(|ip_str| Ipv4Addr::from(ip_str)).collect::<Result<Vec<_>, _>>().map_err(|e| AliveTestError::InvalidDestinationAddr)?;

and then passing that into send_task, so that we do the parsing as early as possible (and make the send_task method more explicit and cleaner as a result.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to leave this as it is for now, since it is a PoC. Later, we need to introduce a better target handling. Currently, it only supports a comma separated IPv4 address list. But it should accept a Vec<Target>, where Target is an enum representing an IPv4, an IPv6 or a Hostname.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. In that case, I'd prefer doing exactly that: Make the argument a Vec<Target>, and define Target (for the PoC) as

enum Target { 
    Ipv4(Ipv4Address),
}

This way, we already do the "right thing" and can simply add the new variants when we want to support Ipv6 etc. In the current code, you'd need to remember that you need to replace every instance of parsing Ipv4 from a String with the appropriate logic. But if you prefer leaving it as it is, that is fine too

@ArnoStiefvater ArnoStiefvater added no_release Disable automatic release label creation and removed minor_release creates a minor release labels Feb 5, 2025
It only support icmpv4

For testing, compile with nasl-builtin-raw-ip feature and run
`sudo target/debug/scannerctl alivetest --icmp -t 192.168.0.1,192.168.0.2,192.168.0.3 --timeout 5000 --verbose`
@jjnicola jjnicola requested a review from Tehforsch February 6, 2025 09:45
@@ -80,7 +80,8 @@ walkdir = "2"
x509-certificate = "0.23.1"
x509-parser = "0.16.0"

pcap = { version = "1.0.0", optional = true }
rayon = { version = "1.8.0", optional = true }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed.

ip_buf.append(icmp_buf);
let total_length = ip_buf.len();
let mut pkt =
MutableIpv4Packet::new(&mut ip_buf).ok_or_else(|| AliveTestError::CreateIcmpPacket)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be the same as above here, we know the buffer has IP_LENGTH, so we can unwrap here.

}


fn forge_icmp_packet() -> Result<Vec<u8>, AliveTestError> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function always returns Ok() so we can get rid of the result

let chksum = checksum(&pkt.to_immutable());
pkt.set_checksum(chksum);

Ipv4Packet::owned(ip_buf).ok_or_else(|| AliveTestError::CreateIcmpPacket)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, this is always safe to unwrap. As a result, this method will never fail, so we can change the return type to Ipv4Packet<'static>


}

fn forge_icmp(dst: Ipv4Addr) -> Result<Ipv4Packet<'static>, AliveTestError> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method will also never fail afterwards.

}

fn process_ip_packet(packet: &[u8]) -> Result<Option<AliveHostCtl>, AliveTestError> {
let pkt = Ipv4Packet::new(&packet[16..]).ok_or_else(|| AliveTestError::CreateIcmpPacket)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message here will say

"Wrong buffer size. Not possible to create an ICMP packet"

but we're trying to create an IP packet. I think this should be AliveTestError::CreateIpPacket or even AliveTestError::WrongBufferSizeForIpPacket(packet.len() - 16) (something like that)

methods: Vec<AliveTestMethods>,
) -> Result<(), CliError> {
let s = Scanner::new(target, methods, timeout);
let _ = s.run_alive_test().await;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ignores the result. We should at least print the error message in an Err case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no_release Disable automatic release label creation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants