Joe Avanzato
Get in touch

Search the site

All blog posts

Are You a Honeypot? How Bots Fingerprint a Shell Before They Commit

Some of the bots that log in to BeeSting's SSH sensors don't download anything. They run a battery of shell-semantics tests first, checking arithmetic, PIDs, subshells and /proc namespaces, and only continue if the answers look like real Linux. Here is what those checks are, who runs them, and what they mean for anyone running deception.

The BeeSting dashboard, last 30 days (Link).

Most of the activity a honeypot sees is boring in the best possible way: a bot logs in with root:123456, pastes a one-liner, pulls a binary and leaves. Collect enough of it and you have a solid IOC feed. Every so often, a session shows up that isn't trying to infect anything. It's trying to work out whether the machine it just logged in to is real.

Over the last 3 weeks, BeeSting SSH sensors recorded several distinct families of these "liveness" checks. They range from a single echo to a 41-command test suite that checks shell arithmetic, process IDs, subshell scoping and Linux PID namespaces. This post walks through what each one tests, who runs them and how often, and what that means for anyone running Cowrie or any other emulated shell.

The short version

Check Sessions Source IPs What it is testing
check_<md5>_* battery (38-41 commands) 28 11 Shell arithmetic, $$, positional args, functions, subshells, /proc/self namespaces, stderr and exit codes
echo -e "\x6F\x6B" 3,153 2 Does the shell interpret escape sequences? Expected output: ok
uname -s -v -n -r -m (alone) 86 9 Does the login give a working shell, and what kernel/arch is it?
echo xsec 6 1 Bare echo-back canary
cat /bin/echo 2 2 Reads an ELF header to get the CPU architecture (and to see whether binaries are real)
/bin/busybox <RANDOM> (telnet) 1,000s 100s Does BusyBox answer applet not found the way real BusyBox does?

All figures are from the BeeSting database for Nov 8 - Nov 30, 2026.

1. The check_<md5> battery

On November 9 a session arrived on one of my SSH sensors that looked nothing like the usual spray-and-pray. After logging in as root, the client sent 41 commands in about ten seconds, and almost every one carried a unique marker string of the form check_<32 hex chars>_<test name>. Here is the first block, exactly as captured:

sh -c 'printf '"'"'\n%s|%s\n'"'"' '"'"'check_e5337886ef2219d4f2d7ec590d39f5d8_small_control'"'"' '"'"'check_e5337886ef2219d4f2d7ec590d39f5d8'"'"''
printf '\n%s|%s\n' 'check_e5337886ef2219d4f2d7ec590d39f5d8_small_control' 'check_e5337886ef2219d4f2d7ec590d39f5d8'
sh -c 'printf '"'"'\n%s|%s\n'"'"' '"'"'check_e5337886ef2219d4f2d7ec590d39f5d8_small_math'"'"' "$((850*134+88))"'
printf '\n%s|%s\n' 'check_e5337886ef2219d4f2d7ec590d39f5d8_small_math' "$((850*134+88))"
sh -c 'printf '"'"'\n%s|%s\n'"'"' '"'"'check_e5337886ef2219d4f2d7ec590d39f5d8_small_pid'"'"' "$$"'
printf '\n%s|%s\n' 'check_e5337886ef2219d4f2d7ec590d39f5d8_small_pid' "$$"
sh -c 'set -- '"'"'check_..._arg1'"'"' '"'"'check_..._arg2'"'"'; printf '"'"'\n%s|%s\n'"'"' '"'"'check_..._small_positional'"'"' "$#|$1|$2"'
set -- 'check_..._arg1' 'check_..._arg2'; printf '\n%s|%s\n' 'check_..._small_positional' "$#|$1|$2"
f_check_...() { printf '\n%s|%s\n' 'check_..._small_function' "$1|$#"; }; f_check_... 'check_..._function_value'
printf '\n%s\n' 'check_e5337886ef2219d4f2d7ec590d39f5d8_small_done'

A few design choices stand out:

  • Every test runs twice: once directly, and once wrapped in sh -c '...' with the nasty '"'"' quote-escaping idiom. A real shell handles both the same way. An emulator that tokenises commands itself (instead of running a real shell) often gets the nested quoting wrong, so the two answers stop matching.
  • The marker makes the output machine-checkable. The client doesn't need to parse free text: it looks for check_<md5>_small_math|113988 in the output and compares.
  • The values are randomised per session. The arithmetic changes every time (850*134+88, 178*867+18, 496*187+36...), so a honeypot can't replay canned answers. It has to actually evaluate $((...)).

After two of these "small" blocks and a transport_done marker, the battery moves on to the heavier tests:

# PID namespace / container check (truncated at 500 characters by my logging)
if IFS=' ' read -r _filter_pid _filter_rest < /proc/self/stat; then
  _filter_status_pid=NA; _filter_ns=NA; _filter_status_ok=0
  if [ -r /proc/self/status ]; then
    _filter_status_ok=1
    while IFS=: read -r _filter_key _filter_values; do
      case "$_filter_key" in Pid) _filter_status_pid=$_filter_values;; NSpid) _filter_ns=$_filter_values;; esac
    done < /proc/self/status
  fi
  printf '%s|%s|%s|%s|%s|%s|%s\n' 'check_d0ac47af469219615ca488c959b8e60a' "$$" "$_filter_pid" "$((6*7))" "$_filter_status_pid" "$_f...

value=$((19+23)); if [ "$value" -eq 42 ]; then printf '%s\n' 'check_d0ac...' "$value" 'branch-ok'; else exit 9; fi
printf '%s\n' 'check_d0ac...' | while IFS= read -r line; do printf 'pipe=%s\n' "$line"; done
v=outer; (v=inner; printf 'child=%s\n' "$v"); printf 'parent=%s\n' "$v"
printf '%s\n' 'a b;$()'
set -- 'check_d0ac...' 'second value'; printf '%s|%s|%s\n' "$#" "$1" "$2"
f_check_d0ac...() { printf 'arg=%s|count=%s\n' "$1" "$#"; }; f_check_d0ac... 'check_d0ac...'
printf '%s\n' 'check_d0ac...' >&2; exit 37
echo; echo 'check_3008d0353b8a3ef5441d7527f523f026_transport_done'

Each of these targets a specific weakness in emulated shells:

Test A real shell prints Why a fake shell might fail
/proc/self/stat vs /proc/self/status vs $$ Three matching PIDs (plus NSpid) Static fake /proc files don't agree with the PID the shell reports. A mismatch between Pid and NSpid also gives away a container.
value=$((19+23)); if [ ... -eq 42 ] check_..., 42, branch-ok Needs real arithmetic, a variable assignment and a conditional
printf ... | while read pipe=check_... Needs real pipes into a compound command
v=outer; (v=inner; ...); ... child=inner, then parent=outer A subshell must not leak variables back to the parent. Emulators without real process semantics often print parent=inner.
printf '%s\n' 'a b;$()' a b;$() exactly A naive tokeniser splits on ; or tries to expand $() inside single quotes
set -- ...; "$#" "$1" "$2" 2|check_...|second value Positional parameters with an embedded space
shell function arg=check_...|count=1 Function definitions are rarely emulated
>&2; exit 37 The marker on stderr, exit status 37 Is stderr kept separate from stdout, and does the exit code come back over the SSH channel?

For reference, here is what a real bash returns for the deterministic parts (run on my own machine):

check_e5337886ef2219d4f2d7ec590d39f5d8_small_math|113988
check_d0ac47af469219615ca488c959b8e60a
42
branch-ok
pipe=check_d0ac47af469219615ca488c959b8e60a
child=inner
parent=outer
a b;$()
2|check_d0ac47af469219615ca488c959b8e60a|second value
arg=check_d0ac47af469219615ca488c959b8e60a|count=1

What happened after the checks

This is the (hopefully) interesting part. On November 9 and 10, four of these sessions passed whatever threshold the client uses and went on to the payload stage. The client uploaded a 3.3 MB file over the SSH channel to /root/.16 and tried to make it executable, reusing the password it had just logged in with as the sudo password:

echo '!root' | sudo -S sh -c 'chmod +x '\''/root/.16'\''' || echo '!root' | sudo -S chmod +x '/root/.16' || sh -c 'chmod +x '\''/root/.16'\''' || chmod +x '/root/.16'
chmod +x '/root/.16'
chmod +x '/root/.16'
File Size SHA-256
/root/.16 3,373,344 bytes a151d3f4f2422531f30a843ffb35479596c86722bb103bdf8591105687f9b125

This file was first seen in the wild by VirusTotal in late September - unfortunately it turned out to not be particularly interesting and appears to just be an XMRig mining variant.

The !root password wasn't fixed. The same chain appears with 111111 when that was the password that got in. Whoever wrote this assumed the credential that opens SSH is probably also the sudo password, which on real compromised boxes is usually true.

From November 11 onward, every one of the remaining 24 sessions ran the battery and disconnected. No upload, no chmod, nothing.

Every session of the check_<md5> battery, stacked by day. Orange sessions went on to upload a binary; blue sessions ran the checks and left.

I can't prove why the uploads stopped. It fits a client that flagged my sensor as a honeypot and kept checking it on a schedule without ever delivering again. The pattern is very regular: sessions usually come in pairs (or bursts of three or four) about two minutes apart, every day or two, and most finish all 38 commands in 7-17 seconds (median about 13 s). That looks like a scheduled re-validation job, not a person.

Who runs it

All 28 sessions came from 11 IPs in just two hosting networks:

ASN Organisation Country IPs Sessions
AS47890 UNMANAGED LTD NL 8 17
AS48090 TECHOFF SRV LIMITED AD 3 11

The heaviest sources were 195.178.110[.]228 (5 sessions), 2.57.122[.]168 (4) and 92.118.39[.]14 (4). Every session logged in as root, rotating through low-effort passwords (111111, 123, !root, 000000, 123123, 12345). Neither network is a stranger to BeeSting: across all sensors I've seen 31 IPs from AS47890 (SSH, SMTP, SOCKS5 logins) and 46 from AS48090 (mostly Suricata alerts and HTTP probing). The battery traffic suggests a credential-stuffing operation that validates and fingerprints a host before handing it to whatever uses the access next. That is a different business from the Mirai-style bots that infect blindly.

The Intel Graph view of the 11 battery IPs and their two ASNs.

2. echo -e "\x6F\x6B": the one-command liveness probe

The 41-command battery is the sophisticated end. At the other end is a single command that ran 3,153 times:

echo -e "\x6F\x6B"

\x6F\x6B is ok. A real shell with a real echo -e prints ok. A dumb honeypot that echoes input back, or that doesn't implement -e, prints the literal \x6F\x6B or nothing at all. It's a one-byte-pair Turing test.

What makes this one worth a chart is how it was used. All 3,153 sessions came from just two IPs, and each session was a brute-force login followed by exactly this one command:

Logins per five minutes from the two IPs behind the echo "ok" probe. Every login used a different root password.
  • 110.172.29[.]191 (AS135918, VN): 2,757 logins in 97 minutes on November 22, about 28 a minute, flat out.
  • 36.91.6[.]68 (AS7713 Telkom Indonesia): 396 logins in 12 minutes on November 24.

Each login used a different root password (#1bitch, *963.*963., 0.00000000, 000000.., 000webhost...), and each one "succeeded". That is the second lesson of this post.

The password that always works

Stock Cowrie accepts root with almost any password. That's great for collecting payloads and terrible for realism: no real server accepts 2,757 different root passwords in a row. For a brute-forcer, "every password works" is itself the honeypot signature, and the echo ok after each "success" is how the tool confirms it.

3. The quieter probes

uname -s -v -n -r -m

86 sessions from 9 IPs ran this and nothing else. Seven of the nine IPs belong to one network, AS198364 (BANATSYNC SRL): 109.160.32[.]129 (57 sessions) and a cluster in 77.239.124[.]0/24. The credentials rotate through service accounts (oracle:oracle, git:git, deploy:deploy, user:password, root:default). This looks like a credential validator: log in, confirm a working shell, record kernel and architecture, move on. Two sessions used the variant /bin/./uname -s -v -n -r -m, a path trick that gets around naive command allow/deny lists matching on /bin/uname.

echo xsec

Six sessions from one IP (154.18.197[.]29, AS142271, PH) within ten minutes on November 13, logging in as root:0001, root:0002, root:0003, root:0004... and running only echo xsec. It's a bare echo-back canary, probably with a numbered password list to map which credential a given sensor accepts.

cat /bin/echo

This one only appeared twice, but it's a classic. Reading the first bytes of a known system binary gives you the ELF header, which tells you the CPU architecture (x86-64, ARM, MIPS...). The bot can then pick the right payload without trusting uname. It's also a realism check: a honeypot that returns nothing, or a text placeholder, for /bin/echo is obviously fake. Both sessions went straight to a download afterwards (covered in a future post).

/bin/busybox <RANDOM WORD> on telnet

The telnet side has its own version, used by thousands of Mirai-family sessions. Running /bin/busybox HISILICON or /bin/busybox SORA should produce HISILICON: applet not found on a real BusyBox device. A honeypot that answers differently, or answers "command not found" in bash style, is flagged. One family adds cat /proc/self/exe to read its own binary's ELF header (1,327 sessions from 197 IPs). More on these to come later.

Why this matters

For defenders running deception: the bar has moved. "Looks like a Linux login prompt" isn't enough anymore for anyone who wants high-value interaction. The checks above are cheap for an attacker and hard to emulate without running real commands. The specific tells are:

  1. Authentication that accepts everything. Use a fixed, believable credential set and refuse everything else.
  2. Shell semantics: arithmetic, subshells, functions, pipes into while read, sh -c with nested quoting.
  3. Process consistency: $$, /proc/self/stat and /proc/self/status must agree.
  4. Binary realism: cat /bin/echo and cat /proc/self/exe should return a real ELF header for the architecture you claim.
  5. Channel behaviour: stderr separate from stdout, and real exit codes (exit 37 → 37).

For detection engineers: these batteries are a gift. On a real host, a session that runs printf ... 'check_<md5>_small_math' "$((850*134+88))" or echo -e "\x6F\x6B" straight after login is almost certainly automated access validation. Example hunt logic for shell or auditd command logging:

process.command_line matches /check_[0-9a-f]{32}_(small_|transport_done|arg1)/
OR process.command_line == 'echo -e "\x6F\x6B"'
OR process.command_line matches /^v=outer; \(v=inner;/
OR (process.command_line == "cat /bin/echo" AND session.age < 10s)

IOCs

# Fingerprint battery sources (Nov 9-26 2026)
195.178.110[.]228
195.178.110[.]232
195.178.110[.]217
2.57.122[.]168
2.57.122[.]150
92.118.39[.]14
92.118.39[.]71
92.118.39[.]49
92.118.39[.]77
92.118.39[.]64
80.94.92[.]234

# echo "ok" brute-force validators
110.172.29[.]191
36.91.6[.]68

# Payload uploaded after a passed battery
a151d3f4f2422531f30a843ffb35479596c86722bb103bdf8591105687f9b125  /root/.16  (3,373,344 bytes)

All of these, plus everything else BeeSting sees in the last 24 hours, are in the free feed at https://beesting.tools.