File tree 3 files changed +29
-1
lines changed
plaso/parsers/text_plugins
tests/parsers/text_plugins
3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,9 @@ class WinIISTextPlugin(interface.TextPlugin):
114
114
_UA = pyparsing .Word (
115
115
pyparsing .alphanums + _URI_SAFE_CHARACTERS + '[]' ) | _BLANK
116
116
117
+ _COOKIE = pyparsing .Word (
118
+ pyparsing .alphanums + _URI_SAFE_CHARACTERS + '@{}"\\ ' ) | _BLANK
119
+
117
120
# Per https://blogs.iis.net/nazim/use-of-special-characters-like-in-an-iis-url
118
121
# IIS does not require that a query comply with RFC1738 restrictions on valid
119
122
# URI characters
@@ -204,7 +207,7 @@ class WinIISTextPlugin(interface.TextPlugin):
204
207
_LOG_LINE_STRUCTURES ['time-taken' ] = _INTEGER .set_results_name ('time_taken' )
205
208
_LOG_LINE_STRUCTURES ['cs-version' ] = _URI .set_results_name ('protocol_version' )
206
209
_LOG_LINE_STRUCTURES ['cs-host' ] = _URI .set_results_name ('cs_host' )
207
- _LOG_LINE_STRUCTURES ['cs(Cookie)' ] = _URI .set_results_name ('cs_cookie' )
210
+ _LOG_LINE_STRUCTURES ['cs(Cookie)' ] = _COOKIE .set_results_name ('cs_cookie' )
208
211
_LOG_LINE_STRUCTURES ['cs(Referrer)' ] = _URI .set_results_name ('cs_referrer' )
209
212
_LOG_LINE_STRUCTURES ['cs(Referer)' ] = _URI .set_results_name ('cs_referrer' )
210
213
Original file line number Diff line number Diff line change
1
+ #Date: 2021-04-01 00:00:21
2
+ #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Cookie) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
3
+ #Software: Microsoft Internet Information Services 10.0
4
+ #Version: 1.0
5
+ 2021-04-01 00:00:21 111.111.111.111 GET /foo/bar/baz.asp - 80 - 222.222.222.222 Mozilla/5.0+(Windows+NT+5.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/35.0.2309.372+Safari/537.36 OutlookSession="{AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE}" http://111.111.111.111/ 200 0 0 65
6
+ 2021-04-01 00:00:21 111.111.111.111 GET /foo/bar/baz.asp - 80 - 222.222.222.222 Mozilla/5.0+(Windows+NT+5.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/35.0.2309.372+Safari/537.36 username=realm\user http://111.111.111.111/ 200 0 0 65
7
+ 2021-04-01 00:00:21 111.111.111.111 GET /foo/bar/baz.asp - 80 - 222.222.222.222 Mozilla/5.0+(Windows+NT+5.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/35.0.2309.372+Safari/537.36 username=realm@user http://111.111.111.111/ 200 0 0 65
Original file line number Diff line number Diff line change @@ -186,6 +186,24 @@ def testProcessWithIIS10Log(self):
186
186
'recovery_warning' )
187
187
self .assertEqual (number_of_warnings , 0 )
188
188
189
+ def testProcessWithIIS10LogAndCookieField (self ):
190
+ """Tests the Process function with an IIS 10 log file and cs(Cookie)."""
191
+ plugin = iis .WinIISTextPlugin ()
192
+ storage_writer = self ._ParseTextFileWithPlugin (
193
+ ['iis10_cookies.log' ], plugin )
194
+
195
+ number_of_event_data = storage_writer .GetNumberOfAttributeContainers (
196
+ 'event_data' )
197
+ self .assertEqual (number_of_event_data , 3 )
198
+
199
+ number_of_warnings = storage_writer .GetNumberOfAttributeContainers (
200
+ 'extraction_warning' )
201
+ self .assertEqual (number_of_warnings , 0 )
202
+
203
+ number_of_warnings = storage_writer .GetNumberOfAttributeContainers (
204
+ 'recovery_warning' )
205
+ self .assertEqual (number_of_warnings , 0 )
206
+
189
207
190
208
if __name__ == '__main__' :
191
209
unittest .main ()
You can’t perform that action at this time.
0 commit comments