<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Powershell Digital Forensics Archives - Tech Chronicles</title>
	<atom:link href="http://kostacipo.stream/tag/powershell-digital-forensics/feed/" rel="self" type="application/rss+xml" />
	<link>http://kostacipo.stream/tag/powershell-digital-forensics/</link>
	<description>Ramblings of a Tech Dude</description>
	<lastBuildDate>Wed, 21 Feb 2024 23:49:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>

<image>
	<url>https://kostacipo.stream/wp-content/uploads/2019/12/cropped-profile-32x32.jpg</url>
	<title>Powershell Digital Forensics Archives - Tech Chronicles</title>
	<link>http://kostacipo.stream/tag/powershell-digital-forensics/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Powershell Digital Forensics And Incident Response (DFIR) – Leveraging Scripts For Effective Cybersecurity</title>
		<link>http://kostacipo.stream/powershell-digital-forensics-and-incident-response-dfir-leveraging-scripts-for-effective-cybersecurity/</link>
					<comments>http://kostacipo.stream/powershell-digital-forensics-and-incident-response-dfir-leveraging-scripts-for-effective-cybersecurity/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Wed, 21 Feb 2024 23:49:00 +0000</pubDate>
				<category><![CDATA[Cybersecurity]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Wargames]]></category>
		<category><![CDATA[Powershell Digital Forensics]]></category>
		<guid isPermaLink="false">https://kostacipo.stream/?p=2181</guid>

					<description><![CDATA[<p>This repository contains multiple PowerShell scripts that can help you respond to cyber attacks on Windows Devices. The following Incident Response scripts are included: DFIR Script: Collects all items as listed in section DFIR Script. CollectWindowsEvents: Collects all Windows events and outputs it as CSV. CollectWindowsSecurityEvents: Collects all Windows security events and outputs it as CSV. [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/powershell-digital-forensics-and-incident-response-dfir-leveraging-scripts-for-effective-cybersecurity/">Powershell Digital Forensics And Incident Response (DFIR) – Leveraging Scripts For Effective Cybersecurity</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This repository contains multiple PowerShell scripts that can help you respond to cyber attacks on Windows Devices.</p>
<p>The following Incident Response scripts are included:</p>
<ul>
<li><a href="https://github.com/Bert-JanP/Incident-Response-Powershell/blob/main/DFIR-Script.ps1" target="_blank" rel="noreferrer noopener nofollow">DFIR Script</a>: Collects all items as listed in section <a href="https://github.com/Bert-JanP/Incident-Response-Powershell#dfir-script" target="_blank" rel="noreferrer noopener nofollow">DFIR Script</a>.</li>
<li><a href="https://github.com/Bert-JanP/Incident-Response-Powershell/blob/main/Scripts/CollectWindowsEvents.ps1" target="_blank" rel="noreferrer noopener nofollow">CollectWindowsEvents</a>: Collects all Windows events and outputs it as CSV.</li>
<li><a href="https://github.com/Bert-JanP/Incident-Response-Powershell/blob/main/Scripts/CollectWindowsSecurityEvents.ps1" target="_blank" rel="noreferrer noopener nofollow">CollectWindowsSecurityEvents</a>: Collects all Windows security events and outputs it as CSV.</li>
<li><a href="https://github.com/Bert-JanP/Incident-Response-Powershell/blob/main/Scripts/CollectPnPDevices.ps1" target="_blank" rel="noreferrer noopener nofollow">CollectPnPDevices</a>: Collects all Plug and Play devices, such as USB, Network and Storage.</li>
<li><a href="https://github.com/Bert-JanP/Incident-Response-Powershell/blob/main/Scripts/DumpLocalAdmins.ps1" target="_blank" rel="noreferrer noopener nofollow">DumpLocalAdmins</a>: Returns all local admins of a device.</li>
<li><a href="https://github.com/Bert-JanP/Incident-Response-Powershell/blob/main/Scripts/LastLogons.ps1" target="_blank" rel="noreferrer noopener nofollow">LastLogons</a> – List the last N successful logins of a device.</li>
<li><a href="https://github.com/Bert-JanP/Incident-Response-Powershell/blob/main/Scripts/ListInstalledSecurityProducts.ps1" target="_blank" rel="noreferrer noopener nofollow">ListInstalledSecurityProducts</a> – List the installed security products and their status.</li>
<li><a href="https://github.com/Bert-JanP/Incident-Response-Powershell/blob/main/Scripts/ListDefenderExclusions.ps1" target="_blank" rel="noreferrer noopener nofollow">ListDefenderExclusions</a> – List the FolderPath, FileExtension, Process and IP exclusions that are defined.</li>
</ul>
<h2 class="wp-block-heading"><strong>DFIR Script – Extracted Artefacts</strong></h2>
<p>The <a href="https://github.com/Bert-JanP/Incident-Response-Powershell/blob/main/DFIR-Script.ps1" target="_blank" rel="noreferrer noopener nofollow">DFIR script</a> collects information from multiple sources and structures the output in the current directory in a folder named ‘DFIR-hostname-year-month-date’.</p>
<p>This folder is zipped at the end, so that folder can be remotely collected. This script can also be used within Defender For Endpoint in a Live Response session (see below).</p>
<p>The DFIR script collects the following information when running as normal user:</p>
<ul>
<li>Local IP Info</li>
<li>Open Connections</li>
<li>Aautorun Information (Startup Folder &amp; Registry Run keys)</li>
<li>Active Users</li>
<li>Local Users</li>
<li>Connections Made From Office Applications</li>
<li>Active SMB Shares</li>
<li>RDP Sessions</li>
<li>Active Processes</li>
<li>Active USB Connections</li>
<li>Powershell History</li>
<li>DNS Cache</li>
<li>Installed Drivers</li>
<li>Installed Software</li>
<li>Running Services</li>
<li>Scheduled Tasks</li>
<li>Browser history and profile files</li>
</ul>
<p>For the best experience run the script as admin, then the following items will also be collected:</p>
<ul>
<li>Windows Security Events</li>
<li>Remotely Opened Files</li>
<li>Shadow Copies</li>
<li>MPLogs</li>
<li>Defender Exclusions</li>
</ul>
<h2 class="wp-block-heading"><strong>SIEM Import Functionality</strong></h2>
<p>The forensic artefacts are exported as CSV files, which allows responders to ingest them into their tooling. Some example tools in which you can ingest the data are Sentinel, Splunk, Elastic or Azure Data Explorer. This will allow you to perform filtering, aggregation and visualisation with your preferred query language.</p>
<p>The folder <em>CSV Results (SIEM Import Data)</em> includes all the CSV files containing the artefacts, the folder listing is shown below.</p>
<pre class="wp-block-code"><code>Name
----
ActiveUsers.csv
AutoRun.csv
ConnectedDevices.csv
DefenderExclusions.csv
DNSCache.csv
Drivers.csv
InstalledSoftware.csv
IPConfiguration.csv
LocalUsers.csv
NetworkShares.csv
OfficeConnections.csv
OpenTCPConnections.csv
PowerShellHistory.csv
Processes.csv
RDPSessions.csv
RemotelyOpenedFiles.csv
RunningServices.csv
ScheduledTasks.csv
ScheduledTasksRunInfo.csv
SecurityEvents.csv
ShadowCopy.csv
SMBShares.csv</code></pre>
<h2 class="wp-block-heading"><strong>DFIR Commands</strong></h2>
<p>The <a href="https://github.com/Bert-JanP/Incident-Response-Powershell/blob/main/DFIR-Commands.md" target="_blank" rel="noreferrer noopener nofollow">DFIR Commands page</a> contains invidividual powershell commands that can be used during your incident response process. The follwing catagories are defined:</p>
<ul>
<li>Connections</li>
<li>Persistence</li>
<li>Windows Security Events</li>
<li>Processes</li>
<li>User &amp; Group Information</li>
<li>Applications</li>
<li>File Analysis</li>
<li>Collect IOC Information</li>
</ul>
<h2 class="wp-block-heading"><strong>Windows Usage</strong></h2>
<p>The script can be excuted by running the following command.</p>
<pre class="wp-block-code"><code>.\DFIR-Script.ps1</code></pre>
<p>The script is unsigned, that could result in having to use the -ExecutionPolicy Bypass to run the script.</p>
<pre class="wp-block-code"><code>Powershell.exe -ExecutionPolicy Bypass .\DFIR-Script.ps1</code></pre>
<h2 class="wp-block-heading"><strong>DFIR Script | Defender For Endpoit Live Response Integration</strong></h2>
<p>It is possible to use the DFIR Script in combination with the Defender For Endpoint Live Repsonse. Make sure that Live Response is setup (See DOCS). Since my script is usigned a setting change must be made to able to run the script.</p>
<p>There is a blog article available that explains more about how to leverage Custom Script in Live Response: <a href="https://kqlquery.com/posts/leveraging-live-response/" target="_blank" rel="noreferrer noopener nofollow">Incident Response Part 3: Leveraging Live Response</a></p>
<p>To run unsigned scripts live Response:</p>
<ul>
<li>Security.microsoft.com</li>
<li>Settings</li>
<li>Endpoints</li>
<li>Advanced Features</li>
<li>Make sure that Live Response is enabled</li>
<li>If you want to run this on a server enable live resonse for servers</li>
<li>Enable Live Response unsigened script execution</li>
</ul>
<p>Execute script:</p>
<ul>
<li>Go to the device page</li>
<li>Initiate Live Response session</li>
<li>Upload File to library to upload script</li>
<li>After uploading the script to the library execute: <code>run DFIR-script.ps1</code> to start the script.</li>
<li>Execute <code>getfile DFIR-DeviceName-yyyy-mm-dd</code> to download the retrieved artifacts to your local machine for analysis.</li>
</ul>
<h2 class="wp-block-heading"><strong>Docs</strong></h2>
<ul>
<li><a href="https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/live-response?view=o365-worldwide" target="_blank" rel="noreferrer noopener nofollow">Microsoft Documentation Live Response</a></li>
<li><a href="https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/user-roles?view=o365-worldwide" target="_blank" rel="noreferrer noopener nofollow">DFE User permissions</a></li>
<li><a href="https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/advanced-features?view=o365-worldwide#live-response" target="_blank" rel="noreferrer noopener nofollow">Defender For Endpoint Settings Live Response</a></li>
</ul>
<p>The post <a href="http://kostacipo.stream/powershell-digital-forensics-and-incident-response-dfir-leveraging-scripts-for-effective-cybersecurity/">Powershell Digital Forensics And Incident Response (DFIR) – Leveraging Scripts For Effective Cybersecurity</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/powershell-digital-forensics-and-incident-response-dfir-leveraging-scripts-for-effective-cybersecurity/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
