Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVE bin tool integration, VEX support -> F20 replacement #1452

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f53521a
cve-bin-tool setup
m-1-k-3 Jan 29, 2025
9b0ecda
bump docker base image
m-1-k-3 Jan 29, 2025
367e40e
fix installer
m-1-k-3 Feb 2, 2025
7548921
f17 testmodule
m-1-k-3 Feb 4, 2025
7a162f4
shellcheck
m-1-k-3 Feb 4, 2025
01f95bf
permissions, little fixes
m-1-k-3 Feb 4, 2025
df38857
spaces
m-1-k-3 Feb 4, 2025
755d282
cleanup
m-1-k-3 Feb 4, 2025
827b757
remove var
m-1-k-3 Feb 4, 2025
c8f31e6
dep checking
m-1-k-3 Feb 4, 2025
fc57436
spaces
m-1-k-3 Feb 4, 2025
e22564b
duplicate handling
m-1-k-3 Feb 4, 2025
48dde14
add vex profile
m-1-k-3 Feb 4, 2025
e7bac73
output
m-1-k-3 Feb 4, 2025
b01ae92
fix emulation results
m-1-k-3 Feb 5, 2025
afa6e72
further adjustments
m-1-k-3 Feb 5, 2025
c1d07a8
little cleanup
m-1-k-3 Feb 5, 2025
5446c81
var declaration
m-1-k-3 Feb 5, 2025
e3d16d0
f17
m-1-k-3 Feb 5, 2025
efc5123
adjust report templates
m-1-k-3 Feb 5, 2025
4206a92
adjust blacklists
m-1-k-3 Feb 5, 2025
be474f5
Exploit counting
m-1-k-3 Feb 5, 2025
cd5db05
s26 improvements
m-1-k-3 Feb 6, 2025
96d37b0
make s118 compatible to f17
m-1-k-3 Feb 6, 2025
6e991b6
cleanup
m-1-k-3 Feb 6, 2025
82c5cb0
make s118 integrated into f17
m-1-k-3 Feb 7, 2025
02e5c06
shellchecker
m-1-k-3 Feb 7, 2025
cdfaef8
make s118 integration work
m-1-k-3 Feb 8, 2025
96b8483
upload workflows
m-1-k-3 Feb 8, 2025
1a0bdff
make s26 work again
m-1-k-3 Feb 9, 2025
f2093e3
cleanup
m-1-k-3 Feb 9, 2025
c52c4d0
integrate vex into sbom
m-1-k-3 Feb 11, 2025
96b1937
shellcheck
m-1-k-3 Feb 11, 2025
d5714e9
adjust sbom
m-1-k-3 Feb 11, 2025
b9312ca
make it valid again2
m-1-k-3 Feb 11, 2025
fcf61f2
fix version
m-1-k-3 Feb 11, 2025
3f0f904
cleanup
m-1-k-3 Feb 11, 2025
5116dbf
adjust sbom profiles
m-1-k-3 Feb 11, 2025
d45ae37
preprocssing in thread
m-1-k-3 Feb 11, 2025
a550fc2
profile adjustments
m-1-k-3 Feb 11, 2025
a7958aa
profile adjustments
m-1-k-3 Feb 11, 2025
eb6dc81
profile adjustments
m-1-k-3 Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,3 @@ write_link "https://security.snyk.io/vuln"
print_output "$(indent "${ORANGE}X${NC} - Vulnerability is known as exploited")"
write_link "https://www.cisa.gov/known-exploited-vulnerabilities-catalog"
print_output "$(indent "${ORANGE}V${NC} - Vulnerability verified - Kernel or BusyBox (S26, S118)")"

print_ln
print_ln
print_output "[*] Source notes:"
print_output "$(indent "${ORANGE}STAT${NC} - Details found by static modules (S06, S09, S24, S25)")"
print_output "$(indent "${ORANGE}PACK${NC} - Details found by package management environment (S08)")"
print_output "$(indent "${ORANGE}UEMU${NC} - Details found by dynamic user-mode emulation modules (S115, S116)")"
print_output "$(indent "${ORANGE}SEMU${NC} - Details found by dynamic system emulation modules (L*)")"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

print_output "This module aggregates all found version numbers together from S06, S08, S09, S24, S25 and S115 and searches with cve-search for known vulnerabilities."
print_output "Additionally, the identified CVE details are matched with public exploit databases."
print_output "This module aggregates all found version numbers together from S06, S08, S09, S24, S25 and S115 and searches with cve-bin-tool for known vulnerabilities."
print_output "Additionally, the identified CVE details are matched with EPSS, public exploit databases and a VEX json is generated."
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
services:
# nosemgrep
emba:
image: embeddedanalyzer/emba:1.5.1b
image: embeddedanalyzer/emba:1.5.1d
container_name: emba
read_only: true
read_only: false
# all pre-checker mount modules need privileged mode
# nosemgrep
privileged: true
Expand Down Expand Up @@ -51,7 +51,7 @@ services:
soft: 0

emba_quest:
image: embeddedanalyzer/emba:1.5.1b
image: embeddedanalyzer/emba:1.5.1d
container_name: emba_quest
read_only: true
tmpfs:
Expand Down
2 changes: 2 additions & 0 deletions helpers/helpers_emba_defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ set_defaults() {
if [[ -f "${CONFIG_DIR}"/msf_cve-db.txt ]]; then
export MSF_DB_PATH="${CONFIG_DIR}"/msf_cve-db.txt
fi
export MSF_INSTALL_PATH="/usr/share/metasploit-framework"
if [[ -f "${CONFIG_DIR}"/trickest_cve-db.txt ]]; then
export TRICKEST_DB_PATH="${CONFIG_DIR}"/trickest_cve-db.txt
fi
Expand Down Expand Up @@ -251,5 +252,6 @@ set_log_paths() {
export F20_EXPLOITS_LOG="${F20_LOG_DIR}/exploits-overview.txt"
export F15_LOG="${LOG_DIR}/f15_cyclonedx_sbom.txt"
export F15_CSV_LOG="${CSV_DIR}/f15_cyclonedx_sbom.csv"
export F17_LOG_DIR="${LOG_DIR}/f17_cve_bin_tool"
export F50_CSV_LOG="${CSV_DIR}/f50_base_aggregator.csv"
}
11 changes: 11 additions & 0 deletions helpers/helpers_emba_dependency_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ check_docker_version() {
fi
}

preparing_cve_bin_tool() {
print_output " Preparing cve-bin-tool ..." "no_log"
mkdir "${HOME}"/.cache/cve-bin-tool
cp -pri /external/cve-bin-tool/cache_cve-bin-tool/* "${HOME}"/.cache/cve-bin-tool/
}

dependency_check()
{
module_title "Dependency check" "no_log"
Expand Down Expand Up @@ -688,6 +694,11 @@ dependency_check()
# CVE searchsploit
check_dep_tool "CVE Searchsploit" "cve_searchsploit"

check_dep_file "cve-bin-tool" "${EXT_DIR}""/cve-bin-tool/cve_bin_tool/cli.py"
preparing_cve_bin_tool &
local lTMP_PID="$!"
store_kill_pids "${lTMP_PID}"

check_dep_file "Routersploit EDB database" "${CONFIG_DIR}""/routersploit_exploit-db.txt"
check_dep_file "Routersploit CVE database" "${CONFIG_DIR}""/routersploit_cve-db.txt"
check_dep_file "Metasploit CVE database" "${CONFIG_DIR}""/msf_cve-db.txt"
Expand Down
2 changes: 1 addition & 1 deletion helpers/helpers_emba_print.sh
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ secure_sleep() {
sleep 10
lCUR_SLEEP_TIME=$((lCUR_SLEEP_TIME + 10))
if check_emba_ended; then
return
exit
fi
done
}
Expand Down
2 changes: 2 additions & 0 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ if [[ "${CVE_SEARCH}" -ne 1 ]] || [[ "${DOCKER_SETUP}" -ne 1 ]] || [[ "${IN_DOCK

IL15_emulated_checks_init

IF17_cve_bin_tool

IF50_aggregator_common
fi

Expand Down
52 changes: 52 additions & 0 deletions installer/IF17_cve_bin_tool.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

# EMBA - EMBEDDED LINUX ANALYZER
#
# Copyright 2025-2025 Siemens Energy AG
#
# EMBA comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
# welcome to redistribute it under the terms of the GNU General Public License.
# See LICENSE file for usage of this software.
#
# EMBA is licensed under GPLv3
#
# Author(s): Michael Messner

# Description: Installs cve-bin-tool including database for offline work

IF17_cve_bin_tool() {
module_title "${FUNCNAME[0]}"

if [[ "${LIST_DEP}" -eq 1 ]] || [[ "${IN_DOCKER}" -eq 1 ]] || [[ "${DOCKER_SETUP}" -eq 0 ]] || [[ "${FULL}" -eq 1 ]]; then

INSTALL_APP_LIST=()

if [[ "${LIST_DEP}" -eq 1 ]] || [[ "${IN_DOCKER}" -eq 1 ]] || [[ "${DOCKER_SETUP}" -eq 0 ]] ; then
print_tool_info "gsutil"
# print_pip_info "cve_bin_tool"
print_git_info "cve-bin-tool" "https://github.com/EMBA-support-repos/cve-bin-tool.git" "cve-bin-tool"
fi

if [[ "${LIST_DEP}" -eq 1 ]] || [[ "${DOCKER_SETUP}" -eq 1 ]] ; then
ANSWER=("n")
else
echo -e "\\n""${MAGENTA}""${BOLD}"" cve-bin-tool will be downloaded (if not already on the system)!""${NC}"
fi

case ${ANSWER:0:1} in
y|Y )
apt-get install "${INSTALL_APP_LIST[@]}" -y --no-install-recommends

# radare2
echo -e "${ORANGE}""${BOLD}""Install cve-bin-tool""${NC}"
git clone https://github.com/EMBA-support-repos/cve-bin-tool.git external/cve-bin-tool
cd external/cve-bin-tool || ( echo "Could not install EMBA component cve-bin-tool" && exit 1 )
pip install -U -r requirements.txt
python3 -m pip install -e .
cd "${HOME_PATH}" || ( echo "Could not install EMBA component cve-bin-tool" && exit 1 )
python3 external/cve-bin-tool/cve_bin_tool/cli.py --update now || true
cp -pr "${HOME}"/.cache/cve-bin-tool ./external/cve-bin-tool/cache_cve-bin-tool
;;
esac
fi
}
2 changes: 1 addition & 1 deletion modules/F15_cyclonedx_sbom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ F15_cyclonedx_sbom() {
mapfile -t lCOMP_FILES_ARR < <(find "${SBOM_LOG_PATH}" -maxdepth 1 -type f -name "*.json" -not -name "unhandled_file_*" | sort -u)
if [[ "${SBOM_UNTRACKED_FILES}" -gt 0 ]]; then
mapfile -t lCOMP_FILES_ARR_UNHANDLED < <(find "${SBOM_LOG_PATH}" -maxdepth 1 -type f -name "unhandled_file_*.json" | sort -u)
lCOMP_FILES_ARR+=("${lCOMP_FILES_ARR_UNHANDLED[@]}")
lCOMP_FILES_ARR+=("${lCOMP_FILES_ARR_UNHANDLED[@]}")
fi

# as we can have so many components that everything goes b00m we need to build the
Expand Down
Loading
Loading