Weak and Default Authentication
A reachable service is only as strong as the check at its door. On networks that check is often missing or trivial: a switch still using the vendor's default password, an SNMP agent answering to the community string public, a VPN with passwords but no second factor, a shared admin account on every printer, a database user with no password because "it's internal". Attackers don't need an exploit for any of these; they log in. Weak authentication is the second classic network weakness, and the one most often found in real incidents' first steps (password spraying and credential stuffing against remote access are routine).
The attack mechanics of guessing are covered in Brute Force and Password Spraying; the cost of guessing in Password Cost. This lesson is about finding weak authentication across a network and fixing it.
The forms it takes
| Weakness | Typical place | Why it is weak |
|---|---|---|
| Default credentials | network devices, printers, cameras, IPMI/BMC, appliances, IoT | the defaults are published in manuals |
| No authentication | Redis, Memcached, Elasticsearch, MongoDB in old defaults, Docker API on 2375, Telnet consoles | anyone who reaches the port is in |
| SNMP v1/v2c communities | switches, printers, UPSs | the "password" is a cleartext string, often public/private; v2c private may allow writes |
| Password-only remote access | VPN, RDP, SSH, webmail | spraying and stolen passwords work; no second factor |
| Shared and service accounts | admin on all devices, one domain account in every script |
no accountability, never rotated, one leak opens everything |
| Weak protocols | NTLMv1, LM, Telnet/FTP logins, HTTP Basic without TLS | credentials crackable or visible on the wire (Unencrypted Protocols) |
Finding it: configuration review
The safest way to find weak authentication is to read the configurations (within scope), not to guess passwords: guessing is usually forbidden by the rules of engagement and can lock out real users. The checker below reviews exported device settings from the lab network (synthetic data; the "default password" flag comes from the device's own export, which reports whether the factory password was ever changed).
devices = [
{"host": "fw.lab.test", "type": "firewall", "factory_pw_changed": True, "mfa": True, "snmp": None, "admin_accounts": ["alice", "bob"]},
{"host": "sw-core", "type": "switch", "factory_pw_changed": True, "mfa": False, "snmp": ("v2c", "public"), "admin_accounts": ["admin"]},
{"host": "prn40.lab.test","type": "printer", "factory_pw_changed": False, "mfa": False, "snmp": ("v2c", "private"), "admin_accounts": ["admin"]},
{"host": "vpn.lab.test", "type": "vpn", "factory_pw_changed": True, "mfa": False, "snmp": None, "admin_accounts": ["alice"]},
{"host": "bmc-db", "type": "BMC", "factory_pw_changed": False, "mfa": False, "snmp": ("v3", "authPriv"), "admin_accounts": ["root"]},
]
SHARED = {"admin", "root", "administrator"}
findings = []
for d in devices:
h = d["host"]
if not d["factory_pw_changed"]:
findings.append((1, h, "factory default password still set"))
if d["snmp"] and d["snmp"][0] in ("v1", "v2c"):
sev = 1 if d["snmp"][1] == "private" else 2
findings.append((sev, h, f"SNMP {d['snmp'][0]} community '{d['snmp'][1]}' (cleartext, guessable)"))
if d["type"] in ("vpn", "firewall") and not d["mfa"]:
findings.append((1, h, "remote access without MFA"))
shared = SHARED & set(d["admin_accounts"])
if shared:
findings.append((3, h, f"shared admin account {sorted(shared)}: no individual accountability"))
for sev, host, text in sorted(findings):
print(f"P{sev} {host:15} {text}")
print(len(findings), "findings on", len({h for _, h, _ in findings}), "devices")P1 bmc-db factory default password still set
P1 prn40.lab.test SNMP v2c community 'private' (cleartext, guessable)
P1 prn40.lab.test factory default password still set
P1 vpn.lab.test remote access without MFA
P2 sw-core SNMP v2c community 'public' (cleartext, guessable)
P3 bmc-db shared admin account ['root']: no individual accountability
P3 prn40.lab.test shared admin account ['admin']: no individual accountability
P3 sw-core shared admin account ['admin']: no individual accountability
8 findings on 4 devices
Where configuration access isn't in scope, an assessor uses non-guessing checks: Nmap scripts that report whether a service requires authentication at all (redis-info, mongodb-info, ssh-auth-methods, rdp-ntlm-info), and, only if the rules of engagement explicitly allow it, a check of a short list of published vendor defaults against devices whose owner agreed, at a rate that can't trigger lockouts.
Detecting guessing attacks
Weak authentication is exploited by guessing, and guessing leaves a pattern in authentication logs. Two shapes matter:
- Brute force: many passwords against one account. Lockouts and per-account thresholds catch it.
- Password spraying: one or two common passwords against many accounts, slowly, so no account hits its lockout. Detect it per source: many distinct accounts failing from one address.
import pandas as pd
# Synthetic VPN authentication log, 10 minutes. The spray comes from 198.51.100.23.
rows = []
users = [f"user{i:02d}" for i in range(1, 31)]
for i, u in enumerate(users):
rows.append((f"10:{i // 4:02d}:{(i * 13) % 60:02d}", "198.51.100.23", u, "fail"))
rows += [("10:01:10", "203.0.113.40", "alice", "fail"), ("10:01:25", "203.0.113.40", "alice", "ok"),
("10:03:02", "192.0.2.77", "bob", "fail"), ("10:03:40", "192.0.2.77", "bob", "fail"),
("10:04:05", "192.0.2.77", "bob", "ok"), ("10:06:00", "198.51.100.23", "user07", "ok")]
log = pd.DataFrame(rows, columns=["time", "src", "user", "result"])
per_src = log.groupby("src").agg(attempts=("user", "size"), accounts=("user", "nunique"),
fails=("result", lambda r: (r == "fail").sum()),
successes=("result", lambda r: (r == "ok").sum()))
per_src["spray"] = (per_src["accounts"] >= 10) & (per_src["fails"] / per_src["attempts"] > 0.8)
print(per_src.sort_values("accounts", ascending=False).to_string())
hit = log[(log.src.isin(per_src[per_src.spray].index)) & (log.result == "ok")]
print("\nsuccessful logins from spraying sources:")
print(hit.to_string(index=False)) attempts accounts fails successes spray
src
198.51.100.23 31 30 30 1 True
192.0.2.77 3 1 2 1 False
203.0.113.40 2 1 1 1 False
successful logins from spraying sources:
time src user result
10:06:00 198.51.100.23 user07 ok
One source failed against 30 accounts and then succeeded as user07: that account's password was one of the sprayed ones, and its session must be treated as compromised (disable, reset, review what it did). The per-account view would have shown nothing: each account failed at most once.
How it is fixed
- Change every default at deployment, enforced by the build checklist; unique per-device credentials stored in a password manager or vault, never a shared
adminpassword across devices. - Turn on authentication for every service that supports it, and bind unauthenticated ones to loopback (Unnecessary Exposed Services).
- SNMPv3 with
authPriv(authentication and encryption) or SNMP off; never v2c write communities. - MFA for all remote access (VPN, webmail, admin consoles), preferably phishing-resistant (FIDO2/WebAuthn).
- Central identity (RADIUS/TACACS+ or SSO) for network-device administration, with individual accounts and logging.
- Rate limits and lockouts per account and per source; alerts on spraying patterns; blocklists of known-breached passwords.
Pitfalls
- Testing defaults by guessing against production accounts and locking out the CEO. Read configurations first; guess only with explicit permission.
- Forgetting out-of-band interfaces (BMCs) and devices nobody "logs in to" (UPS, cameras).
- MFA with a bypass: legacy protocols (IMAP, SMTP AUTH, old VPN profiles) that accept the password alone.
- Lockout without per-source detection: sprays stay under it by design.
Practice
1. Which finding in the device review would you fix first, and why?
The printer's SNMP v2c private community and its factory password, together with the BMC's default password (P1s). Write access via SNMP or a BMC with defaults gives control over the device; the BMC controls the database server's hardware and console. The VPN without MFA is P1 too, because it is reachable from the Internet.
2. Change the spray threshold to accounts >= 3. Is anything else flagged? Why is the threshold a trade-off?
No: the other sources tried only one account each. A lower threshold catches smaller sprays but flags shared NAT addresses (an office behind one IP where several users mistype passwords). Tune with real data (Tuning Alerts and False Positives).
3. A Redis server on 6379 answers commands without a password. Which two fixes apply?
Bind it to 127.0.0.1 or a private interface reachable only by its application, and enable authentication (requirepass, or ACL users in Redis 6+), plus a firewall rule.
Test yourself
Why is password spraying not caught by per-account lockouts?
- It uses the right passwords
- It tries one or two passwords per account, staying under every account's threshold
- It doesn't use passwords
- Lockouts only work for admins
In the synthetic log, what made the spray an incident rather than an attempt?
- The number of failures
- A successful login (user07) from the spraying source
- The time of day
- The VPN type
What is the secure SNMP configuration?
- v2c with community 'public'
- v1 read-only
- SNMPv3 with authPriv, or SNMP disabled
- v2c with a long community string
What is the preferred way for an assessor to find default credentials?
- Guess common passwords on all devices
- Review configurations and exports within scope; guess only published defaults with explicit permission and no lockout risk
- Ask users for their passwords
- Use a cracking tool on captured hashes