본문으로 건너뛰기
Skillpedia
보안6.5k · #14099

hardcoded-creds

하는 일

이 가이드는 장치 펌웨어 안에 내장된 비밀번호, 키, 기본 계정을 찾는 방법을 다룹니다. 출하 전에 이를 제거하거나 제거되었는지 확인하려는 제품 보안 팀을 위한 것입니다.

사용하는 경우

  • ✓제품 팀이 자사 펌웨어를 풀어 내장된 비밀번호를 찾고 싶을 때.
  • ✓장치에 바꾸지 않은 기본 관리자 계정이 있을 수 있는 경우.
  • ✓인증서나 클라우드 키가 장치 이미지 안에 평문으로 저장되어 있을 수 있을 때.

스킬 링크

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/iot/hardcoded-creds/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/iot/hardcoded-creds/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“추출한 펌웨어에서 내장 비밀번호, 기본 계정, 고객에게 있으면 안 되는 내장 키를 찾아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 추출된 파일 시스템의 계정 파일, 설정 파일, 문자열을 확인하고, 찾은 자격 증명을 보고하며 제거를 권장합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Hardcoded Credentials

Extracted rootfs often contains plaintext or weakly hashed credentials, embedded TLS private keys, cloud API tokens, and hardcoded admin accounts. This playbook covers the full triage path from raw rootfs to validated cred.

Prerequisites

  • Extracted rootfs from binwalk-extract skill (path: /tmp/squashfs_root or similar).
  • Tools: john, hashcat, openssl, trufflehog, strings, standard GNU utilities.
ROOT=/tmp/squashfs_root   # set once; referenced throughout

Phase 1 — Account Databases

/etc/passwd + /etc/shadow

# Check for non-standard shells (telnetd, /bin/sh) and disabled-but-present accounts
grep -v "nologin\|false" "$ROOT/etc/passwd"

# Extract hashed passwords
cat "$ROOT/etc/shadow" 2>/dev/null || echo "shadow not present"

# Identify hash types
# $1$ = MD5, $5$ = SHA-256, $6$ = SHA-512, $y$ = yescrypt, no-$ = DES
awk -F: '{print $1, $2}' "$ROOT/etc/shadow" | grep -v '^\*\|^!\|^:$'

# Crack with hashcat (shadow format)
hashcat -m 1800 "$ROOT/etc/shadow" /usr/share/wordlists/rockyou.txt   # $6$ SHA-512
hashcat -m 500  "$ROOT/etc/shadow" /usr/share/wordlists/rockyou.txt   # $1$ MD5
hashcat -m 1500 "$ROOT/etc/shadow" /usr/share/wordlists/rockyou.txt   # DES

# john fallback (handles multi-type auto)
unshadow "$ROOT/etc/passwd" "$ROOT/etc/shadow" > /tmp/unshadowed.txt
john /tmp/unshadowed.txt --wordlist=/usr/share/wordlists/rockyou.txt
john /tmp/unshadowed.txt --show

BusyBox-specific user configs

# BusyBox httpd uses /etc/httpd.conf for auth
find "$ROOT/etc" -name "httpd.conf" -o -name ".htpasswd" | xargs cat 2>/dev/null

# BusyBox udhcpd / telnetd startup stanzas
grep -r "telnetd\|login\|password" "$ROOT/etc/inittab" "$ROOT/etc/init.d/" \
    "$ROOT/etc/rc.d/" 2>/dev/null | grep -v "^Binary"

# BusyBox shadow format check (some use MD5 without $1$ prefix)
grep -E '^[^:]+:[^:!*]{3,}' "$ROOT/etc/shadow" 2>/dev/null

Phase 2 — SSH / Dropbear Keys

# Host keys (baked into firmware = same key across all units of same model)
find "$ROOT" -name "dropbear_*_host_key" -o -name "ssh_host_*_key" 2>/dev/null

# Convert Dropbear key to OpenSSH PEM for use
dropbearconvert dropbear openssh "$ROOT/etc/dropbear/dropbear_rsa_host_key" \
    /tmp/host_rsa.pem
openssl rsa -in /tmp/host_rsa.pem -text -noout | head -20

# Authorized keys embedded for backdoor accounts
find "$ROOT" -path "*/.ssh/authorized_keys" | xargs cat 2>/dev/null

# Check if root has a passwordless authorized_key → instant SSH root on any unit
grep -r "authorized_keys\|ssh-rsa\|ecdsa-sha2" "$ROOT" 2>/dev/null | head -10

Phase 3 — Web Interface Credentials

# CGI / Lua / PHP / lighttpd configs
find "$ROOT" -name "*.lua" -o -name "*.cgi" -o -name "*.php" | \
    xargs grep -l "password\|passwd\|credential\|secret\|admin" 2>/dev/null | head -20

# Plaintext credentials in web config files
grep -rn "admin\|password\|passwd\|secret\|token" \
    "$ROOT/etc/lighttpd/" "$ROOT/etc/nginx/" "$ROOT/etc/httpd/" 2>/dev/null

# Hardcoded credentials in Lua/CGI scripts
grep -rn '"admin"\|"root"\|"1234"\|"password"' "$ROOT/usr/lib/lua/" \
    "$ROOT/www/" "$ROOT/usr/share/www/" 2>/dev/null | head -30

Phase 4 — Strings-Based Secret Sweep

# Broad strings dump: capture all printable sequences ≥ 8 chars
find "$ROOT" -type f -executable | while read f; do
    strings "$f" 2>/dev/null
done > /tmp/all_strings.txt

# Filter credential-like patterns
grep -iE 'password|passwd|secret|api.?key|token|credential|auth' /tmp/all_strings.txt \
    | grep -vE '^(#|//|<!|<html|<head)' | sort -u | head -100

# AWS / GCP / Azure key patterns
grep -E 'AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z_-]{35}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' \
    /tmp/all_strings.txt

# JWT tokens
grep -oP 'eyJ[A-Za-z0-9+/=]+\.[A-Za-z0-9+/=]+\.[A-Za-z0-9+/=_-]+' \
    /tmp/all_strings.txt | head -10

trufflehog filesystem scan

# trufflehog works on directories — point at rootfs
trufflehog filesystem "$ROOT" --only-verified 2>/dev/null
# Without --only-verified for broader sweep:
trufflehog filesystem "$ROOT" --json 2>/dev/null | \
    python3 -c "import sys,json; [print(json.dumps(r, indent=2)) for r in map(json.loads, sys.stdin)]"

Phase 5 — MQTT / Cloud / IoT-Platform Tokens

# MQTT broker credentials
grep -rn "mqtt\|MQTT\|mosquitto" "$ROOT" --include="*.conf" --include="*.cfg" \
    --include="*.json" --incl
자주 묻는 질문

자격 증명은 보통 어디에서 찾나요?

가이드는 펌웨어의 계정 파일, 웹 서버 설정, 원격 로그인 설정을 가리킵니다.

기본 비밀번호도 위험한가요?

네. 가이드는 한 번도 바꾸지 않은 기본 계정이 흔한 약점이라고 말합니다.

발견 사항은 어떻게 처리하나요?

펌웨어에서 해당 자격 증명을 제거하고, 노출된 비밀 값은 모두 새로 발급해 교체해야 합니다.

상세 정보

작성자의 원본 설명

Systematic hunt for hardcoded credentials, API keys, certificates, and default passwords in extracted IoT firmware. Covers /etc/shadow and passwd parsing, busybox httpd configs, telnet/dropbear stanzas, MQTT/cloud API key extraction, and cross-referencing against known default-credential databases.

repo: BitterSecurity/Decepticon

인기도

GitHub 스타
6.5k
순위
#14099
라이선스
Apache-2.0
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬