-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
1,017 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Log Windows event logs information in ECS schema. | ||
// | ||
// Usage: | ||
// | ||
// flog [-hv] [-D DIRECTORY] [FILE ...] | ||
// | ||
// The flags are: | ||
// | ||
// -D directory | ||
// The log directory. | ||
// -h | ||
// Show usage. | ||
// -v | ||
// Show version. | ||
// | ||
// The arguments are: | ||
// | ||
// file | ||
// The event log file(s) to process. | ||
// Defaults to STDIN if not given. | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"io" | ||
|
||
"github.com/cuhsat/fact/internal/fact" | ||
"github.com/cuhsat/fact/internal/sys" | ||
"github.com/cuhsat/fact/pkg/flog" | ||
"github.com/cuhsat/fact/pkg/flog/evt" | ||
"golang.org/x/sync/errgroup" | ||
) | ||
|
||
func main() { | ||
D := flag.String("D", "", "Log directory") | ||
h := flag.Bool("h", false, "Show usage") | ||
v := flag.Bool("v", false, "Show version") | ||
|
||
flag.CommandLine.SetOutput(io.Discard) | ||
flag.Parse() | ||
|
||
files := flog.StripHash(sys.Args()) | ||
|
||
if *v { | ||
sys.Print("flog", fact.Version) | ||
} | ||
|
||
if *h || len(files) == 0 { | ||
sys.Usage("flog [-hv] [-D DIRECTORY] [FILE ...]") | ||
} | ||
|
||
g := new(errgroup.Group) | ||
|
||
for _, f := range files { | ||
g.Go(func() error { | ||
return evt.Log(f, *D) | ||
}) | ||
} | ||
|
||
if err := g.Wait(); err != nil { | ||
sys.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Log forensic artifacts information in ECS schema. | ||
// | ||
// Usage: | ||
// | ||
// flog [-hv] [-D DIRECTORY] [FILE ...] | ||
// | ||
// The flags are: | ||
// | ||
// -D directory | ||
// The log directory. | ||
// -h | ||
// Show usage. | ||
// -v | ||
// Show version. | ||
// | ||
// The arguments are: | ||
// | ||
// file | ||
// The artifact file(s) to process. | ||
// Defaults to STDIN if not given. | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"io" | ||
|
||
"github.com/cuhsat/fact/internal/fact" | ||
"github.com/cuhsat/fact/internal/sys" | ||
"github.com/cuhsat/fact/pkg/flog" | ||
"golang.org/x/sync/errgroup" | ||
) | ||
|
||
func main() { | ||
D := flag.String("D", "", "Log directory") | ||
h := flag.Bool("h", false, "Show usage") | ||
v := flag.Bool("v", false, "Show version") | ||
|
||
flag.CommandLine.SetOutput(io.Discard) | ||
flag.Parse() | ||
|
||
files := flog.StripHash(sys.Args()) | ||
|
||
if *v { | ||
sys.Print("flog", fact.Version) | ||
} | ||
|
||
if *h || len(files) == 0 { | ||
sys.Usage("flog [-hv] [-D DIRECTORY] [FILE ...]") | ||
} | ||
|
||
args := make([]string, 0) | ||
|
||
if len(*D) > 0 { | ||
args = append(args, "-D", *D) | ||
} | ||
|
||
g := new(errgroup.Group) | ||
|
||
g.Go(func() error { | ||
return flog.Evt(files, args) | ||
}) | ||
|
||
if err := g.Wait(); err != nil { | ||
sys.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# flog.evt | ||
Log Windows event log artifacts in [ECS](https://www.elastic.co/guide/en/ecs/current/index.html) schema. | ||
|
||
```sh | ||
$ flog.evt [-hv] [-D DIRECTORY] [FILE ...] | ||
``` | ||
|
||
Available options: | ||
|
||
- `-D` Log directory | ||
- `-h` Show usage | ||
- `-v` Show version | ||
|
||
Required system commands: | ||
|
||
- [dotnet](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) | ||
|
||
> Run `scripts/eztools.sh` to install [Eric Zimmerman's Tools](https://ericzimmerman.github.io/#!index.md). | ||
--- | ||
Part of the [Forensic Artifacts Collecting Toolkit](../README.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# flog | ||
Log forensics artifacts in [ECS](https://www.elastic.co/guide/en/ecs/current/index.html) schema. | ||
|
||
```sh | ||
$ flog [-hv] [-D DIRECTORY] [FILE ...] | ||
``` | ||
|
||
Available options: | ||
|
||
- `-D` Log directory | ||
- `-h` Show usage | ||
- `-v` Show version | ||
|
||
Supported artifacts for Windows 7+ systems: | ||
|
||
- [System Event Logs](flog.evt.md) | ||
|
||
--- | ||
Part of the [Forensic Artifacts Collecting Toolkit](../README.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
module github.com/cuhsat/fact | ||
|
||
go 1.22 | ||
|
||
require ( | ||
golang.org/x/sync v0.7.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= | ||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// FACT 3rd party functions. | ||
package fact | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
func EzTools(asm string) (p string, err error) { | ||
env := os.ExpandEnv("$EZTOOLS") | ||
|
||
if len(env) > 0 { | ||
p = filepath.Join(env, asm) | ||
return | ||
} | ||
|
||
wd, err := os.Getwd() | ||
|
||
p = filepath.Join(wd, asm) | ||
|
||
return | ||
} |
Oops, something went wrong.