GithubHelp home page GithubHelp logo

Comments (9)

hillu avatar hillu commented on August 19, 2024 2

@staze With the help of a few colleagues, I think I have found a reliable way to exclude specific filesystems. If a filesystem type is still missing in the code, feel free to open a pull request or reopen this issue. (The output of the mount command would be helpful in that case.)

from local-log4j-vuln-scanner.

hillu avatar hillu commented on August 19, 2024 1

You'll have to build it as described in the README.

from local-log4j-vuln-scanner.

hillu avatar hillu commented on August 19, 2024

Sure. I suppose we could just determine the fs type for each directory and skip the directory if it's something weird.

The thing is: I have no idea what the actual values on MacOSX are. Could you please run the program (with the problematic paths as command line parameters) and paste its output? Thanks.

package main

import (
	"log"
	"os"
	"syscall"
)

func main() {
	var buf syscall.Statfs_t
	for _, path := range os.Args[1:] {
		if err := syscall.Statfs(path, &buf); err != nil {
			log.Fatalf("statfs: %s: %v", path, err)
		}
		log.Printf("path=%s: type=%08x\n", path, buf.Type)
	}
}

from local-log4j-vuln-scanner.

staze avatar staze commented on August 19, 2024

ahhh... though this was python but it's actually go.

Here it is against the Data partition (standard Big Sur/Monterey partition):
go run test_path.go /System/Volumes/
2022/01/05 16:09:36 path=/System/Volumes/: type=0000001c

Here it is against a fileshare "GROUPS"
go run test_path.go /System/Volumes/Data/Volumes/GROUPS
2022/01/05 16:11:19 path=/System/Volumes/Data/Volumes/GROUPS: type=0000001e

from local-log4j-vuln-scanner.

hillu avatar hillu commented on August 19, 2024

@staze Could you try the change I just pushed?

from local-log4j-vuln-scanner.

staze avatar staze commented on August 19, 2024

Hi @hillu I don't see a binary, just the go files. How would I test with those? Sorry...

from local-log4j-vuln-scanner.

staze avatar staze commented on August 19, 2024

Got it!

Okay, so it ignored one share, then started looking at another. it show as:

2022/01/05 17:05:28 path=/System/Volumes/Data/Volumes/fsdp: type=0000001f

Not sure if you want to just keep adding exceptions though.

from local-log4j-vuln-scanner.

hillu avatar hillu commented on August 19, 2024

Can you build and run the following test program? It's likle the first but should give more output.

package main

import (
	"log"
	"os"
	"syscall"
)

import "C"

func main() {
	var buf syscall.Statfs_t
	for _, path := range os.Args[1:] {
		if err := syscall.Statfs(path, &buf); err != nil {
			log.Fatalf("statfs: %s: %v", path, err)
		}
		log.Printf("path=%s: type=%08x subtype=%08x typename=%s\n", path, buf.Type, buf.Fssubtype,
			C.GoString((*C.char)(&buf.Fstypename[0])))
	}
}

If that does not work, try this:

package main

import (
	"log"
	"os"
	"syscall"
	"unsafe"
)

func main() {
	var buf syscall.Statfs_t
	for _, path := range os.Args[1:] {
		if err := syscall.Statfs(path, &buf); err != nil {
			log.Fatalf("statfs: %s: %v", path, err)
		}
		log.Printf("path=%s: type=%08x subtype=%08x typename=%s\n", path, buf.Type, buf.Fssubtype,
			string((*[16]byte)((unsafe.Pointer(&buf.Fstypename[0])))[:]))
	}
}

from local-log4j-vuln-scanner.

staze avatar staze commented on August 19, 2024

Sorry for delay, I had left work before last test you gave. running new code now, can confirm it's skipping both afp and smb fileshares. Thanks!

from local-log4j-vuln-scanner.

Related Issues (20)

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.