← All Threat Hunting ReportsThreat Hunting Exercise

Threat Hunting Exercise: Analyzing IDS Web Shell Upload File Extension Signature Dataset

This hunt uses a simulated IDS/IPS and web-application-firewall dataset (ids_webshell_upload_2022-11-12T163000.json) capturing T1505.003: Server Software Component: Web Shell, where an attacker exploits an unrestricted file-upload vulnerability to place an executable web shell (disguised via double extension or content-type spoofing) on a public-facing web server.

Step 1: Hypothesis Formation

Hypothesis: A file-upload request to a public-facing web application uploads a file with a server-executable extension (.php, .aspx, .jsp) or a disguised double extension (.jpg.php), followed shortly by a direct HTTP GET/POST request to that same uploaded filename, indicating successful web shell placement and immediate first use. Indicators:

Null Hypothesis: A developer or authorized administrator is legitimately deploying a server-side script component through an approved change-management/CI-CD process. Invalidate by checking the source IP against the deployment pipeline's known egress ranges and cross-referencing an approved change ticket.

Rationale: Because many web applications only validate file extensions or MIME type superficially (or not at all) on upload endpoints, correlating the upload event with an immediate direct-access request to the same path is the most reliable way to distinguish a web shell drop from a false-positive extension match on benign content.

Step 2: Data Sources and Scope

Step 3: Key Findings

Parsed events (5 shown) confirm an external actor uploaded a disguised PHP web shell through an avatar-upload endpoint and executed a command via it within 90 seconds.

Timestamp (UTC)HostEventDetailIOC/Why Suspicious?
2022-11-12 16:30:11www.corp-portalWAF (upload inspection)POST /avatar/upload, filename profile.jpg.php, Content-Type: image/jpeg (spoofed)Double-Extension IOC: the .jpg.php naming pattern is a well-known technique to bypass extension allow-lists that only check the string "jpg" is present, while the server still executes it as PHP.
2022-11-12 16:30:12www.corp-portal(Filesystem event)New file created: /var/www/uploads/avatars/profile.jpg.php, 4.1 KB, permissions 644Placement IOC: the upload directory is web-accessible and the file was written with execute-eligible permissions for the web server user.
2022-11-12 16:31:38www.corp-portalWeb Access LogGET /uploads/avatars/profile.jpg.php?c=whoami, status 200, response 312 bytesImmediate-Use IOC: a direct request to the just-uploaded file, carrying a ?c= command parameter, occurred within 90 seconds - consistent with automated shell verification, not a normal image-rendering request.
2022-11-12 16:31:38www.corp-portalWeb Access Log (response body sample)Response body contains a single line matching a Linux command-output pattern (uid/gid string) rather than JPEG binary dataExecution-Confirmation IOC: an image URL returning plaintext command output confirms the file is executing as server-side code, not being served as an image.
--(Change-ticket check)No change-management ticket exists authorizing file changes to the avatar-upload path in this windowConfirms this was not an authorized deployment or maintenance activity.

Validation:

Step 4: Recommendations & Next Steps

Hypothesis confirmed - an external actor exploited an avatar-upload endpoint to plant a disguised PHP web shell and confirmed remote command execution against it within 90 seconds of the upload!