Skip to content

Commit c9195ff

Browse files
committed
show encrypted / successeful pwd / attempted passwords
1 parent a30a751 commit c9195ff

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

cmd/view.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,22 @@ func printFileReport(file entity.File, webSvc webapi.Service) {
9090
if file.IsArchive {
9191
printKV("Archive", fmt.Sprintf("yes (%d files)", len(file.DerivedFiles)))
9292
}
93+
if file.Encrypted {
94+
printKV("Encrypted", "yes")
95+
if file.DecryptionSuccess != nil {
96+
if *file.DecryptionSuccess {
97+
printKV("Decryption", cleanStyle.Render("successful"))
98+
if file.SuccessfulPassword != "" {
99+
printKV("Password", file.SuccessfulPassword)
100+
}
101+
} else {
102+
printKV("Decryption", detectStyle.Render("failed"))
103+
if len(file.AttemptedPasswords) > 0 {
104+
printKV("Attempted", strings.Join(file.AttemptedPasswords, ", "))
105+
}
106+
}
107+
}
108+
}
93109
if file.ParentSHA256 != "" {
94110
printKV("Parent", file.ParentSHA256)
95111
}

internal/entity/file.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ type File struct {
3434
BehaviorReportID string `json:"behavior_report_id,omitempty"`
3535
Status int `json:"status,omitempty"`
3636
Classification string `json:"classification,omitempty"`
37-
IsArchive bool `json:"is_archive,omitempty"`
38-
DerivedFiles []DerivedFile `json:"derived_files,omitempty"`
39-
ParentSHA256 string `json:"parent_sha256,omitempty"`
37+
IsArchive bool `json:"is_archive,omitempty"`
38+
DerivedFiles []DerivedFile `json:"derived_files,omitempty"`
39+
ParentSHA256 string `json:"parent_sha256,omitempty"`
40+
Encrypted bool `json:"encrypted"`
41+
DecryptionSuccess *bool `json:"decryption_success,omitempty"`
42+
SuccessfulPassword string `json:"successful_password,omitempty"`
43+
AttemptedPasswords []string `json:"attempted_passwords,omitempty"`
4044
}
4145

4246
// DerivedFile is a child file produced during analysis of a parent — either a

0 commit comments

Comments
 (0)