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

Routersploit state fix #322

Merged
merged 2 commits into from
Sep 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions modules/L10_system_emulation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -423,19 +423,22 @@ main_emulation() {
get_networking_details_emulation "$IMAGE_NAME"

print_output "[*] Firmware $ORANGE$IMAGE_NAME$NC finished for identification of the network configuration"

local F_STARTUP=0
if [[ -f "$LOG_PATH_MODULE"/qemu.initial.serial.log ]]; then
cat "$LOG_PATH_MODULE"/qemu.initial.serial.log >> "$LOG_PATH_MODULE"/qemu.initial.serial_"$IMAGE_NAME".log
write_link "$LOG_PATH_MODULE"/qemu.initial.serial_"$IMAGE_NAME".log

###############################################################################################
# if we were running into issues with the network identification we poke with rdinit vs init:
# lets check if we have found a startup procedure (preInit script) from FirmAE - if not we try it with the other init
F_STARTUP=$(grep -a -c "EMBA preInit script starting" "$LOG_PATH_MODULE"/qemu.initial.serial.log || true)
F_STARTUP=$(( "$F_STARTUP" + "$(grep -a -c "Network configuration - ACTION" "$LOG_PATH_MODULE"/qemu.initial.serial.log || true)" ))
else
print_output "[-] No Qemu log file generated ... some weird error occured"
fi
print_ln

###############################################################################################
# if we were running into issues with the network identification we poke with rdinit vs init:
# lets check if we have found a startup procedure (preInit script) from FirmAE - if not we try it with the other init
F_STARTUP=$(grep -a -c "EMBA preInit script starting" "$LOG_PATH_MODULE"/qemu.initial.serial.log || true)
F_STARTUP=$(( "$F_STARTUP" + "$(grep -a -c "Network configuration - ACTION" "$LOG_PATH_MODULE"/qemu.initial.serial.log || true)" ))

if [[ "${#PANICS[@]}" -gt 0 ]] || [[ "$F_STARTUP" -eq 0 ]]; then
# if we are running into a kernel panic during the network detection we are going to check if the
Expand Down
5 changes: 4 additions & 1 deletion modules/L30_routersploit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ check_live_routersploit() {

cat "$LOG_PATH_MODULE"/routersploit-"$IP_ADDRESS_".txt >> "$LOG_FILE"
print_ln
if grep -q "Target is vulnerable" "$LOG_PATH_MODULE"/routersploit-"$IP_ADDRESS_".txt; then
print_output "[+] Found the following vulnerabilities:"
grep -B 1 "Target is vulnerable" "$LOG_PATH_MODULE"/routersploit-"$IP_ADDRESS_".txt | tee -a "$LOG_FILE"
fi
if grep -q "Target seems to be vulnerable" "$LOG_PATH_MODULE"/routersploit-"$IP_ADDRESS_".txt; then
print_output "[+] Found the following possible vulnerabilities:"
grep -B 1 "Target seems to be vulnerable" "$LOG_PATH_MODULE"/routersploit-"$IP_ADDRESS_".txt | tee -a "$LOG_FILE"
#ROUTERSPLOIT_VULNS=$(grep -c "Target seems to be vulnerable" "$LOG_PATH_MODULE"/routersploit-"$IP_ADDRESS_".txt)
fi
print_output "[*] Routersploit tests for emulated system with IP $ORANGE$IP_ADDRESS_$NC finished"
}
Expand Down