vss

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2020 License: GPL-3.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-vss

build coverage report doc

This projects adds bindings for libvshadow for Go for macos, linux and windows systems. go-vss parses a raw VSS file into a NTFS file system.

Usage

In general, there are different ways to load a raw vss filesystem:

  1. Using a go reader object
  2. Using a file descriptor
  3. Using a path

Make sure, you have installed the package:

go get github.com/forensicanalysis/go-vss

Using a go reader object

package main

import (
	"fmt"
	"os"

	"github.com/forensicanalysis/go-vss"
)

func main() {
	reader, err := os.Open("vss.raw")

	stores, err := vss.NewByReader(reader)

	for _, fs := range stores {
		root, _ := fs.Open("/")
		filenames, _ := root.Readdirnames(0)
		fmt.Println(filenames)
	}
}

Using a file descriptor

package main

import (
	"fmt"
	"syscall"

	"github.com/forensicanalysis/go-vss"
)

func main() {
	fd, err := syscall.Open(path, syscall.O_RDONLY|syscall.O_CLOEXEC, 755)

	stores, err := vss.NewByFd(fd)

	for _, fs := range stores {
		root, _ := fs.Open("/")
		filenames, _ := root.Readdirnames(0)
		fmt.Println(filenames)
	}
}

Using a path

package main

import (
	"fmt"

	"github.com/forensicanalysis/go-vss"
)

func main() {
	path := "vss.raw"

	stores, err := vss.NewByPath(path)

	for _, fs := range stores {
		root, _ := fs.Open("/")
		filenames, _ := root.Readdirnames(0)
		fmt.Println(filenames)
	}
}

Updating libvshadow

This project builds upon the libvshadow created by Joachim Metz. The prebuild static libraries of libvshadow are placed in the subfolders libvshadow_prebuild\windows, libvshadow_prebuild\darwin and libvshadow_prebuild\linux.

The current version used in the project is: 20191221

If you need to update the library use the following instructions to build new static libraries:

  1. Download the required libvshadow-[new-version].tar.gz from the relases.
  2. Remove the current libvshadow-[old-version].tar.gz and place the new libvshadow-[new-version].tar.gz into the root directory of the repository.
  3. Adjust the Makefile and .github/workflows: Make sure to update the version numbers in order to use the updated libvshadow-[new-version].tar.gz.
  4. Commit and push the directory. Github actions creates artifacts containing the static libraries. Once all actions succeeded, you can download the static libvshadow libraries for each operating system: macos, linux and windows.
  5. Extract the static libs (all of them are called libvshadow.a) to the correct destination:
    • libvshadow_windows -> libvshadow_prebuild\windows
    • libvshadow_macos -> libvshadow_prebuild\macos
    • libvshadow_linux -> libvshadow_prebuild\linux

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bufferlen

type Bufferlen = C.ulong

type Offset

type Offset = C.long

type VSS

type VSS struct {
	// contains filtered or unexported fields
}

VSS implements a NTFS filesystem that is based on a Volume Shadow Copy.

func NewByFd

func NewByFd(fd int) ([]*VSS, error)

NewByFd returns a VSS filesystem specified by a file descriptor.

func NewByPath

func NewByPath(path string) ([]*VSS, error)

New returns a VSS filesystem for each Volume Shadow Copy found on the system.

func NewByReader

func NewByReader(read io.ReaderAt) ([]*VSS, error)

NewByReader returns a VSS filesystem specified by a file descriptor.

func (*VSS) Name

func (vss *VSS) Name() string

Name returns the name of the file system.

func (*VSS) Open

func (vss *VSS) Open(path string) (fslib.Item, error)

Open opens a file for reading.

func (*VSS) ReadAt

func (vss *VSS) ReadAt(b []byte, off int64) (n int, err error)

ReadAt reads data from the internal vss store.

func (*VSS) Stat

func (vss *VSS) Stat(path string) (os.FileInfo, error)

Stat returns an os.FileInfo object that describes a file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址