Exploit database

GH-8528d76519da7f525517d5d993c3aa4d

rvzsec/cve-2024-2961

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2024-2961

16 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files2
rvzsec/cve-2024-2961Revision 8326e2516614

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

fix.sh

Shell · 1,346 bytes
#!/bin/bash

# CVE-2024–2961 Security Issue Mitigation Script
# Author : Ravindu Wickramasinghe | rvz (@RVIZX9)

# check for the compromised character set
echo "[>] checking for compromised character set..."
BAD_ENCODINGS=$(iconv -l | grep -E 'CN-?EXT')

if [ -z "$BAD_ENCODINGS" ]; then
    echo "[>] system is safe. no vulnerable encodings found."
    exit 0
else
    echo "[!] system is vulnerable. compromised encodings found:"
    echo "$BAD_ENCODINGS"
fi

# path to gconv-modules-extra.conf
GCONV_MODULES_CONF=$(find /usr/lib* -name gconv-modules-extra.conf -print -quit 2>/dev/null)

if [ -z "$GCONV_MODULES_CONF" ]; then
    echo "[!] gconv-modules-extra.conf not found."
    exit 1
fi

# disable the vulnerable encodings
echo "[>] disabling vulnerable encodings..."
sudo sed -i.bak '/ISO-2022-CN-EXT/d;/ISO2022CNEXT/d' "$GCONV_MODULES_CONF"

# regenerate the cache
echo "[>] regenerating gconv-modules cache..."
sudo iconvconfig

# verify mitigation
echo "[>] verifying mitigation..."
NEW_BAD_ENCODINGS=$(iconv -l | grep -E 'CN-?EXT')

if [ -z "$NEW_BAD_ENCODINGS" ]; then
    echo "[>] mitigation successful. no vulnerable encodings found."
    sudo rm "${GCONV_MODULES_CONF}.bak" # removoing the previously created .bak file
else
    echo "[!] mitigation failed. vulnerable encodings still present:"
    echo "$NEW_BAD_ENCODINGS"
fi