Begin Blog: 10:54am EST
I cannot remember the last time I actually reviewed FTP logs…. The layout of the ISS FTP log format (W3C) is well documented, but that was not the issue today. We are reviewing about two months’ worth of logs to try to organize and understand what happened, which was not intuitive at first. Here are my notes on how I went about parsing and presenting these logs:
The FTP Session Identifier
Each unique FTP session has a session identifier within the logs, annotated within the cs-method field within square brackets. For example, the below would show three unique sessions within a particular log: 860, 861, and 862. Ok, this is not particularly hard to figure out, every new FTP session increments the session identifier and the more session identifiers there are for a session, the more stuff was done:
05:05:00 18.104.22.168 USER seahorse 331 0
05:05:00 22.214.171.124 PASS – 230 0
05:05:00 126.96.36.199 CWD W3SVC998877654 250 0
05:05:00 188.8.131.52 QUIT – 226 0
05:07:00 184.108.40.206 USER seahorse 331 0
05:07:00 220.127.116.11 PASS – 230 0
05:07:00 18.104.22.168 CWD W3SVC9988776545 250 0
05:07:03 22.214.171.124 QUIT – 226 0
05:09:03 126.96.36.199 USER seahorse 331 0
05:09:03 188.8.131.52 PASS – 230 0
05:09:03 184.108.40.206 CWD W3SVC998877654 250 0
05:09:03 220.127.116.11 QUIT – 226 0
Group by Session and Then by FTP Method:
Next, parse out each unique FTP session. There are so many ways to accomplish this; I simply pulled out and sorted each session identifier and ran this through a bash script to extract each FTP session into its own directory – think of a while loop that takes session identifiers as input and for each unique value, dumps those entries into separate file and directory structures.
You can get as creative as you want when parsing. For example, my naming convention for each unique sessions was as follows: “SESSION COUNT-SESSION NUMBER-METHODS.LOG”. I chose this naming so I could quickly see which sessions were the heavy hitters and which had methods (user actions) that interested me:
Incorporate FTP Actions Into SIFT-Like Timeline
Now let’s take our output and integrate this into a worksheet that is color organized by user-action (the FTP method) and by session. This will give the analyst an idea, at a glance, of which sessions involved creation of files, or deletion of files, etc.
Can you kind of see what happened?
End Blog: 10:59AM EST: Time elapsed, 5 minutes.