Skip to content

Commit 6062ae0

Browse files
authored
Merge pull request e-m-b-a#930 from m-1-k-3/master
Multiple fixes
2 parents 14c960f + 11a35e5 commit 6062ae0

17 files changed

+192
-78
lines changed

docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ services:
2121
- /root/.ghidra/
2222
- /root/.routersploit/
2323
- /root/.msf4
24+
- /root/.john
2425
- /run/lock
2526
- /var/run
2627
- /var/tmp

helpers/helpers_emba_defaults.sh

+1
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,5 @@ set_defaults() {
131131
export TOTAL_MEMORY=0
132132
TOTAL_MEMORY="$(grep MemTotal /proc/meminfo | awk '{print $2}' || true)"
133133
export Q_MOD_PID=""
134+
export F20_DEEP=1 # F20 module - set to cve-discovery caller for further processing
134135
}

helpers/helpers_emba_dependency_check.sh

+20-12
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ check_git_hash(){
129129
check_docker_image(){
130130
local LOCAL_DOCKER_HASH=""
131131
local REMOTE_DOCKER_HASH=""
132-
LOCAL_DOCKER_HASH="$(sudo docker image inspect embeddedanalyzer/emba:latest --format '{{json .RepoDigests}}' | jq . | grep "sha" | sed -E 's/.*sha256:([0-9|[a-z]+)"/\1/' || true)"
133-
REMOTE_DOCKER_HASH="$(sudo docker manifest inspect embeddedanalyzer/emba:latest -v | jq . | grep "digest" | head -n1 | awk '{print $2}' | sed -E 's/"sha256:(.+)",/\1/' || true)"
132+
LOCAL_DOCKER_HASH="$(docker image inspect embeddedanalyzer/emba:latest --format '{{json .RepoDigests}}' | jq . | grep "sha" | sed -E 's/.*sha256:([0-9|[a-z]+)"/\1/' || true)"
133+
REMOTE_DOCKER_HASH="$(docker manifest inspect embeddedanalyzer/emba:latest -v | jq . | grep "digest" | head -n1 | awk '{print $2}' | sed -E 's/"sha256:(.+)",/\1/' || true)"
134134

135135
if [[ "${LOCAL_DOCKER_HASH}" == "${REMOTE_DOCKER_HASH}" ]]; then
136136
echo -e " Docker image version - ${GREEN}ok${NC}"
@@ -154,22 +154,26 @@ dependency_check()
154154
if [[ "${CONTAINER_NUMBER}" -ne 1 ]]; then
155155
print_output " Internet connection - \\c" "no_log"
156156

157-
if [[ -n "${PROXY_SETTINGS}" ]]; then
158-
export http_proxy="${PROXY_SETTINGS}"
159-
export https_proxy="${PROXY_SETTINGS}"
160-
print_output "[*] Info: Proxy settings detected: ${ORANGE}${PROXY_SETTINGS}${NC}" "no_log"
161-
fi
162-
163157
LATEST_EMBA_VERSION="$(curl --connect-timeout 5 -s -o - https://github.com/e-m-b-a/emba/blob/master/config/VERSION.txt | grep -w "rawLines" | sed -E 's/.*"rawLines":\["([0-9]\.[0-9]\.[0-9]).*/\1/' || true)"
164158
if [[ -z "${LATEST_EMBA_VERSION}" ]] ; then
165159
echo -e "${RED}""not ok""${NC}"
166160
print_output "[-] Warning: Quest container has no internet connection!" "no_log"
167161
else
168162
echo -e "${GREEN}""ok""${NC}"
169-
check_emba_version "${LATEST_EMBA_VERSION}"
170-
check_docker_image
171-
check_git_hash
163+
# ensure this only runs on the host and not in any container
164+
if [[ "${IN_DOCKER}" -eq 0 ]]; then
165+
check_emba_version "${LATEST_EMBA_VERSION}"
166+
check_docker_image
167+
check_git_hash
168+
fi
172169
fi
170+
171+
if [[ -n "${PROXY_SETTINGS}" ]]; then
172+
export http_proxy="${PROXY_SETTINGS}"
173+
export https_proxy="${PROXY_SETTINGS}"
174+
print_output "[*] Info: Proxy settings detected: ${ORANGE}${PROXY_SETTINGS}${NC}" "no_log"
175+
fi
176+
173177
if [[ -f "${CONFIG_DIR}/gpt_config.env" ]]; then
174178
if grep -v -q "#" "${CONFIG_DIR}/gpt_config.env"; then
175179
# readin gpt_config.env
@@ -517,7 +521,11 @@ dependency_check()
517521
check_dep_file "Binarly FwHunt analyzer" "${EXT_DIR}""/fwhunt-scan/fwhunt_scan_analyzer.py"
518522

519523
if function_exists F20_vul_aggregator; then
520-
check_dep_file "NVD CVE database" "${EXT_DIR}""/nvd-json-data-feeds/README.md"
524+
# ensure this check is not running as github action:
525+
# "${CONFIG_DIR}"/gh_action is created from the installer
526+
if ! [[ -f "${CONFIG_DIR}"/gh_action ]]; then
527+
check_dep_file "NVD CVE database" "${EXT_DIR}""/nvd-json-data-feeds/README.md"
528+
fi
521529
# CVE searchsploit
522530
check_dep_tool "CVE Searchsploit" "cve_searchsploit"
523531

helpers/helpers_emba_helpers.sh

+6
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ cleaner() {
178178
done < "${TMP_DIR}"/EXIT_KILL_PIDS.log
179179
fi
180180

181+
if [[ -f "${LOG_DIR}"/emba_error.log ]]; then
182+
if ! [[ -s "${LOG_DIR}"/emba_error.log ]]; then
183+
rm "${LOG_DIR}"/emba_error.log > /dev/null || true
184+
fi
185+
fi
186+
181187
if [[ "${IN_DOCKER}" -eq 0 ]] && [[ -d "${TMP_DIR}" ]]; then
182188
rm -r "${TMP_DIR}" 2>/dev/null || true
183189
fi

installer.sh

-5
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,7 @@ chmod 755 ./external
361361

362362
if [[ "${LIST_DEP}" -eq 0 ]] || [[ ${IN_DOCKER} -eq 0 ]] || [[ ${DOCKER_SETUP} -eq 1 ]] || [[ ${FULL} -eq 1 ]]; then
363363
echo -e "\\n""${MAGENTA}""${BOLD}""Installation notes:""${NC}"
364-
echo -e "\\n""${MAGENTA}""INFO: The cron.daily update script for EMBA is located in config/emba_updater""${NC}"
365-
echo -e "${MAGENTA}""INFO: For automatic updates it should be copied to /etc/cron.daily/""${NC}"
366-
echo -e "${MAGENTA}""INFO: For manual updates just start it via sudo ./config/emba_updater""${NC}"
367-
368364
echo -e "\\n""${MAGENTA}""WARNING: If you plan using the emulator (-E switch) your host and your internal network needs to be protected.""${NC}"
369-
370365
echo -e "\\n""${MAGENTA}""INFO: Do not forget to checkout current development of EMBA at https://github.com/e-m-b-a.""${NC}"
371366
fi
372367
if [[ "${WSL}" -eq 1 ]]; then

installer/IF20_nvd_feed.sh

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ IF20_nvd_feed() {
3737
echo -e "\\n""${MAGENTA}""Check if the NVD JSON data feed is already installed and populated.""${NC}"
3838
if [[ "${GH_ACTION}" -eq 1 ]]; then
3939
echo "[*] Github action - not installing NVD database"
40+
echo "GH_action:true" > ./config/gh_action || true
4041
return
4142
fi
4243
if [[ -d external/nvd-json-data-feeds ]]; then

0 commit comments

Comments
 (0)