Skip to content

Commit

Permalink
Merge pull request #340 from m-1-k-3/distri_id
Browse files Browse the repository at this point in the history
Little fixes (S06, S03, S109)
  • Loading branch information
m-1-k-3 authored Oct 9, 2022
2 parents e7d0615 + 850ef1f commit c8a67a8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/distri_id.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ OpenWRT;/etc/banner;grep -a -o -E "BACKFIRE.\(bleeding.edge..r[0-9]+\)";sort -u
# Reboot (17.01.0-rc2, r3131-42f3c1f) -> LEDE
OpenWRT;/etc/openwrt_release;grep -a -o -E -e "^DISTRIB_ID=.*" -a -o -E -e "^DISTRIB_RELEASE=.*[0-9].*" -a -o -E -e "^DISTRIB_REVISION=.*";sort -u | tr '\n' ' ' | sed 's/DISTRIB_ID=//g' | sed 's/DISTRIB_RELEASE=//g' | sed 's/DISTRIB_REVISION=//g' | tr -d \' | tr -d \"
OpenWRT;/etc/openwrt_version;grep -E -e "[0-9]+\.[0-9]+";sed -e 's/^/OpenWrt\ /g'
buildroot;/etc/os-release;grep -a -o -E -e "^NAME=.*" -a -o -E -e "^VERSION_ID=.*";sort -u | tr '\n' ' ' | sed 's/NAME=//g' | sed 's/VERSION_ID=//g' | tr -d \" | grep -i "Buildroot [0-9]"
buildroot;/etc/os-release;grep -a -o -E -e "^NAME=.*" -a -o -E -e "^VERSION_ID=[0-9].*";sort -u | tr '\n' ' ' | sed 's/NAME=//g' | sed 's/VERSION_ID=//g' | tr -d \"
os-release-Linux;/etc/os-release;grep -a -o -E -e "^NAME=.*" -a -o -E -e "^VERSION=.*";sort -u | tr '\n' ' ' | sed 's/NAME=//g' | sed 's/VERSION=//g' | tr -d \"
lsb-release-Linux;/etc/lsb-release;grep -a -o -E -e "^DISTRIB_ID=.*" -a -o -E -e "^DISTRIB_RELEASE=.*";sort -u | tr '\n' ' ' | sed 's/DISTRIB_ID=//g' | sed 's/DISTRIB_RELEASE=//g' | tr -d \"
#debian-Linux;/etc/debian-version;-a -o -E -e ".*";sort -u
Expand Down
3 changes: 3 additions & 0 deletions installer/IF20_cve_search.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ IF20_cve_search() {
apt-get update -y
print_tool_info "mongodb-org" 1
apt-get install mongodb-org -y
if ! [[ -f /etc/mongod.conf ]]; then
echo "Could not install EMBA component mongod - missing mongod.conf file" && exit 1
fi
sed -i 's/bindIp\:\ 127.0.0.1/bindIp\:\ 172.36.0.1/g' /etc/mongod.conf

if [[ "$WSL" -eq 0 ]]; then
Expand Down
1 change: 1 addition & 0 deletions modules/S03_firmware_bin_base_analyzer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ os_detection_thread_per_os() {
local OS="${1:-}"
local DETECTED=0
local OS_=""
local OS_COUNTER_VxWorks=0

OS_COUNTER[$OS]=0
OS_COUNTER[$OS]=$(("${OS_COUNTER[$OS]}"+"$(find "$OUTPUT_DIR" -xdev -type f -exec strings {} \; | grep -i -c "$OS" 2> /dev/null || true)"))
Expand Down
2 changes: 2 additions & 0 deletions modules/S06_distribution_identification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ S06_distribution_identification()
SED_COMMAND="$(echo "$CONFIG" | cut -d\; -f4)"
FILE_QUOTED=$(escape_echo "$FILE")
OUT1="$(eval "$PATTERN" "$FILE_QUOTED" || true)"
# echo "PATTERN: $PATTERN"
# echo "SED command: $SED_COMMAND"
# echo "identified: $OUT1"
# echo "FILE: $FILE_QUOTED"
IDENTIFIER=$(echo -e "$OUT1" | eval "$SED_COMMAND" | sed 's/ \+/ /g' | sed 's/ $//' || true)

if [[ $(basename "$FILE") == "image_sign" ]]; then
Expand Down
15 changes: 7 additions & 8 deletions modules/S109_jtr_local_pw_cracking.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ S109_jtr_local_pw_cracking()
print_output "[*] Found password data $ORANGE$HASH$NC for further processing in $ORANGE$HASH_SOURCE$NC"
echo "$HASH" >> "$LOG_PATH_MODULE"/jtr_hashes.txt
fi

done

if [[ -f "$LOG_PATH_MODULE"/jtr_hashes.txt ]]; then
Expand All @@ -80,14 +79,14 @@ S109_jtr_local_pw_cracking()
timeout --preserve-status --signal SIGINT "$JTR_TIMEOUT" john --progress-every=120 "$LOG_PATH_MODULE"/jtr_hashes.txt | tee -a "$LOG_FILE" || true
print_ln
NEG_LOG=1
fi

mapfile -t CRACKED_HASHES < <(john --show "$LOG_PATH_MODULE"/jtr_hashes.txt | grep -v "password hash\(es\)\? cracked" | grep -v "^$" || true)
JTR_FINAL_STAT=$(john --show "$LOG_PATH_MODULE"/jtr_hashes.txt | grep "password hash\(es\)\? cracked\|No password hashes loaded" || true)
CRACKED=$(echo "$JTR_FINAL_STAT" | awk '{print $1}')
if [[ -n "$JTR_FINAL_STAT" ]]; then
print_output "[*] John the ripper final status: $ORANGE$JTR_FINAL_STAT$NC"
NEG_LOG=1
mapfile -t CRACKED_HASHES < <(john --show "$LOG_PATH_MODULE"/jtr_hashes.txt | grep -v "password hash\(es\)\? cracked" | grep -v "^$" || true)
JTR_FINAL_STAT=$(john --show "$LOG_PATH_MODULE"/jtr_hashes.txt | grep "password hash\(es\)\? cracked\|No password hashes loaded" || true)
CRACKED=$(echo "$JTR_FINAL_STAT" | awk '{print $1}')
if [[ -n "$JTR_FINAL_STAT" ]]; then
print_output "[*] John the ripper final status: $ORANGE$JTR_FINAL_STAT$NC"
NEG_LOG=1
fi
fi

if [[ "$CRACKED" -gt 0 ]]; then
Expand Down

0 comments on commit c8a67a8

Please sign in to comment.