Giter VIP home page Giter VIP logo

scripts's Introduction

My GitHub Stats

My GitHub Language Stats

scripts's People

Contributors

cyclone-github avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

scripts's Issues

Try harder to find liblzma

On my ARM64 Manjaro laptop, the script says that liblzma can not be found. That's because sshd doesn't use liblzma in this case. However, liblzma is still vulnerable and it should be reported.

This patch fixes it for me:

--- xz_cve-2024-3094-detect.sh.orig	2024-03-30 11:53:33.460349832 +0100
+++ xz_cve-2024-3094-detect.sh	2024-03-30 11:52:27.854102624 +0100
@@ -25,6 +25,12 @@
 sshd_path=$(whereis -b sshd | awk '{print $2}')
 path=$(ldd "$sshd_path" 2>/dev/null | grep -o '/.*liblzma[^ ]*' | head -1)
 
+# or find path to liblzma used by xz
+if [ -z "$path" ]; then
+    xz_path=$(whereis -b xz | awk '{print $2}')
+    path=$(ldd "$xz_path" 2>/dev/null | grep -o '/.*liblzma[^ ]*' | head -1)
+fi
+
 if [ -z "$path" ]; then
     echo
     echo "Probably not vulnerable (liblzma not found)"

Thanks,
Simon

xz_cve-2024-3094-detect.sh - suggestion

  • path=$(ldd "$sshd_path" 2>/dev/null | grep liblzma | awk '{print $3}' | head -n 1)

can be optimized a bit and remove an unneeded pipe:

path=$(ldd "$sshd_path" 2>/dev/null | grep -o '/.*liblzma[^ ]*' | head -1)

Don't invoke xz

This'll probably not be as easy to use as the way you're currently doing it:
$(xz --version | head -n1 | awk '{print $4}')
Invokes xz, to get the version.

I's probably better to not invoke xz itself, but ask the package manager. For Debian based systems, this would be:
$(dpkg -l | grep xz | awk '{print $3}')

[xz_cve-2024-3094-detect.sh] possible false-positive

on an Arch system the script is checking only the version of xz and reporting vulnerable if it's 5.6.0/5.6.1, however Arch pushed a new version which is 5.6.1-2 (supersedes 5.6.1-1) which is (hopefully) not vulnerable, though the script says it is

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.