<?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 Re: How to Detect 4 Commands run Within a 1 Second Time Window? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-detect-four-commands-run-within-a-1-second-time-window/m-p/599679#M208725</link>
    <description>&lt;P&gt;The most straightforward method may be&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.5/SearchReference/Transaction#transaction" target="_blank"&gt;transaction&lt;/A&gt;. &amp;nbsp;Since you are looking at a specific tool, I assume that there is an order of execution, e.g.,&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;ListUserPolicies&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;GetCallerIdentity&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;ListGroupsForUser&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;ListAttachedUserPolicies&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;Given these assumptions, you can do something like&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="aws-cloudtrail" "GetCallerIdentity" OR "ListUserPolicies" OR "ListGroupsForUser" OR "ListAttachedUserPolicies"
```| table _time, principalId, userName, aws_account_id, sourceIPAddress, user_agent, command```
| transaction aws_account_id startswith=command=="ListUserPolicies" endswith=command=="ListAttachedUserPolicies" maxspan=1s mvlist=command
| where mvjoin(command, ",") == "ListUserPolicies,GetCallerIdentity,ListGroupsForUser,ListAttachedUserPolicies"&lt;/LI-CODE&gt;&lt;P&gt;maxspan limits elapsed time from the first command to the last command. &amp;nbsp;The where filter is to constrain the order of execution.&lt;/P&gt;</description>
    <pubDate>Sun, 29 May 2022 03:36:15 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2022-05-29T03:36:15Z</dc:date>
    <item>
      <title>How to detect four commands run within a 1 second time window?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-detect-four-commands-run-within-a-1-second-time-window/m-p/599394#M208659</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to create a detection of the AWS exploitation tool Pacu.py.&amp;nbsp;It is to detect the use of the enumeration tool within Pacu.py, which executes the following AWS commands in less than a second:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;ListUserPolicies&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;GetCallerIdentity&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;ListGroupsForUser&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;ListAttachedUserPolicies&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;Timeframe:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;First Event:&amp;nbsp;2022-05-19 10:02:25&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Last Event:&amp;nbsp;2022-05-19 10:02:26&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Each command generates a separate event so I was wondering if it is possible to create a search which detects these command executed from the same account within a 1 second timeframe?&amp;nbsp; I am unsure how to specify a time window so if you could help, that would be greatly appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Query&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;index="aws-cloudtrail" "GetCallerIdentity" OR "ListUserPolicies" OR "&lt;SPAN&gt;ListGroupsForUser" OR "&lt;/SPAN&gt;&lt;SPAN&gt;ListAttachedUserPolicies"&amp;nbsp;&lt;/SPAN&gt;| table _time, principalId, userName, aws_account_id, sourceIPAddress, user_agent, command&lt;/P&gt;
&lt;P&gt;Many Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 23:36:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-detect-four-commands-run-within-a-1-second-time-window/m-p/599394#M208659</guid>
      <dc:creator>garryplewson</dc:creator>
      <dc:date>2022-05-30T23:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to Detect 4 Commands run Within a 1 Second Time Window?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-detect-four-commands-run-within-a-1-second-time-window/m-p/599679#M208725</link>
      <description>&lt;P&gt;The most straightforward method may be&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.5/SearchReference/Transaction#transaction" target="_blank"&gt;transaction&lt;/A&gt;. &amp;nbsp;Since you are looking at a specific tool, I assume that there is an order of execution, e.g.,&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;ListUserPolicies&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;GetCallerIdentity&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;ListGroupsForUser&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;ListAttachedUserPolicies&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;Given these assumptions, you can do something like&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="aws-cloudtrail" "GetCallerIdentity" OR "ListUserPolicies" OR "ListGroupsForUser" OR "ListAttachedUserPolicies"
```| table _time, principalId, userName, aws_account_id, sourceIPAddress, user_agent, command```
| transaction aws_account_id startswith=command=="ListUserPolicies" endswith=command=="ListAttachedUserPolicies" maxspan=1s mvlist=command
| where mvjoin(command, ",") == "ListUserPolicies,GetCallerIdentity,ListGroupsForUser,ListAttachedUserPolicies"&lt;/LI-CODE&gt;&lt;P&gt;maxspan limits elapsed time from the first command to the last command. &amp;nbsp;The where filter is to constrain the order of execution.&lt;/P&gt;</description>
      <pubDate>Sun, 29 May 2022 03:36:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-detect-four-commands-run-within-a-1-second-time-window/m-p/599679#M208725</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-05-29T03:36:15Z</dc:date>
    </item>
  </channel>
</rss>

