Skip to content

Commit

Permalink
Merge pull request #334 from acollign/feature/add-exts
Browse files Browse the repository at this point in the history
add ear extensions to ease scanning
  • Loading branch information
freeqaz authored Dec 16, 2021
2 parents cf60212 + 2ce1498 commit fb5deb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions tools/log4shell/constants/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ const (
JarFileExt = ".jar"
WarFileExt = ".war"
ZipFileExt = ".zip"
EarFileExt = ".ear"
ClassFileExt = ".class"
)
4 changes: 2 additions & 2 deletions tools/log4shell/scan/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func scanFile(path string, file *zip.File, onlyScanArchives bool) (findings []ty
findings = []types.Finding{*finding}
}
return
case constants.JarFileExt, constants.WarFileExt, constants.ZipFileExt:
case constants.JarFileExt, constants.WarFileExt, constants.ZipFileExt, constants.EarFileExt:
if onlyScanArchives {
finding := scanArchiveFile(path, file)
if finding != nil {
Expand Down Expand Up @@ -186,7 +186,7 @@ func SearchDirsForVulnerableClassFiles(searchDirs []string, onlyScanArchives boo

fileExt := util.FileExt(path)
switch fileExt {
case constants.JarFileExt, constants.WarFileExt, constants.ZipFileExt:
case constants.JarFileExt, constants.WarFileExt, constants.ZipFileExt, constants.EarFileExt:
log.Debug().
Str("path", path).
Msg("scanning archive")
Expand Down

0 comments on commit fb5deb3

Please sign in to comment.