<?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 How to write a regex to cover few options? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647731#M224166</link>
    <description>&lt;P&gt;Hi people,&lt;/P&gt;
&lt;P&gt;I need help designing a regex that will cover the below strings, please.&lt;/P&gt;
&lt;P&gt;------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;wmic useraccount get /ALL /format:csv&lt;/P&gt;
&lt;P&gt;wmic process get caption,executablepath,commandline /format:csv&lt;/P&gt;
&lt;P&gt;wmic qfe get description,installedOn /format:csv&lt;/P&gt;
&lt;P&gt;wmic /node:"#{node}" service where (caption like "%#{service_search_string}%")&lt;/P&gt;
&lt;P&gt;wmic process call create #{process_to_execute}&lt;/P&gt;
&lt;P&gt;wmic process where name='#{process_to_execute}' delete &amp;gt;nul 2&amp;gt;&amp;amp;1&lt;/P&gt;
&lt;P&gt;wmic /user:#{user_name} /password:#{password} /node:"#{node}" process call create #{process_to_execute}&lt;/P&gt;
&lt;P&gt;wmic /user:#{user_name} /password:#{password} /node:"#{node}" process where name='#{process_to_execute}' delete &amp;gt;nul 2&amp;gt;&amp;amp;1&lt;/P&gt;
&lt;P&gt;wmic /node:#{node} process call create "rundll32.exe #{dll_to_execute} #{function_to_execute}"&lt;/P&gt;
&lt;P&gt;wmic /node:"#{node}" product where "name like '#{product}%%'" call uninstall&lt;/P&gt;
&lt;P&gt;----------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jun 2023 10:51:32 GMT</pubDate>
    <dc:creator>DanAlexander</dc:creator>
    <dc:date>2023-06-22T10:51:32Z</dc:date>
    <item>
      <title>How to write a regex to cover few options?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647731#M224166</link>
      <description>&lt;P&gt;Hi people,&lt;/P&gt;
&lt;P&gt;I need help designing a regex that will cover the below strings, please.&lt;/P&gt;
&lt;P&gt;------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;wmic useraccount get /ALL /format:csv&lt;/P&gt;
&lt;P&gt;wmic process get caption,executablepath,commandline /format:csv&lt;/P&gt;
&lt;P&gt;wmic qfe get description,installedOn /format:csv&lt;/P&gt;
&lt;P&gt;wmic /node:"#{node}" service where (caption like "%#{service_search_string}%")&lt;/P&gt;
&lt;P&gt;wmic process call create #{process_to_execute}&lt;/P&gt;
&lt;P&gt;wmic process where name='#{process_to_execute}' delete &amp;gt;nul 2&amp;gt;&amp;amp;1&lt;/P&gt;
&lt;P&gt;wmic /user:#{user_name} /password:#{password} /node:"#{node}" process call create #{process_to_execute}&lt;/P&gt;
&lt;P&gt;wmic /user:#{user_name} /password:#{password} /node:"#{node}" process where name='#{process_to_execute}' delete &amp;gt;nul 2&amp;gt;&amp;amp;1&lt;/P&gt;
&lt;P&gt;wmic /node:#{node} process call create "rundll32.exe #{dll_to_execute} #{function_to_execute}"&lt;/P&gt;
&lt;P&gt;wmic /node:"#{node}" product where "name like '#{product}%%'" call uninstall&lt;/P&gt;
&lt;P&gt;----------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 10:51:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647731#M224166</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-06-22T10:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need a regex to cover few options</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647733#M224167</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240690"&gt;@DanAlexander&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand:&lt;/P&gt;&lt;P&gt;these are the full events or part of the that you want to extract?&lt;/P&gt;&lt;P&gt;could you share the full events, highlighting the fields to extract?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 08:41:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647733#M224167</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-21T08:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need a regex to cover few options</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647734#M224168</link>
      <description>&lt;P&gt;Thanks for the swift reply&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me put more context on what I am trying to achieve.&lt;/P&gt;&lt;P&gt;All the above strings represent Atomic-Red-Team pen test exercises.&lt;/P&gt;&lt;P&gt;Instead of having 10 notables I am trying to collate them all into a single notable that can catch and alert on any of the CMD commands above executed on an endpoint. I have SysMon up and running for testing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 08:46:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647734#M224168</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-06-21T08:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need a regex to cover few options</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647744#M224170</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240690"&gt;@DanAlexander&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;ok, but I don't see a timestamp in each event and there isn't any value to use as key to group events.&lt;/P&gt;&lt;P&gt;Are they the full events or a part of them, if they aren't the full events, please share them,&lt;/P&gt;&lt;P&gt;otherwise, are they in the same source file?&lt;BR /&gt;in other words, what can I use to group them?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 09:17:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647744#M224170</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-21T09:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need a regex to cover few options</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647745#M224171</link>
      <description>&lt;P&gt;Apologies,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should have been more clear.&lt;/P&gt;&lt;P&gt;These are CMD command line executables. They are not events&lt;/P&gt;&lt;P&gt;I am trying to create a notable containing regex that would catch on all attempts from the "bad" guys braking into the network.&lt;/P&gt;&lt;P&gt;I am attempting to create a search and convert it into a notable&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 09:20:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647745#M224171</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-06-21T09:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need a regex to cover few options</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647746#M224172</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240690"&gt;@DanAlexander&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;ok, let me understand: do you already have these commands as events or do you need to catch them and transform them in events that can be searched using a search?&lt;/P&gt;&lt;P&gt;If you already have, please share the raw logs.&lt;/P&gt;&lt;P&gt;If you haven't, I don't know how to help you, maybe Splunk Stream or the firewall logs can catch these messages in the network traffic.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 09:26:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647746#M224172</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-21T09:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need a regex to cover few options</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647749#M224174</link>
      <description>&lt;P&gt;Let me simplify it, please&lt;/P&gt;&lt;P&gt;Imagine I am the bad guy seating end executing these commands against my machine.&lt;/P&gt;&lt;P&gt;I need to get alerts about each malicious attempt.&lt;/P&gt;&lt;P&gt;The command lines are not events nor logs, they do not exist.&lt;/P&gt;&lt;P&gt;After creating a single notable to alert then I can fire up these commands to test if the notable alerts really.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 09:32:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647749#M224174</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-06-21T09:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need a regex to cover few options</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647751#M224176</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240690"&gt;@DanAlexander&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as I said, you are in a previous moment then the alert creation: you have to understand how to catch the commands from your workstation.&lt;/P&gt;&lt;P&gt;If e.g. you are on a linux system, you could read the history files catching in this way all the used commands so you can search them in an alert (using the Splunk_TA-Linux and enabling the history capture).&lt;/P&gt;&lt;P&gt;In which environment do you want to trace commands?&lt;/P&gt;&lt;P&gt;you have to analyze the environment you're using to understand how to trace commands.&lt;/P&gt;&lt;P&gt;I'll try to help you, but probably I will not able, but I'll try!&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 09:45:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647751#M224176</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-21T09:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need a regex to cover few options</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647753#M224177</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let us approach this from a different angle.&lt;/P&gt;&lt;P&gt;Would you be able to put all the searches as they are in maybe regex101 and create a regex that can match them all if that is possible, please?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 09:56:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647753#M224177</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-06-21T09:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need a regex to cover few options</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647755#M224178</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240690"&gt;@DanAlexander&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as I said, without the full events (raw logs) it isn't possible to create a regex.&lt;/P&gt;&lt;P&gt;In addition, you should indicate what you need to extract from the raw logs.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 10:00:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regex-to-cover-few-options/m-p/647755#M224178</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-21T10:00:11Z</dc:date>
    </item>
  </channel>
</rss>

