惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LINUX DO - 热门话题
H
Hacker News: Front Page
P
Proofpoint News Feed
F
Future of Privacy Forum
Spread Privacy
Spread Privacy
The Register - Security
The Register - Security
S
Schneier on Security
T
Tor Project blog
Google DeepMind News
Google DeepMind News
P
Palo Alto Networks Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
SegmentFault 最新的问题
P
Privacy International News Feed
Security Latest
Security Latest
博客园 - 聂微东
博客园_首页
博客园 - 司徒正美
V
V2EX
宝玉的分享
宝玉的分享
S
Securelist
The Cloudflare Blog
J
Java Code Geeks
I
Intezer
Apple Machine Learning Research
Apple Machine Learning Research
Know Your Adversary
Know Your Adversary
博客园 - 叶小钗
小众软件
小众软件
爱范儿
爱范儿
C
Cyber Attacks, Cyber Crime and Cyber Security
L
Lohrmann on Cybersecurity
Latest news
Latest news
美团技术团队
S
Secure Thoughts
P
Privacy & Cybersecurity Law Blog
Project Zero
Project Zero
Jina AI
Jina AI
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cybersecurity and Infrastructure Security Agency CISA
Recorded Future
Recorded Future
WordPress大学
WordPress大学
博客园 - 【当耐特】
F
Fox-IT International blog
人人都是产品经理
人人都是产品经理
博客园 - 三生石上(FineUI控件)
Simon Willison's Weblog
Simon Willison's Weblog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

SANS Internet Storm Center, InfoCON: green

Cross-Platform NPM Stealer - SANS Internet Storm Center ISC Stormcast For Friday, May 22nd, 2026 https://isc.sans.edu/podcastdetail/9942 Selective HTTP Proxying in Linux - SANS Internet Storm Center ISC Stormcast For Thursday, May 21st, 2026 https://isc.sans.edu/podcastdetail/9940 ISC Stormcast For Wednesday, May 20th, 2026 https://isc.sans.edu/podcastdetail/9938 ISC Stormcast For Tuesday, May 19th, 2026 https://isc.sans.edu/podcastdetail/9936 TeamPCP Supply Chain Campaign: Activity Through 2026-05-17 [Guest Diary] New Malware Libraries means New Signatures ISC Stormcast For Friday, May 15th, 2026 https://isc.sans.edu/podcastdetail/9934 Simple bypass of the link preview function in Outlook Junk folder ISC Stormcast For Thursday, May 14th, 2026 https://isc.sans.edu/podcastdetail/9932 [GUEST DIARY] Tearing apart website fraud to see how it works. ISC Stormcast For Wednesday, May 13th, 2026 https://isc.sans.edu/podcastdetail/9930 Proxying the Unproxyable? Sending EXE traffic to a Proxy Microsoft May 2026 Patch Tuesday - SANS Internet Storm Center ISC Stormcast For Tuesday, May 12th, 2026 https://isc.sans.edu/podcastdetail/9928 Apple Patches Everything - SANS Internet Storm Center Why we use CAPTCHAs - SANS Internet Storm Center ISC Stormcast For Monday, May 11th, 2026 https://isc.sans.edu/podcastdetail/9926 YARA-X 1.16.0 Release - SANS Internet Storm Center Another Universal Linux Local Privilege Escalation (LPE) Vulnerability: Dirty Frag ISC Stormcast For Friday, May 8th, 2026 https://isc.sans.edu/podcastdetail/9924 SANS.edu Internet Storm Center - SANS Internet Storm Center SANS.edu Internet Storm Center - SANS Internet Storm Center ISC Stormcast For Wednesday, May 6th, 2026 https://isc.sans.edu/podcastdetail/9920 Cleartext Passwords in MS Edge? In 2026? - SANS ISC SSL.com rotates their root certificate today - SANS ISC ISC Stormcast For Tuesday, May 5th, 2026 https://isc.sans.edu/podcastdetail/9918 TeamPCP Weekly Analysis: 2026-W18 (2026-04-27 through 2026-05-03) DShield Honeypot Update - SANS Internet Storm Center ISC Stormcast For Monday, May 4th, 2026 https://isc.sans.edu/podcastdetail/9916 Wireshark 4.6.5 Released - SANS Internet Storm Center Malicious Ad for Homebrew Leads to MacSync Stealer ISC Stormcast For Friday, May 1st, 2026 https://isc.sans.edu/podcastdetail/9914 ISC Stormcast For Thursday, April 30th, 2026 https://isc.sans.edu/podcastdetail/9912 Danger of Libredtail [Guest Diary] - SANS Internet Storm Center Today's Odd Web Requests - SANS Internet Storm Center ISC Stormcast For Wednesday, April 29th, 2026 https://isc.sans.edu/podcastdetail/9910 HTTP Requests with X-Vercel-Set-Bypass-Cookie Header ISC Stormcast For Tuesday, April 28th, 2026 https://isc.sans.edu/podcastdetail/9908 TeamPCP Supply Chain Campaign: Update 008 - 26-Day Pause Ends with Three Concurrent Compromises (Checkmarx KICS, Bitwarden CLI Cascade, xinference PyPI), CanisterSprawl npm Worm Identified, and Tier 1 Coverage Returns ISC Stormcast For Friday, April 24th, 2026 https://isc.sans.edu/podcastdetail/9906 Apple Patches Exploited Notification Flaw - SANS ISC ISC Stormcast For Thursday, April 23rd, 2026 https://isc.sans.edu/podcastdetail/9904 ISC Stormcast For Wednesday, April 22nd, 2026 https://isc.sans.edu/podcastdetail/9902, (Wed, Apr 22nd) [Guest Diary] Beyond Cryptojacking: Telegram tdata as a Credential Harvesting Vector, Lessons from a Honeypot Incident, (Wed, Apr 22nd) A .WAV With A Payload, (Tue, Apr 21st) ISC Stormcast For Tuesday, April 21st, 2026 https://isc.sans.edu/podcastdetail/9900, (Tue, Apr 21st) Handling the CVE Flood With EPSS - SANS Internet Storm Center ISC Stormcast For Monday, April 20th, 2026 https://isc.sans.edu/podcastdetail/9898 ISC Stormcast For Friday, April 17th, 2026 https://isc.sans.edu/podcastdetail/9896 Lumma Stealer infection with Sectop RAT (ArechClient2) ISC Stormcast For Thursday, April 16th, 2026 https://isc.sans.edu/podcastdetail/9894, (Thu, Apr 16th) [Guest Diary] Compromised DVRs and Finding Them in the Wild, (Thu, Apr 16th) ISC Stormcast For Wednesday, April 15th, 2026 https://isc.sans.edu/podcastdetail/9892, (Wed, Apr 15th) Scanning for AI Models, (Tue, Apr 14th) Microsoft Patch Tuesday April 2026., (Tue, Apr 14th) ISC Stormcast For Tuesday, April 14th, 2026 https://isc.sans.edu/podcastdetail/9890 Scans for EncystPHP Webshell - SANS Internet Storm Center ISC Stormcast For Monday, April 13th, 2026 https://isc.sans.edu/podcastdetail/9888, (Mon, Apr 13th) Obfuscated JavaScript or Nothing - SANS Internet Storm Center ISC Stormcast For Thursday, April 9th, 2026 https://isc.sans.edu/podcastdetail/9886 Number Usage in Passwords: Take Two - SANS ISC TeamPCP Supply Chain Campaign: Update 007 - Cisco Source Code Stolen via Trivy-Linked Breach, Google GTIG Tracks TeamPCP as UNC6780, and CISA KEV Deadline Arrives with No Standalone Advisory More Honeypot Fingerprinting Scans - SANS Internet Storm Center ISC Stormcast For Wednesday, April 8th, 2026 https://isc.sans.edu/podcastdetail/9884 A Little Bit Pivoting: What Web Shells are Attackers Looking for? ISC Stormcast For Tuesday, April 7th, 2026 https://isc.sans.edu/podcastdetail/9882 How often are redirects used in phishing in 2026? - SANS ISC ISC Stormcast For Monday, April 6th, 2026 https://isc.sans.edu/podcastdetail/9880
An Example of Stack String in High Level Language - SANS ISC
2026-05-23 · via SANS Internet Storm Center, InfoCON: green

This week, I’m attending the SEC670[1] training (“Red Teaming Tools - Developing Windows Implants, Shellcode, Command and Control”). From my point of view, this training fits perfectly with FOR610 or FOR710 (malware analysis) because it addresses malware from the opposite: Instead of performing reverse engineering, you write malicious code! Always interesting to have another point of view.

Many techniques used by threat actors are often discovered while reversing the malware code and are read in assembly. A perfect example are stack strings. This is a malware obfuscation technique where strings are constructed dynamically at runtime by assigning individual characters or bytes directly onto the stack, rather than storing them as contiguous string literals in the binary's static data sections. Read: they won’t be detected by simple tools like “strings” or “pestr”.

From an assembly code point of view, a stack string looks like this:

sub     esp, 16                 ; Reserve 16 bytes (padded to hold our string)
mov     byte [esp + 0], 0x73    ; 's'
mov     byte [esp + 1], 0x61    ; 'a'
mov     byte [esp + 2], 0x6E    ; 'n'
mov     byte [esp + 3], 0x73    ; 's'
mov     byte [esp + 4], 0x20    ; ' '
mov     byte [esp + 5], 0x69    ; 'i'
mov     byte [esp + 6], 0x73    ; 's'
mov     byte [esp + 7], 0x63    ; 'c'
mov     byte [esp + 8], 0x00    ; '\0' null terminator
mov     eax, 4                  ; sys_write
mov     ebx, 1                  ; fd = stdout
mov     ecx, esp                ; buf = stack string
mov     edx, 8                  ; len = 8
int     0x80

The string "sans isc" will be printed on the console.

But, how do you implement this in a high-level language like C? Here is an example:

#include <stdio.h>
#include <string.h>

void plainTextExample(void) {
    // Will be stored in .rodata and easy to spot with "strings" tools
    const char* url = "http://plain-malicious.com/";
    printf("Plain URL = %s\n", url);
}

void stackStringExample(void) {
    // Now we use a stack string. The script will be located in .text!
    char url[30];
    url[0] = 0x68;   // 'h'
    url[1] = 0x74;   // 't'
    url[2] = 0x74;   // 't'
    url[3] = 0x70;   // 'p'
    url[4] = 0x3A;   // ':'
    url[5] = 0x2F;   // '/'
    url[6] = 0x2F;   // '/'
    url[7] = 0x65;   // 'e'
    url[8] = 0x6E;   // 'n'
    url[9] = 0x63;   // 'c'
    url[10] = 0x6F;  // 'o'
    url[11] = 0x64;  // 'd'
    url[12] = 0x65;  // 'e'
    url[13] = 0x64;  // 'd'
    url[14] = 0x2D;  // '-'
    url[15] = 0x6D;  // 'm'
    url[16] = 0x61;  // 'a'
    url[17] = 0x6C;  // 'l'
    url[18] = 0x69;  // 'i'
    url[19] = 0x63;  // 'c'
    url[20] = 0x69;  // 'i'
    url[21] = 0x6F;  // 'o'
    url[22] = 0x75;  // 'u'
    url[23] = 0x73;  // 's'
    url[24] = 0x2E;  // '.'
    url[25] = 0x63;  // 'c'
    url[26] = 0x6F;  // 'o'
    url[27] = 0x6D;  // 'm'
    url[28] = 0x2F;  // '/'
    url[29] = 0x00;  // '\0'
    printf("Obfuscated URL = %s\n", url);
    memset(url, 0, sizeof(url));
}

int main(void) {
    plainTextExample();
    stackStringExample();
    return 0;
}

Because characters are hex-encoded, it makes them even more difficult to be spotted by the reverse engineer's eyes.

Once compiled, let’s disassemble it with Ghidra. As expected the first string is directly discovered:

Now, let's try to find the second string. It's not directly available. The stack string is generated with the code below. Characters are moved one by one (0x68, 0x74, 0x74, ...):

Of course, we are lazy people and we need tools and processes to spot such type of strings. We have tools to do this, like floss[2]. But, to better understand how we can spot them, let's have a look at a "manual" technique. Because bytes are moved one by one on the stack, the ASM instruction used is "movb" or "mov BYTE PTR" (depending on the syntax convention, AT&T or Intel). Let's try to decode the strings with a simple shell:

$ objdump -D StackStrings.exe \
| grep -oP 'mov\s+BYTE PTR \[[^\]]+\],\s*0x\K[0-9a-fA-F]{1,2}' \
| while read hex
> do
> printf "\x${hex}"
> done
http://encoded-malicious.com/G

Magic! So /bin/bash can be considered as a reverse-engineering tool :-)

Happy reversing!

[1] https://www.sans.org/cyber-security-courses/red-team-operations-developing-custom-tools-windows
[2] https://github.com/mandiant/flare-floss

Xavier Mertens (@xme)
Xameco
Senior ISC Handler - Freelance Cyber Security Consultant
PGP Key