HTTP Traffic
Last updated
Was this helpful?
Last updated
Was this helpful?
HTTP or Hypertext Transfer Protocol is a commonly used port for the world wide web and used by some websites, however, its encrypted counterpart: HTTPS is more common which we will discuss in the next text. HTTP is used to send GET and POST requests to a web server in order to receive things like webpages. Knowing how to analyze HTTP can be helpful to quickly spot things like SQLi, Web Shells, and other web-related attack vectors.
HTTP Traffic Overview
You should already have a general understanding of how HTTP works before completing this room; however, if you need a refresher you can read the official paper by the IETF on HTTP methods.
HTTP is one of the most straight forward protocols for packet analysis, the protocol is straight to the point and does not include any handshakes or prerequisites before communication.
Above we can see a sample HTTP packet, looking at an HTTP packet we can easily gather information since the data stream is not encrypted like the HTTP counterpart HTTPS. Some of the important information we can gather from the packet is the Request URI, File Data, Server.
Now that we understand the basic structure of an HTTP packet we can move on to looking at a sample HTTP packet capture to get hands-on with the packets.
Practical HTTP Packet Analysis
To get an understanding of the flow of HTTP packets and get hands-on with the packets, we can analyze the http.cap file provided by Wireshark. Download the needed file from the task or directly from the Wireshark website.
After opening the PCAP we can see that this is just a simple HTTP packet capture with a few requests.
Navigating deeper into the packet capture we can look at the details of one of the HTTP requests for example packet 4.
From this packet we can identify some very important information like the host, user-agent, requested URI, and response.
We can use some of Wireshark's built-in features to help digest all of this data and organize it for further future analysis. We can begin by looking at a very useful feature in Wireshark to organize the protocols present in a capture the Protocol Hierarchy. Navigate to Statistics > Protocol Hierarchy.
This information can be very useful in practical applications like threat hunting to identify discrepancies in packet captures.
The next feature in Wireshark we will look at is the Export HTTP Object. This feature will allow us to organize all requested URIs in the capture. To use Export HTTP Object navigate to file > Export Objects > HTTP.
Similar to the Protocol Hierarchy this can be useful to quickly identify possible discrepancies in captures.
The last feature we will cover in this section of this room is Endpoints. This feature allows the user to organize all endpoints and IPs found within a specific capture. Just like the other features, this can be useful to identify where a discrepancy is originating from. To use the Endpoints feature navigate to Statistics > Endpoints.
HTTP is not a common protocol to see too much as HTTPS is now more commonly used; however, HTTP is still used often and can be very easy to analyze if given the opportunity.
What percent of packets originate from Domain Name System?
What endpoint ends in .237?
What is the user-agent listed in packet 4?
Looking at the data stream what is the full request URI from packet 18?
What domain name was requested from packet 38?
Looking at the data stream what is the full request URI from packet 38?