{"id":3130,"date":"2020-11-01T16:55:35","date_gmt":"2020-11-01T15:55:35","guid":{"rendered":"https:\/\/kudzia.eu\/b\/?p=3130"},"modified":"2020-11-01T16:57:58","modified_gmt":"2020-11-01T15:57:58","slug":"spooky-http-requests-arriving-from-the-dark-corners-of-the-internet","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2020\/11\/spooky-http-requests-arriving-from-the-dark-corners-of-the-internet\/","title":{"rendered":"spooky HTTP requests arriving from the dark corners of the internet"},"content":{"rendered":"<p>i&#8217;ve spent most of the last week investigating spooky HTTP request that we&#8217;ve found in access logs of few production servers. very likely that traffic was replayed by mail content scanners used by messagelabs and mimecast.<\/p>\n<p><!--more--><\/p>\n<p>all started with java exception popping up in our access logs:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;2020-10-23 08:19:04,037] &#x5B;qtp306206744-300170] bla.servlet.ServletName - 400: Unable to parse URI query\r\norg.eclipse.jetty.http.BadMessageException: 400: Unable to parse URI query\r\n&#x5B;..]\r\nCaused by: java.lang.IllegalArgumentException: Not valid encoding '%2S'\r\n<\/pre>\n<p>surely enough there was accompanying HTTP call that included the unexpected <b>%2S<\/b>:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n69.174.91.34 - - &#x5B;23\/Oct\/2020:08:19:04 +0000] &quot;GET \/whatever\/SomeServlet?param1=npgvba&amp;paramt2=nopqrnopqr&amp;param3=%2Sfbzr%2Scngu%2S HTTP\/1.1&quot; 503 5 &quot;-&quot; &quot;Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko&quot; 0.067 0.064 TLSv1.2\/ECDHE-RSA-AES256-GCM-SHA384\r\n<\/pre>\n<p>SomeServlet is our valid servlet; param1, param2, param3 &#8211; are all valid parameter names for that servlet. But values of all 3 parameters were nonsense, and &#8211; in case of param3 &#8211; not even valid url-encoding.<\/p>\n<p>grepping through logs showed more similar requests arriving from few dozens of IPs. all of those IPs were in 6 \/24 subnets: 173.205.33.0\/24, 4.53.111.0\/24, 69.174.91.0\/24, 70.39.129.0\/24, 77.67.20.0\/24, 77.67.54.0\/24 &#8211; most hosted by GTT, one &#8211; by Level3. needless to say their abuse e-mails did not respond to us in any way.<\/p>\n<p>with help from colleagues we&#8217;ve found that most of the requests from those IPs had time correlation with mails coming to us or being sent by us; those mails contained urls that were requested. some of the URLs were called in the original form, including parameters; other had parameter values ROT13&#8217;ed &#8211; as in the example above. <\/p>\n<p>SomeServlet?param1=<b>npgvba<\/b>&#038;paramt2=<b>nopqrnopqr<\/b>&#038;param3=<b>%2Sfbzr%2Scngu%2S<\/b> after decrypting becomes SomeServlet?param1=<b>action<\/b>&#038;paramt2=<b>abcdeabcde<\/b>&#038;param3=<b>%2Fsome%2Fpath%2F<\/b> &#8211; and that was very familiar to us.<\/p>\n<p>we&#8217;ve found a common pattern for most of mails that correlated with strange HTTP calls. for mails that arrived via messagelabs mail security service we&#8217;ve seen mostly this order of events:<\/p>\n<ul>\n<li>for incoming mails: HTTP request arrives to our servers, few seconds later our MX receives the message<\/li>\n<li>for outgoing mails: our outgoing server hands over message to MX at message labs, few seconds later HTTP request arrives to our servers<\/li>\n<\/ul>\n<p>in case of mimecast &#8211; it&#8217;s more bizzare &#8211; we usually first received the message and few seconds later got HTTP call referring to URL from the e-mail.<\/p>\n<p>note that it was e-mails from multiple different clients that traveled via the same 3rd party mail inspectors.<\/p>\n<p>mentions of similar discoveries made by others:<\/p>\n<ul>\n<li>https:\/\/medium.com\/@nickbaum\/all-bugs-lead-to-rome-505a1205bb9<\/li>\n<li>https:\/\/serverfault.com\/questions\/573081\/does-anyone-recognize-this-e-mail-sniffer-or-malware-using-rot13-encoding<\/li>\n<li>https:\/\/meta.discourse.org\/t\/invite-tokens-accepted-and-rot13-transformed\/90316<\/li>\n<li>https:\/\/stackoverflow.com\/questions\/32486730\/mangled-url-parameters-in-ie9<\/li>\n<li>https:\/\/security.stackexchange.com\/questions\/48684\/help-investigating-potential-website-attack-url-rewriting-and-rot-13-obfuscatio<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>i&#8217;ve spent most of the last week investigating spooky HTTP request that we&#8217;ve found in access logs of few production servers. very likely that traffic was replayed by mail content scanners used by messagelabs and mimecast.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3130","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=3130"}],"version-history":[{"count":7,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3130\/revisions"}],"predecessor-version":[{"id":3137,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3130\/revisions\/3137"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=3130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=3130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=3130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}