<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Why converting hex doesn't work for 1 alert? [solved] in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-converting-hex-doesn-t-work-for-1-alert-solved/m-p/587528#M204614</link>
    <description>&lt;P&gt;EDIT: Solved. Used regex to target the printable portion first then converted to ascii&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a couple dashboards, I'm using the following to display the plain text of hex data:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[search] | eval ascii=(ltrim(replace(data,"([A-F0-9]{2})","%\1"),"0x")) | table ascii&lt;/LI-CODE&gt;&lt;P&gt;This works great for most everything.&lt;/P&gt;&lt;P&gt;However, when using it on snort's&amp;nbsp;ET POLICY ZIP file download events, it gives me nothing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on why this is failing for specifically these alerts?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Things I'm aware of:&lt;/P&gt;&lt;P&gt;zip files are not plaintext. The filenames within them, however, are. The plan is to use regex to locate and extract filenames after.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Things I've confirmed:&lt;/P&gt;&lt;P&gt;The relevant field is labeled as "data" in working and non working examples.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data field contains ONLY hex data&lt;/P&gt;&lt;P&gt;No lowercase, spaces, dashes, etc are used in the data field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data fields do contain the strings I'm trying to extract.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Mar 2022 00:02:31 GMT</pubDate>
    <dc:creator>dantose</dc:creator>
    <dc:date>2022-03-04T00:02:31Z</dc:date>
    <item>
      <title>Why converting hex doesn't work for 1 alert? [solved]</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-converting-hex-doesn-t-work-for-1-alert-solved/m-p/587528#M204614</link>
      <description>&lt;P&gt;EDIT: Solved. Used regex to target the printable portion first then converted to ascii&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a couple dashboards, I'm using the following to display the plain text of hex data:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[search] | eval ascii=(ltrim(replace(data,"([A-F0-9]{2})","%\1"),"0x")) | table ascii&lt;/LI-CODE&gt;&lt;P&gt;This works great for most everything.&lt;/P&gt;&lt;P&gt;However, when using it on snort's&amp;nbsp;ET POLICY ZIP file download events, it gives me nothing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on why this is failing for specifically these alerts?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Things I'm aware of:&lt;/P&gt;&lt;P&gt;zip files are not plaintext. The filenames within them, however, are. The plan is to use regex to locate and extract filenames after.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Things I've confirmed:&lt;/P&gt;&lt;P&gt;The relevant field is labeled as "data" in working and non working examples.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data field contains ONLY hex data&lt;/P&gt;&lt;P&gt;No lowercase, spaces, dashes, etc are used in the data field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data fields do contain the strings I'm trying to extract.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 00:02:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-converting-hex-doesn-t-work-for-1-alert-solved/m-p/587528#M204614</guid>
      <dc:creator>dantose</dc:creator>
      <dc:date>2022-03-04T00:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why converting hex doesn't work for 1 alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-converting-hex-doesn-t-work-for-1-alert-solved/m-p/587533#M204616</link>
      <description>&lt;P&gt;Can you give example of working and non-working contents of data?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 21:17:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-converting-hex-doesn-t-work-for-1-alert-solved/m-p/587533#M204616</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-03T21:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why converting hex doesn't work for 1 alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-converting-hex-doesn-t-work-for-1-alert-solved/m-p/587536#M204619</link>
      <description>&lt;P&gt;Not an actual production example for obvious reasons, but this would be representative:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;0049454E44AE426082504B03041400020008003D6E4B5421BFC68AF27C0100D97C01000C00000043617074757265322E706E67009F4C60B389504E470D0A1A0A0000000D4948445200000204000000F10806000000B4C2AF15000000017352474200AECE1CE90000000467414D410000B18F0BFC6105000000097048597300000EC300000EC301C76FA86400000021744558744372656174696F6E2054696D6500323032323A30323A31312031333A34373A32357BE61C240000FF7849444154785EECFD079C6DD955DF89AF9B2BD7CBAF5F87D7E9756ED1516AB5720689248960F81BF3071BCF60ECB1FD99F90FC6FECC7804181B86F10C607B666CE380B10D260983050809E5DC&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;What I'd expect to get is:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;.IEND®B`.PK........=nKT!¿Æ.ò|..Ù|......Capture2.png..L`³.PNG
.
...
IHDR.......ñ.....´Â¯.....sRGB.®Î.é....gAMA..±..üa....	pHYs...Ã...Ã.Ço¨d...!tEXtCreation Time.2022:02:11 13:47:25{æ.$..ÿxIDATx^ìý..mÙUß.¯.+×Ë¯_.×éunÑQjµr..$.`ø.ó..Ï`ì±ý.ù.ÆþÌx....ñ.`{flã.±
&amp;amp;	...	åÜ&lt;/LI-CODE&gt;&lt;P&gt;from which I can offset from the PK and pull the file name Capture.png&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 21:47:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-converting-hex-doesn-t-work-for-1-alert-solved/m-p/587536#M204619</guid>
      <dc:creator>dantose</dc:creator>
      <dc:date>2022-03-03T21:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why converting hex doesn't work for 1 alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-converting-hex-doesn-t-work-for-1-alert-solved/m-p/587551#M204621</link>
      <description>&lt;P&gt;Looks like I replied to my own post rather than yours.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think it's the excessive amount of non-printable characters that's breaking it. I'm going to try a regex to trim it to the target first.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 23:49:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-converting-hex-doesn-t-work-for-1-alert-solved/m-p/587551#M204621</guid>
      <dc:creator>dantose</dc:creator>
      <dc:date>2022-03-03T23:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why converting hex doesn't work for 1 alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-converting-hex-doesn-t-work-for-1-alert-solved/m-p/587555#M204622</link>
      <description>&lt;P&gt;Ok, I think I've got a solution:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[search]
| rex field=data "504B.{56}(?&amp;lt;target&amp;gt;.{2,100}2E.{6})"
| [previous urldecode solution]&lt;/LI-CODE&gt;&lt;P&gt;That should handle detecting any path/filename.ext up to 50+3.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will still fail to detect files without an extension, but I'm at least at a 90% solution&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 23:59:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-converting-hex-doesn-t-work-for-1-alert-solved/m-p/587555#M204622</guid>
      <dc:creator>dantose</dc:creator>
      <dc:date>2022-03-03T23:59:42Z</dc:date>
    </item>
  </channel>
</rss>

