Skip to content

Commit

Permalink
Merge pull request e-m-b-a#1004 from HoxhaEndri/master
Browse files Browse the repository at this point in the history
identifying BMC AST2400
  • Loading branch information
m-1-k-3 authored Feb 26, 2024
2 parents a975035 + ea26b4d commit b473f6a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/distri_id.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# "KAMIKAZE (bleeding edge, r18571) ------------------"
OpenWRT;/etc/banner;grep -a -o -E "KAMIKAZE.\(bleeding.edge..r[0-9]+\)";sort -u | sed -r 's/(KAMIKAZE) \(bleeding edge, (r[0-9]+)\)/OpenWRT \1 \2/'
OpenWRT;/etc/banner;grep -a -o -E "BACKFIRE.\(bleeding.edge..r[0-9]+\)";sort -u | sed -r 's/(BACKFIRE) \(bleeding edge, (r[0-9]+)\)/OpenWRT \1 \2/'
supermicrox11-bmc;/sbin/net-snmp-config; grep -E "x11.*AST2400.*arm-linux.*PLATFORM_SUPERMICRO"; sed -r 's/.*/supermicro:bmc/' | head -1
# 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'
Expand Down
11 changes: 11 additions & 0 deletions modules/L10_system_emulation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ L10_system_emulation() {

if [[ "${ARCH}" == "MIPS"* || "${ARCH}" == "ARM"* || "${ARCH}" == "x86" ]]; then

check_bmc_supermicro

# WARNING: false was never tested ;)
# Could be interesting for future extensions
set_firmae_arbitration "true"
Expand Down Expand Up @@ -208,6 +210,15 @@ L10_system_emulation() {
module_end_log "${FUNCNAME[0]}" "${MODULE_END}"
}

check_bmc_supermicro(){
local S06_LOG="${CSV_DIR}/s06_distribution_identification.csv"
if [[ -f "${S06_LOG}" ]]; then
if grep "supermicro:bmc" "${S06_LOG}"; then
print_output "[-] WARNING: Supermicro firmware found - Specifice qemu emulation not supported"
fi
fi
}

print_system_emulation_results() {
if [[ -f "${LOG_DIR}"/emulator_online_results.log ]]; then
sub_module_title "System emulation results"
Expand Down
6 changes: 6 additions & 0 deletions modules/S06_distribution_identification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ S06_distribution_identification()
dlink_image_sign
fi

if [[ "${IDENTIFIER}" != *[0-9]* ]] && [[ "${IDENTIFIER}" == *"supermicro:bmc"* ]]; then
print_output "[+] Version information found ${ORANGE}${IDENTIFIER}${GREEN} in file ${ORANGE}$(print_path "${FILE}")${GREEN} with Linux distribution detection"
get_csv_rule_distri "${IDENTIFIER}"
write_csv_log "${FILE}" "Linux" "${IDENTIFIER}" "${CSV_RULE}"
fi

# check if not zero and not only spaces
if [[ -n "${IDENTIFIER// }" ]] && [[ "${IDENTIFIER}" == *[0-9]* ]]; then
if [[ -n "${DLINK_FW_VER}" ]]; then
Expand Down

0 comments on commit b473f6a

Please sign in to comment.