liveBook · Manning

Apache

As explained in Cyber Threat Hunting

Apache HTTP Server is an open-source web server that handles HTTP requests and serves web resources.

Apache HTTP Server is an open-source web server whose access events record HTTP requests, status codes, paths, methods, timestamps, and user agents. These fields support threat hunting for suspicious uploads and web requests. section 4.2.1

A practical Apache investigation workflow:

  • Collect raw access logs from /var/log/apache2/access.log and parse them as access_combined events in a central data store. section 4.2.1
  • Search successful requests for filenames and suspicious upload-directory paths, then sort results chronologically. section 4.2.1
  • Decode URL-encoded and Base64 query values to expose commands embedded in request paths. section 4.2.1

Malicious upload investigation

Requests to a WordPress plugin upload directory accessed project-plan.php with encoded parameters. Decoding revealed whoami, download commands using wget or curl, netcat activity, and execution of a downloaded file. section 4.2.1

Listing 4.2 Sample Apache2 web access event in JSON format
{
  "@timestamp": "2021-12-31T07:05:54.000Z",
  "date": "31/Dec/2021:07:05:54",
  "host": {
    "name": "portal"                                          #1
  },
  "index": "default",
  "ip": "10.76.2.1",                                          #2
  "length": "9637",                                           #3
  "path": "/wp-admin/ HTTP/1.1",                              #4
  "remote_log_name": "-",
  "request_method": "GET",                                    #5
  "source": "/var/log/access.log",                            #6
  "sourcetype": "access_combined",                            #7
  "status": "200",                                            #8
  "timezone": "+0000",
  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)
   AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1
   Safari/605.1.15",                                          #9
  "userid": "-"         
}

Inspect a parsed Apache access event and its timestamp, path, request method, source, status, and user-agent fields. section 4.2.1

How Cyber Threat Hunting covers it

How deep it goes
Explains event fields and demonstrates searches and decoding, but stops short of server configuration or request-processing internals.
Examples
Uses WordPress upload paths, PHP filenames, encoded query parameters, and decoded shell commands as investigation artifacts.
What it assumes
Assumes familiarity with web access logs and search tools while teaching event fields and upload-focused hunting from examples.
What you can do after
Diagnose suspicious web activity by searching, parsing, decoding, and timeline-sorting Apache access events.
How it connects
Connects Apache with HTTP requests, web server logs, WordPress, threat hunting, Splunk, Humio, Elasticsearch, and Base64 decoding.

Also explained in

Compare how 2 books explain Apache →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Cyber Threat Hunting. The section links point to the parts of the book it draws on.