Skip to content

T1505.003 Server Software Component: Web Shells#23

Open
McBeer89 wants to merge 9 commits into
tired-labs:mainfrom
McBeer89:main
Open

T1505.003 Server Software Component: Web Shells#23
McBeer89 wants to merge 9 commits into
tired-labs:mainfrom
McBeer89:main

Conversation

@McBeer89
Copy link
Copy Markdown

@McBeer89 McBeer89 commented Mar 18, 2026

This TRR covers file-based web shells executed through IIS handler mappings on Windows.

…orting docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@McBeer89 McBeer89 requested a review from a team March 18, 2026 00:15
@McBeer89 McBeer89 closed this Mar 18, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sludgework sludgework reopened this Mar 18, 2026
@McBeer89 McBeer89 changed the title Submission Attempt Submission Attempt for T1505.003 Server Software Component: Web Shell Mar 18, 2026
@McBeer89 McBeer89 changed the title Submission Attempt for T1505.003 Server Software Component: Web Shell T1505.003 Server Software Component: Web Shells Mar 18, 2026
Copy link
Copy Markdown
Collaborator

@sludgework sludgework left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not kidding when I say this.... GREAT first stab at this. The concepts get into the weeds and lots of moving parts and configurable technologies that you seem to have scoped very nicely.

I would request reviewing a few core concepts that I think either need more detail, or maybe are misleading as written.

Also, I haven't reviewed the DDMs yet for accuracy as I didn't know if implementing any of my requested changes would cause them to be updated as well. I will re-review when you update your version and look at the DDMs then.

Nice work!

Comment thread reports/trr0000/win/README.md Outdated
Comment on lines +18 to +23
| Excluded Item | Rationale |
|---|---|
| Fileless or memory-only web shells | Different essential operations |
| Other web servers on Windows (Apache, nginx, Tomcat) | Different essential operations |
| ASP.NET Core on IIS | Different execution model (IIS proxies to Kestrel) |
| PHP on IIS via FastCGI | Different execution model (via php-cgi.exe) |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A table lends itself to adding line after line easily. We don't want to fall into the slippery slope of defining too many out-of-scope items (ie Linux, Apache, Commodore 64, Game Boy Color, Samsung refrigerators).

Lets keep this section to discussing what IS in the document and for important omissions (like ASP.NET Core) we can add it into the paragraph.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood! I was back and forth on the table, on one hand I felt it was easier to read but I see what you're saying. I also see why I can take off the Fileless/memory and non-windows stuff from the exclusions. It's kind of obvious being how different they are. I'll make a correction and try again.

Comment thread reports/trr0000/win/README.md Outdated
Comment on lines +44 to +52
All HTTP/HTTPS traffic destined for IIS passes through HTTP.sys, a kernel-mode
driver that listens on configured ports (typically 80 and 443). HTTP.sys
handles connection management, caching, and request routing. When a request
requires application code, HTTP.sys routes it to the appropriate application
pool based on site bindings. The Windows Process Activation Service
(WAS) mediates between HTTP.sys and the worker process, managing application
pool lifecycle and process activation. HTTP.sys and WAS operate at the kernel
and system service level respectively, below the reach of most telemetry
sources.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
All HTTP/HTTPS traffic destined for IIS passes through HTTP.sys, a kernel-mode
driver that listens on configured ports (typically 80 and 443). HTTP.sys
handles connection management, caching, and request routing. When a request
requires application code, HTTP.sys routes it to the appropriate application
pool based on site bindings. The Windows Process Activation Service
(WAS) mediates between HTTP.sys and the worker process, managing application
pool lifecycle and process activation. HTTP.sys and WAS operate at the kernel
and system service level respectively, below the reach of most telemetry
sources.
All HTTP/HTTPS traffic destined for IIS passes through `HTTP.sys`, a kernel-mode
driver that listens on configured ports (typically 80 and 443). `HTTP.sys`
handles connection management, caching, and request routing. When a request
requires application code, `HTTP.sys` routes it to the appropriate application
pool based on site bindings. The Windows Process Activation Service
(WAS) mediates between `HTTP.sys` and the worker process, managing application
pool lifecycle and process activation. `HTTP.sys` and WAS operate at the kernel
and system service level respectively, below the reach of most telemetry
sources.

Adding backticks around filenames for readability

Comment thread reports/trr0000/win/README.md Outdated
context under which all code executes — including web shell code.

By default, pools run under low-privilege virtual accounts (e.g.,
`IIS AppPool\DefaultAppPool`). Administrators sometimes configure pools to use
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`IIS AppPool\DefaultAppPool`). Administrators sometimes configure pools to use
`IIS AppPool\DefaultAppPool`). Administrators are able to configure pools to use

Removing the ambiguous sometimes verbiage

Comment thread reports/trr0000/win/README.md Outdated
Comment on lines +76 to +77
`w3wp.exe`. Under normal operations, `w3wp.exe` rarely spawns command
interpreters.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a source for this claim about "rarely" spawning command interpreters? May not be needed but just curious

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's basically hearsay. I probably read that it doesn't normally happen but that could not be true for any given environment. I'll remove it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well maybe it doesn't need to be removed? I'll defer to the other people here who are smarter than I am, but it might be a detection consideration? I could see it varying in different environments, but it might be worth investigating in your own env. how often IIS web apps are spawning command interpreters, etc.

Comment thread reports/trr0000/win/README.md Outdated
Comment on lines +101 to +104
process and follows the same essential operations as Procedure A. Other SSI
directives (`#include`, `#echo`) are handled internally by `ssinc.dll` without
passing through a scripting engine; while these are in-process operations, they
do not map to Procedure B.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You claim:

while these are in-process operations, they do not map to Procedure B.

If procedure B is Web Shell with In-Process Execution. can you elaborate why it does not map?

Copy link
Copy Markdown
Author

@McBeer89 McBeer89 Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my lordy. I've re-read this specific thing like 6 times. I'm still not fully sure understand it. I THINK it's because #include and #echo can't execute code, they only do a specific thing and can't perform calls, executions, or queries outside of read or output a server variable for #include and #echo respectively, also there is no scripting engine running these. So basically it never hits the "execute code" part of the procedures because there's no code to execute. If it mapped to Proc B, the attacker code would be executed by a scripting engine.

SO I think maybe I just wasn't clear enough. I'll rewrite this and see what you think then.

https://learn.microsoft.com/en-us/iis/configuration/system.webserver/serversideinclude

Comment thread reports/trr0000/win/README.md
Comment thread reports/trr0000/win/README.md Outdated
Comment on lines +120 to +121
a child process of `w3wp.exe`. On ASP.NET Core with the Roslyn in-process
compiler, compilation may occur without a child process.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are bringing up ASP.NET Core, but you listed this as specifically out-of-scope in the beginning of the document. Make up your mind! Pick one and stay consistent. I would recommend leaving it out-of-scope as you are correct in the scope above that ASP.NET Core uses a different execution model altogether

Comment thread reports/trr0000/win/README.md
Comment thread reports/trr0000/win/README.md
Comment thread reports/trr0000/win/README.md Outdated
Call .NET API instead of Process Spawn. The Call .NET API operation has no
direct telemetry — only its side effects may be observable.

### Procedure C: Web Shell via web.config Manipulation
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your say all three Procedure C variants have the same general prerequisite:

all three variants require writing a web.config to a web-accessible directory.

That's technically true, but it glosses over the fact that the custom handler mapping variant has a stricter write location requirement than the other two. The inline handler variant and pre-compiled DLL variant can work from a subdirectory web.config (assuming system.webServer/handlers is unlocked or the attacker uses system.web/httpHandlers (see the Integrated mode topic I raised earlier)). The custom handler mapping variant requires the application root.

If a Red Team operator had to implement this procedure, it would help if they could differentiate the write location prerequisite across the three variants. Specifically, calling out that the custom handler mapping variant requires application-root-level web.config access, not just any web-accessible directory.

Copy link
Copy Markdown
Contributor

@dumpst3rfir3 dumpst3rfir3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Lots of great details. I didn't have too much to add to what has been said, and I saw that @sludgework had a lot of feedback on the procedures, so I didn't review those yet (I'll wait for the updated version). Looking forward to the revised draft!

Comment thread reports/trr0000/win/README.md Outdated
Comment on lines +38 to +39
Internet Information Services (IIS) is Microsoft's web server, included with
Windows Server. Every web shell on IIS must pass through the same request
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nit-picky comment here, but maybe it's worth clarifying that it's included, but not enabled, by default in Win Server?

Copy link
Copy Markdown
Author

@McBeer89 McBeer89 Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit-picky is what refines these things, right? That's a fair point, thanks!

Comment thread reports/trr0000/win/README.md Outdated
Comment on lines +76 to +77
`w3wp.exe`. Under normal operations, `w3wp.exe` rarely spawns command
interpreters.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well maybe it doesn't need to be removed? I'll defer to the other people here who are smarter than I am, but it might be a detection consideration? I could see it varying in different environments, but it might be worth investigating in your own env. how often IIS web apps are spawning command interpreters, etc.

Copy link
Copy Markdown
Contributor

@mjwhitta mjwhitta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really nice! I have some little things, most of which are unicode related, but I will let @vanvleeta be the decision maker on unicode in TRRs.

Comment thread reports/trr0000/win/README.md Outdated
Comment thread reports/trr0000/win/README.md Outdated
Comment thread reports/trr0000/win/README.md Outdated
Comment thread reports/trr0000/win/README.md Outdated
Comment thread reports/trr0000/win/README.md Outdated
Comment thread reports/trr0000/win/README.md Outdated
Comment thread reports/trr0000/win/README.md Outdated
Comment thread reports/trr0000/win/README.md Outdated
Comment thread reports/trr0000/win/README.md
Comment thread reports/trr0000/win/README.md Outdated
mjwhitta

This comment was marked as duplicate.

McBeer89 and others added 2 commits March 18, 2026 13:35
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@McBeer89
Copy link
Copy Markdown
Author

Okay! Thank you everyone! I appreciate the feedback. I think I have addressed everything. Looking forward to more review.

McBeer89 and others added 5 commits March 21, 2026 16:45
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants