Skip to content

Commit 2ccf41c

Browse files
committed
remove aggressive mode from short term roadmap
1 parent 7342bea commit 2ccf41c

File tree

8 files changed

+43
-39
lines changed

8 files changed

+43
-39
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,32 @@ _go-yara_ and CGO compilation. You'll find a detailed documentation [here](READM
3131

3232
### Usage
3333
```
34-
usage: irma [-h|--help] [-y|--yara-rules "<value>"] [-d|--dump "<value>"]
34+
usage: irma [-h|--help] [-c|--network-capture "<value>"] [-b|--bpffilter
35+
"<value>"] [-y|--yara-rules "<value>"] [-d|--dump "<value>"]
3536
[-q|--quarantine "<value>"] [-k|--kill] [-f|--faker]
36-
[-n|--notifications] [-v|--verbose]
37+
[-n|--notifications] [-v|--verbose]
3738
3839
Incident Response - Minimal Analysis
3940
4041
Arguments:
4142
42-
-h --help Print help information
43-
-y --yara-rules Yara rules path (the program will look for *.yar files
44-
recursively). Default: ./yara-signatures
45-
-d --dump Dump all running process to the specified directory
46-
-q --quarantine Specify path to store matching artefacts in quarantine
47-
(Base64/RC4 with key: irma
48-
-k --kill Kill suspicious process ID (without removing process
49-
binary)
50-
-f --faker Spawn fake processes such as wireshark / procmon /
51-
procdump / x64dbg
52-
-n --notifications Use Windows notifications when a file or memory stream
53-
match your YARA rules
54-
-v --verbose Display every error and information messages
43+
-h --help Print help information
44+
-c --network-capture Capture network interface to PCAP file. Default:
45+
-b --bpffilter Use Berkeley Packet Filter to capture only selected
46+
parts of network traffic. Default:
47+
-y --yara-rules Yara rules path (the program will look for *.yar files
48+
recursively). Default: ./yara-signatures
49+
-d --dump Dump all running process to the specified directory
50+
-q --quarantine Specify path to store matching artefacts in quarantine
51+
(Base64/RC4 with key: irma)
52+
-k --kill Kill suspicious process ID (without removing process
53+
binary)
54+
-f --faker Spawn fake processes such as wireshark / procmon /
55+
procdump / x64dbg
56+
-n --notifications Use Windows notifications when a file or memory stream
57+
match your YARA rules
58+
-v --verbose Display every error and information messages
59+
5560
```
5661

5762
## About this project and future versions

analysis.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type FileDescriptor struct {
2222
}
2323

2424
// FileAnalysis sub-routine for file analysis (used in registry / task scheduler / startmenu scan)
25-
func FileAnalysis(path string, pQuarantine string, pKill bool, pAggressive bool, pNotifications bool, pVerbose bool, rules *yara.Rules, sourceIndex string) {
25+
func FileAnalysis(path string, pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, rules *yara.Rules, sourceIndex string) {
2626
var f os.FileInfo
2727
var err error
2828
var content []byte
@@ -91,7 +91,7 @@ func FileAnalysis(path string, pQuarantine string, pKill bool, pAggressive bool,
9191
}
9292

9393
// MemoryAnalysis sub-routine for running processes analysis
94-
func MemoryAnalysis(proc *ProcessInformation, pQuarantine string, pKill bool, pAggressive bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
94+
func MemoryAnalysis(proc *ProcessInformation, pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
9595
if pVerbose {
9696
log.Println("[INFO] [MEMORY] Analyzing", proc.ProcessName, "PID:", proc.PID)
9797
}

filehelper.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,30 @@ import (
1313
)
1414

1515
// WindowsFileSystemAnalysisRoutine analyse windows filesystem every 300 seconds
16-
func WindowsFileSystemAnalysisRoutine(pQuarantine string, pKill bool, pAggressive bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
16+
func WindowsFileSystemAnalysisRoutine(pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
1717
for {
1818
env := ListEnvironmentPathFiles(pVerbose)
1919
temp := ListTemporaryFiles(pVerbose)
2020

2121
for _, p := range env {
22-
FileAnalysis(p, pQuarantine, pKill, pAggressive, pNotifications, pVerbose, rules, "ENV")
22+
FileAnalysis(p, pQuarantine, pKill, pNotifications, pVerbose, rules, "ENV")
2323
}
2424

2525
for _, p := range temp {
26-
FileAnalysis(p, pQuarantine, pKill, pAggressive, pNotifications, pVerbose, rules, "TEMP")
26+
FileAnalysis(p, pQuarantine, pKill, pNotifications, pVerbose, rules, "TEMP")
2727
}
2828

2929
time.Sleep(300 * time.Second)
3030
}
3131
}
3232

3333
// UserFileSystemAnalysisRoutine analyse windows filesystem every 60 seconds
34-
func UserFileSystemAnalysisRoutine(pQuarantine string, pKill bool, pAggressive bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
34+
func UserFileSystemAnalysisRoutine(pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
3535
for {
3636
files := ListUserWorkspaceFiles(pVerbose)
3737

3838
for _, p := range files {
39-
FileAnalysis(p, pQuarantine, pKill, pAggressive, pNotifications, pVerbose, rules, "USER")
39+
FileAnalysis(p, pQuarantine, pKill, pNotifications, pVerbose, rules, "USER")
4040
}
4141
time.Sleep(60 * time.Second)
4242
}

main.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,11 @@ func main() {
5353
pBpfFilter := parser.String("b", "bpffilter", &argparse.Options{Required: false, Default: "", Help: "Use Berkeley Packet Filter to capture only selected parts of network traffic"})
5454
pYaraPath := parser.String("y", "yara-rules", &argparse.Options{Required: false, Default: "./yara-signatures", Help: "Yara rules path (the program will look for *.yar files recursively)"})
5555
pDump := parser.String("d", "dump", &argparse.Options{Required: false, Help: "Dump all running process to the specified directory"})
56-
pQuarantine := parser.String("q", "quarantine", &argparse.Options{Required: false, Help: "Specify path to store matching artefacts in quarantine (Base64/RC4 with key: irma"})
56+
pQuarantine := parser.String("q", "quarantine", &argparse.Options{Required: false, Help: "Specify path to store matching artefacts in quarantine (Base64/RC4 with key: irma)"})
5757
pKill := parser.Flag("k", "kill", &argparse.Options{Required: false, Help: "Kill suspicious process ID (without removing process binary)"})
5858
pFaker := parser.Flag("f", "faker", &argparse.Options{Required: false, Help: "Spawn fake processes such as wireshark / procmon / procdump / x64dbg"})
5959
pNotifications := parser.Flag("n", "notifications", &argparse.Options{Required: false, Help: "Use Windows notifications when a file or memory stream match your YARA rules"})
6060
pVerbose := parser.Flag("v", "verbose", &argparse.Options{Required: false, Help: "Display every error and information messages"})
61-
pAggressive := parser.Flag("a", "aggressive", &argparse.Options{Required: false, Help: "Aggressive mode - remove suscpicious process executable / track and kill suspicious PPID / remove schedule task & regkey persistence"})
6261

6362
err = parser.Parse(os.Args)
6463
if err != nil {
@@ -102,12 +101,12 @@ func main() {
102101
if len(*pNetworkCapturePath) > 0 {
103102
go NetworkAnalysisRoutine(*pBpfFilter, *pNetworkCapturePath, *pVerbose)
104103
}
105-
go MemoryAnalysisRoutine(*pDump, *pQuarantine, *pKill, *pAggressive, *pNotifications, *pVerbose, rules)
106-
go RegistryAnalysisRoutine(*pQuarantine, *pKill, *pAggressive, *pNotifications, *pVerbose, rules)
107-
go StartMenuAnalysisRoutine(*pQuarantine, *pKill, *pAggressive, *pNotifications, *pVerbose, rules)
108-
go TaskSchedulerAnalysisRoutine(*pQuarantine, *pKill, *pAggressive, *pNotifications, *pVerbose, rules)
109-
go WindowsFileSystemAnalysisRoutine(*pQuarantine, *pKill, *pAggressive, *pNotifications, *pVerbose, rules)
110-
go UserFileSystemAnalysisRoutine(*pQuarantine, *pKill, *pAggressive, *pNotifications, *pVerbose, rules)
104+
go MemoryAnalysisRoutine(*pDump, *pQuarantine, *pKill, *pNotifications, *pVerbose, rules)
105+
go RegistryAnalysisRoutine(*pQuarantine, *pKill, *pNotifications, *pVerbose, rules)
106+
go StartMenuAnalysisRoutine(*pQuarantine, *pKill, *pNotifications, *pVerbose, rules)
107+
go TaskSchedulerAnalysisRoutine(*pQuarantine, *pKill, *pNotifications, *pVerbose, rules)
108+
go WindowsFileSystemAnalysisRoutine(*pQuarantine, *pKill, *pNotifications, *pVerbose, rules)
109+
go UserFileSystemAnalysisRoutine(*pQuarantine, *pKill, *pNotifications, *pVerbose, rules)
111110
<-exit
112111

113112
}

procsmemory.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type ProcessInformation struct {
2323
}
2424

2525
// MemoryAnalysisRoutine analyse processes memory every 5 seconds
26-
func MemoryAnalysisRoutine(pDump string, pQuarantine string, pKill bool, pAggressive bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
26+
func MemoryAnalysisRoutine(pDump string, pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
2727
for {
2828
// list process information and memory
2929
procs := ListProcess(pVerbose)
@@ -43,11 +43,11 @@ func MemoryAnalysisRoutine(pDump string, pQuarantine string, pKill bool, pAggres
4343
KillProcessByID(proc.PID, pVerbose)
4444
} else {
4545
// analyzing process memory and cleaning memory buffer
46-
MemoryAnalysis(&proc, pQuarantine, pKill, pAggressive, pNotifications, pVerbose, rules)
46+
MemoryAnalysis(&proc, pQuarantine, pKill, pNotifications, pVerbose, rules)
4747
proc.MemoryDump = nil
4848

4949
// analyzing process executable
50-
FileAnalysis(proc.ProcessPath, pQuarantine, pKill, pAggressive, pNotifications, pVerbose, rules, "MEMORY")
50+
FileAnalysis(proc.ProcessPath, pQuarantine, pKill, pNotifications, pVerbose, rules, "MEMORY")
5151
}
5252
}
5353

windowslnkparser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
// StartMenuAnalysisRoutine analyse system artefacts every 15 seconds
14-
func StartMenuAnalysisRoutine(pQuarantine string, pKill bool, pAggressive bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
14+
func StartMenuAnalysisRoutine(pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
1515
for {
1616
lnk, errors := ListStartMenuLnkPersistence(pVerbose)
1717
if errors != nil && pVerbose {
@@ -23,7 +23,7 @@ func StartMenuAnalysisRoutine(pQuarantine string, pKill bool, pAggressive bool,
2323
for _, l := range lnk {
2424
paths := FormatPathFromComplexString(l)
2525
for _, p := range paths {
26-
FileAnalysis(p, pQuarantine, pKill, pAggressive, pNotifications, pVerbose, rules, "STARTMENU")
26+
FileAnalysis(p, pQuarantine, pKill, pNotifications, pVerbose, rules, "STARTMENU")
2727
}
2828
}
2929

windowsregistry.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type RegistryValue struct {
1919
}
2020

2121
// RegistryAnalysisRoutine analyse registry persistence keys every 15 seconds
22-
func RegistryAnalysisRoutine(pQuarantine string, pKill bool, pAggressive bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
22+
func RegistryAnalysisRoutine(pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
2323
for {
2424
values, errors := EnumRegistryPeristence()
2525

@@ -32,7 +32,7 @@ func RegistryAnalysisRoutine(pQuarantine string, pKill bool, pAggressive bool, p
3232
for _, k := range values {
3333
paths := FormatPathFromComplexString(k.value)
3434
for _, p := range paths {
35-
FileAnalysis(p, pQuarantine, pKill, pAggressive, pNotifications, pVerbose, rules, "REGISTRY")
35+
FileAnalysis(p, pQuarantine, pKill, pNotifications, pVerbose, rules, "REGISTRY")
3636
}
3737
}
3838

windowstaskscheduler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var (
3636
var taskSchedulerInitialized bool = false
3737

3838
// TaskSchedulerAnalysisRoutine analyse Windows Task Scheduler executable every 15 seconds
39-
func TaskSchedulerAnalysisRoutine(pQuarantine string, pKill bool, pAggressive bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
39+
func TaskSchedulerAnalysisRoutine(pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
4040
for {
4141
defer UninitializeTaskScheduler()
4242
tasks, err := GetTasks()
@@ -48,7 +48,7 @@ func TaskSchedulerAnalysisRoutine(pQuarantine string, pKill bool, pAggressive bo
4848
for _, e := range t.ActionList {
4949
paths := FormatPathFromComplexString(e.Path)
5050
for _, p := range paths {
51-
FileAnalysis(p, pQuarantine, pKill, pAggressive, pNotifications, pVerbose, rules, "TASKS")
51+
FileAnalysis(p, pQuarantine, pKill, pNotifications, pVerbose, rules, "TASKS")
5252
}
5353
}
5454
}

0 commit comments

Comments
 (0)