top of page

Search Results

327 items found for ""

  • Shimcache/Amcache Analysis: Tool-->AppCompactCacheParser.exe/AmcacheParser.exe

    AmcacheParser.exe :- https://github.com/EricZimmerman/AmcacheParser AppCompatCacheParser.exe :- https://github.com/EricZimmerman/AppCompatCacheParser AppCompatCacheParser.exe (Shimcache): can be used to parse an offline SYSTEM hive or to collect data on a live, running system. It currently parses data from Windows 7 and above systems. If a SYSTEM hive is not given the -f switch, the running computer’s AppCompatCache value will be processed. By default, all ControlSets in the SYSTEM hive are queried and processed, ensuring data existing in older control sets is not missed. Commands 1:- AppCompatCacheParser.exe -t -f .\SYSTEM --csv c:\Users\User\Downloads -- csvf results.csv -t  Sorts last modified timestamps in descending order [default: False] -f Full path to SYSTEM hive to process. If this option is not specified, the live Registry will be used. If you have image of endpoint you can specify using -f or Command 2 :- AppCompatCacheParser.exe --csv c:\Users\User\Downloads --csvf results.csv as this artifact is only written to registry upon system shutdown so implication are their for take an example in case of live response or capture memory image because data maybe not written in the registry. So, you can use volatility plugin to extract the artifact from memory in live response. Windows volatility: (You can use ubuntu. I use windows so I have used window plugin) Command 1:- python vol.py -f D:\memdump.mem windows.shimcachemem AmcacheParser.exe: Amcache.hve serves as a rich source of information for forensic analysts, providing insights into the history of applications, drivers, and system activities. The ability to track SHA1 hashes makes Amcache valuable for identifying both known legitimate files (known goods) and potentially malicious or renamed files (known bads). Amcache tracks a variety of information, including installed applications, executed programs, loaded drivers, full path details, file size, publisher metadata, and multiple timestamps Commands 1:- AmcacheParser.exe -i -f "C:\Windows\AppCompat\Programs\Amcache.hve" --csv "C:\Users\User\Downloads\file.csv" -f For path -i include file entries for program entries Interpreting Amcache Data: While Amcache is often categorized under "program execution," it's crucial to recognize that its inclusion in the database doesn't unequivocally indicate execution. Blanche Lagny's research highlights three major categories of files tracked in the latest version of Amcache: Executed (and shimmed) GUI applications. Executables and drivers copied as part of application execution. Executables present in directories scanned by the Microsoft Compatibility Appraiser scheduled task. The first category is directly related to execution, focusing on GUI applications that required shimming for compatibility. However, distinguishing these entries from the other two categories can be challenging, emphasizing the importance of utilizing Amcache as an indicator of executable and driver presence on the system. Conclusion: IAmcache emerges as a powerful artifact in Windows forensics, offering a nuanced perspective on program execution and the presence of drivers. As forensic analysts navigate the evolving landscape of Amcache, understanding its history, data structures, and the intricacies of interpretation becomes paramount. Leveraging Amcache alongside other artifacts, such as Prefetch, can provide a comprehensive view of system activity, aiding in investigations and digital forensic analyses. Akash Patel

  • Prefetch Analysis: Tool-->PECmd.exe

    Prefetching, a process optimizing system performance by loading data into memory before needed, generates valuable artifacts in the form of .pf files. These files, stored in the Prefetch directory, contain embedded timestamps, providing insights into a program's first and last time of execution. First Execution Timestamp: Derived from the creation date of the .pf file (minus 10 seconds). Considered the "first time we know of the file being executed." Last Execution Timestamp: Extracted from the last modification date of the .pf file (minus 10 seconds). Embedded timestamps within the .pf file also capture last execution time(s). Pro Tip: A .pf file's creation doesn't guarantee the program's successful execution. Verification through additional artifacts is crucial, especially when dealing with potentially "broken" programs attempting execution. These techniques, while valuable for forensic analysis, acknowledge the limitations posed by the prefetch entry limit. Leveraging file system timestamps alongside embedded timestamps enriches the understanding of program execution timelines. Tool: PECmd.exe--> (Command for prefetching the directory on live computer and saving into excel/Jason file if you have don't have image or you didn't created) Command 1 - PECmd.exe -d "C:\Windows\Prefetch" --csv "C:\Users\User\Downloads" --csvf output.csv or --json c:\temp\json For fetching particular .pf file using PECmd Command 2 - PECmd.exe -f "C:\Windows\Prefetch\CALC.EXE-3FBEF7FD.pf" Link of tool: https://github.com/EricZimmerman/PECmd Prefetch File Analysis - Examples Volume Information and File Sections: Reveals files opened by the application within the crucial 10 seconds of execution. Includes full path and disk volume details, offering insights into accessed files and potential malicious activity. Discover malicious DLLs or crucial documents accessed by the application. Identify hidden data locations or interesting folders related to the investigation. Parsing Entire Prefetch Directories: PECmd generates two output files for directory parsing. Embedded Information File: Captures run count, last run times, and referenced files for each .pf file. Timeline View File: Presents a timeline of embedded timestamps for easy identification of closely executed items. Both output files are formatted in tab-separated values (TSV) for convenient analysis. By leveraging PECmd, forensic analysts can gain comprehensive visibility into program execution details, aiding in the identification of potential threats and hidden activities. Akash Patel

  • Forensic Collection of Execution Evidence through Prefetch Analysis

    Introduction: In the intricate landscape of digital forensics, one often-overlooked goldmine of information lies within the Windows Prefetch directory. Prefetching: Prefetching is a proactive mechanism employed by the Windows operating system to enhance system performance. It involves loading essential data and code from disk into memory before it is actually needed. As a result, applications can launch faster, optimizing the overall user experience and, leaves a trail of .pf files that can be invaluable for forensic analysts into Prefetch directory. Prefetch Directory Structure: The Prefetch directory maintains a collection of .pf files, each generated after the first execution of an application. Notably, on Windows 7 and earlier versions, the Prefetch directory is limited to 128 files, while Windows 8 and above can accommodate up to 1,024 files. ******Forensic Value of Prefetch Files:***** Prefetch filenames are a combination of the executable file name and a hash of the file's path. These files serve as valuable artifacts, indicating the execution of applications. Embedded within each .pf file are critical details, including the total number of application executions, the original execution path, and the timestamp of the last execution. Enhancements from Windows 8 Onwards: Starting with Windows 8 and continuing through Windows 10, up to eight execution times are stored within each Prefetch file. When coupled with the file system creation time of the .pf file, investigators can glean a comprehensive view of application runtimes, providing nuanced insights into system activities. ******Detecting Anomalies:***** An essential forensic practice involves scrutinizing the Prefetch directory for multiple files with the same executable name. This observation can unveil instances where an executable with the same name was run from different locations, potentially indicating suspicious activity. Exceptions exist for Windows hosting applications like svchost, dllhost, backgroundtaskhost, and rundll32, which may legitimately have multiple Prefetch files due to varied command line arguments. Best Practices for Collection: ****Live response tools executed on a target system trigger the creation of new prefetch files****. Given the limited number of available prefetch files on a system, it is crucial to prioritize the collection of the Prefetch directory during forensic investigations. This precaution ensures the preservation of critical evidence and prevents the inadvertent loss of valuable data. Auditing and Disabling Prefetch: The blog outlines the process of auditing and disabling Prefetch through registry settings. Understanding the registry key Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory ManagementVPrefetchParameters Value: EnablePrefetcher Type: REG DWORD Value: 0 The EnablePrefetcher value has the following settings: 0 = Disabled 1 = Application launch prefetching enabled 2 = Boot prefetching enabled 3 = Application launch and boot enabled To disable Prefetch, set the value to 0. Notes :- Prefetch is only enabled on windows workstations by default, not on server :-Any Valid Svchost.exe process should have -k parameter followed by 1 or more value Conclusion: Unveiling the forensic potential of Windows Prefetch files provides digital investigators with a powerful tool for reconstructing the timeline of application executions. By understanding the structure of prefetch files and adopting best practices for collection, forensic analysts can harness this rich source of information to unravel the intricate details of system activities and identify potential security threats. Akash Patel

  • Part 2 -(WMI) :Detecting WMI-Based Attacks

    In this blog post, we will delve into the significance of detecting WMI-based attacks and explore techniques to defend against them. Command Line Auditing: A Game-Changer The absence of command line auditing in an enterprise is akin to being blind to the majority of WMI-based attacks. In the absence of this critical tool, identifying malicious activities becomes an arduous task, requiring exhaustive efforts in traditional forensics. Fortunately, modern solutions like Microsoft Sysinternals' Sysmon and advanced endpoint detection and response tools offer the ability to record command lines, ensuring comprehensive coverage against stealthy WMI attacks. Microsoft Sysmon: A Shield Against WMI Threats Sysmon, a free Sysinternals tool, emerges as a formidable ally in the battle against WMI threats. Tailored for detecting malicious activities, Sysmon provides detailed logs without overwhelming collection capabilities. Its integration with command line auditing equips organizations with the visibility needed to identify and neutralize potential threats promptly. Link: https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon Unveiling WMI Event Consumers: Understanding the anatomy of WMI event consumers is paramount for effective defense. PowerShell commands to collect information about WMI event filters, consumers, and bindings are showcased, providing a blueprint for organizations to proactively identify and thwart potential threats. Best practices, such as querying both standard and non-standard namespaces, are explored to stay one step ahead of evolving attack techniques. PowerShell Commands for WMI Event Consumer Collection: Get-WMIObject -Namespace root\Subscription -Class __EventFilter Get-WMIObject -Namespace root\Subscription -Class __EventConsumer Get-WMIObject -Namespace root\Subscription -Class __FilterToConsumerBinding Get-WMIObject -Namespace root\Default -Class __EventFilter Get-WMIObject -Namespace root\Default -Class __EventConsumer Get-WMIObject -Namespace root\Default -Class __FilterToConsumerBinding Scaling Defense with PowerShell Remoting: While auditing WMI event consumers on a single system is crucial, the real challenge lies in scaling defense across multiple systems. PowerShell remoting allows organizations to collect comprehensive data, which can be analyzed through databases like ELK stack or Splunk. PowerShell Command for Remote WMI Event Consumer Collection: # Read computer names from a text file $ComputerNamesFile = "C:\Path\To\Your\ComputerNames.txt" $RemoteComputers = Get-Content $ComputerNamesFile $Credentials = Get-Credential $ScriptBlock = { Get-WMIObject -Namespace root\Subscription -Class __EventFilter Get-WMIObject -Namespace root\Subscription -Class __EventConsumer Get-WMIObject -Namespace root\Subscription -Class __FilterToConsumerBinding } # Invoke the script block on remote computers Invoke-Command -ComputerName $RemoteComputers -ScriptBlock $ScriptBlock -Credential $Credentials Ensure that your text file (ComputerNames.txt) contains one computer name per line. Modify the path in $ComputerNamesFile to point to the actual location of your text file. Conclusion: Implementing robust command line auditing, leveraging tools like Sysmon, and embracing PowerShell for detection are critical steps in fortifying defenses against stealthy WMI threats. By understanding the dual nature of WMI and PowerShell, organizations can turn these tools into powerful allies in the ongoing battle for cybersecurity. Stay vigilant, stay secure! Akash Patel

  • Post 6: Credential Theft: Understanding and Securing NTDS.DIT

    In the intricate world of cybersecurity, few targets are as coveted by attackers as the domain controller, and among its treasures, the NTDS.DIT file reigns supreme. Often hailed as the "keys to the kingdom," the NTDS.DIT file contains the user account database for a Windows domain, harboring NT and possibly LM hashes, along with the password history of each account. Gaining access to this database is a pinnacle achievement for attackers, providing unfettered access to nearly every resource in the domain, including those protected by special accounts beyond the reach of even domain administrators. The NTDS.DIT Database: A Fortress of Secrets 1. Location and Format: Located in %SystemRoot%\NTDS folder. Utilizes the Extensible Storage Engine (ESE) format. Contains NT hashes (and possibly LM hashes for older systems) and password history. 2. Extraction Techniques: Extraction requires administrative access to the domain controller. Common extraction methods include loading a driver or tool that grants raw disk access and using the Volume Shadow Copy service. Volume Shadow Copy extraction is currently the most popular technique. 3. Volume Shadow Copy Extraction: Involves creating or utilizing existing Volume Shadow Copies on the system. Requires collecting SAM and SYSTEM registry hives for decrypting the extracted data. NTDSXtract, an open-source tool, is commonly used for offline extraction. The Devastating Impact: Retrieving data from the NTDS.DIT file is the epitome of danger in the enterprise, considering: Administrative access to a domain controller is a prerequisite for the attack. The attacker gains access to every NT hash in the domain. The extracted hashes can be cracked or immediately utilized for pass-the-hash attacks. Opens the door to advanced attacks like Golden Tickets, granting persistent domain administrator access. Mitigation Strategies: Safeguarding the Crown Jewels 1. Early Detection and Prevention: Implement measures to detect and stop adversaries before they gain access to the domain controller. Proactive monitoring and anomaly detection play a crucial role. 2. Least Privilege Principle: Limit administrative access to domain controllers to only essential personnel. Follow the principle of least privilege to minimize potential attack surfaces. 3. Regular Monitoring: Conduct regular audits and monitoring of domain controller activities. Investigate any suspicious or unauthorized access promptly. 4. Endpoint Security: Strengthen endpoint security to prevent unauthorized tools or drivers from being loaded. 5. Limit Volume Shadow Copy Usage: Control access to Volume Shadow Copy service to limit the ability to create or use shadow copies. 6. Strong Password Policies: Enforce strong password policies to mitigate the impact of cracked hashes. Conclusion: The NTDS.DIT heist represents the pinnacle of danger in the cybersecurity landscape. As defenders, understanding the tactics employed by attackers to access this critical file is paramount. By implementing a multi-layered defense strategy, organizations can fortify their domain controllers against unauthorized access, ensuring the sanctity of their crown jewels. Stay vigilant, adopt proactive security measures, and be prepared to defend against the relentless pursuit of adversaries targeting the heart of your enterprise. Akash Patel

  • Post 5: Credential Theft: Understanding and Securing Tickets

    In the intricate realm of Windows enterprise security, the reliance on the Kerberos authentication protocol is ubiquitous. This protocol, fundamental to the authentication process, employs Ticket Granting Tickets (TGTs) and service tickets to validate user accounts and access specific services. However, with the prevalence of Kerberos comes a set of sophisticated threats that leverage various techniques to compromise authentication and gain unauthorized access. In this comprehensive blog post, we will dissect the intricacies of Kerberos authentication threats, exploring everything from ticket attacks to the elusive Golden Ticket. The Kerberos Authentication Landscape Kerberos Authentication Protocol: Utilizes TGTs for user authentication and service tickets for service authentication. Tickets are valid for 10 hours by default, providing pre-authentication during this time frame. Nearly all Windows activities are linked to user accounts, making the authentication burden significant. Ticket Attacks: Exploiting Kerberos Weaknesses 1. Pass the Ticket: Attackers can dump tickets from memory using tools like Mimikatz. Imported tickets can be used to authenticate as specific users or services. Allows user "transplant" without knowledge of user hash or password. 2. Overpass the Hash (Pass the Key): Attackers dump account hash and use it to request service tickets. Authenticates via Kerberos, bypassing NTLM restrictions. 3. Kerberoasting: Any domain user can request a ticket for any domain service. Attackers seek tickets for high-privilege service accounts and derive plaintext passwords. 4. Golden Ticket: An attacker gains administrator credentials on the domain controller. Extracts krbtgt account hash to create TGTs that do not expire. Offers unprecedented persistence even after enterprise-wide password resets. 5. Silver Ticket: Attackers create a "Silver Ticket" using a dumped computer account hash. Grants all-access pass for a single service or computer, impersonating any user for that system. 6. Skeleton Key: Attackers patch LSASS to enable a backdoor password for any valid domain user. Provides persistent access even after a user changes their password. 7. DCSync: Exploits MS-DRSR protocol to impersonate a DC and request password hashes. Requires high-level privileges and allows extraction of KRBTGT ticket for Golden Ticket creation. Mitigation Strategies: Defending Against Kerberos Threats 1. Credential Guard: Windows 10+ feature using virtual machine isolation to protect hashes and tickets. Prevents dumping tickets for pass-the-ticket and hash attacks. 2. Remote Credential Guard and Restricted Admin: Prevents the passing of user credentials to remote systems during interactive sessions. Mitigates pass-the-ticket attacks. 3. Managed Service Accounts (MSA) and Group Managed Service Accounts (gMSA): Automatic password changes every 30 days and complex passwords. Mitigates Kerberoasting by reducing the lifespan of attacker-collected tickets. 4. Active Monitoring: Actively monitor high-privilege service accounts for anomalous activity. Regularly change service account passwords. 5. Changing krbtgt Account Password: Regularly change the krbtgt account password to detect and eliminate Golden Tickets. Conclusion Kerberos authentication threats pose a formidable challenge in the Windows enterprise environment. Understanding the nuances of these attacks and implementing robust mitigation strategies is imperative for organizations to fortify their security posture. By combining technical defenses, active monitoring, and proactive measures, enterprises can significantly reduce the risk of falling victim to Kerberos authentication threats. Stay vigilant, stay informed, and stay ahead of evolving cybersecurity challenges. Akash Patel

  • Post 4: Credential Theft: Understanding and Securing LSA Secrets

    In the intricate world of Windows security, the protection of credentials is a top priority. One area of concern that often draws the attention of attackers is the storage of passwords in the Local Security Authority (LSA) Secrets registry. In this blog post, we will delve into the mechanics of LSA Secrets, explore the risks associated with their exploitation, and discuss effective strategies to mitigate the potential threats posed by these encrypted secrets. Understanding LSA Secrets LSA Secrets, stored in encrypted form within the Windows registry (under SECURITY/Policy/Secrets), contain a wealth of sensitive information, ranging from RAS and VPN passwords to service account credentials. Service accounts, in particular, are a prime target for attackers, given their prevalence in Windows enterprise environments and the high privileges they often possess. Anatomy of LSA Secrets Exploitation Dumping LSA Secrets requires administrative privileges to access the necessary registry keys. Various tools, both historical and modern, have been developed to exploit LSA Secrets. While the stored data may sometimes seem mundane, attackers occasionally strike gold by uncovering domain admin service passwords in plaintext. A noteworthy development in LSA Secrets exploitation is the implementation of a PowerShell script within the Nishang framework. The script, Get-LsaSecret, exemplifies a modern approach to extracting registry data. It underscores the importance of securing PowerShell, as its capabilities in the wrong hands can expose critical information. Mitigation Strategies: Defending Against LSA Secrets Attacks Limiting Usage of Highly Privileged, Non-Built-in Accounts: The most effective strategy is to ensure that low-trust systems do not rely on services or scheduled tasks that require highly privileged, non-built-in accounts. When such situations arise, privileged accounts must be stored in the LSA Secrets registry key, making them vulnerable to attackers with admin rights on the system. Auditing and Infrastructure Changes: Auditors play a crucial role in reporting the existence of services or tasks relying on domain accounts. Organizations should be prepared to make infrastructure changes to reduce reliance on these potentially dangerous implementations. If a vendor demands the use of a highly privileged service account, exploring alternative solutions or forcing the implementation of a new solution may be necessary. Least Privilege Rule and Auditing: Recognizing the difficulty in completely eliminating reliance on LSA Secrets, organizations should adhere to the least privilege rule for accounts likely to be present in this key. Such accounts should undergo rigorous auditing to detect any suspicious activity promptly. Managed Service Accounts (MSA) and Group Managed Service Accounts (GMSA): Introduced with Server 2008R2, MSAs assist in managing service accounts with domain user rights. They offer benefits such as frequent password changes and long, complex passwords. The latest iteration, gMSA, provides enhanced flexibility and ease of administration. Conclusion Securing against LSA Secrets attacks requires a comprehensive approach that combines technical safeguards, auditing practices, and a commitment to the principle of least privilege. By understanding the intricacies of LSA Secrets and implementing robust mitigation strategies, organizations can significantly reduce the risk of credential compromise and enhance their overall security posture. Akash Patel

  • Post 3: Credential Theft: Understanding and Securing Cached Domain

    In a domain environment, the Domain Controller (DC) plays a pivotal role in authenticating user accounts. However, what happens when a system is offline or unable to communicate with the DC? To address this concern, Windows employs a caching mechanism that stores the last ten logon hashes by default, providing users with the ability to log in even when connectivity to the DC is unavailable. In this blog post, we will explore the intricacies of cached domain credentials, the associated security risks, and effective mitigation strategies to bolster your organization's defense against credential theft. The Anatomy of Cached Domain Credentials By default, Windows caches the last ten logon hashes (increased to 25 for Server 2008) to ensure users can log in even without connectivity to the Domain Controller. These credentials persist in the Security registry hive under the SECURITY\Cache key. Admin or System privileges are required to access these saved hashes, which are encrypted in mscash2 format for modern Windows operating systems. These hashes endure indefinitely in the registry, surviving reboots and potentially exposing sensitive information. The creddump tool can be utilized to extract these hashes offline, allowing attackers to bypass the risks associated with running common credential dumping binaries on a system. Risks and Challenges of Cached Credentials Cached credentials, stored in the registry, pose a considerable security risk. The tools like John the Ripper and hashcat can be used to attempt brute force attacks on these hashes. However, the encryption and salting of mscash2 hashes, coupled with a robust password policy, make decryption a time-consuming process. Attackers may exploit offline credential extraction tools, including Mimikatz, which requires a process dump of lsass.exe. Creddump, a reliable Python-based tool, serves as a go-to choice for attackers aiming to extract credential data at a later time without triggering security alerts. Defense Strategies: Mitigating Credential Theft 1. Limiting Cached Logons: Organizations can mitigate the risk by reducing the default number of cached logons in the registry key SOFTWARE\Microsoft\Windows NT\Current Version\Winlogon. The default value is 10 for workstations and up to 25 for servers. Some security guidelines recommend setting this value to four or less, or even zero for non-mobile systems, but caution is needed to avoid excluding service accounts and computer account logons. 2. Protected Users Security Group: Windows 8.1 and above introduce the Protected Users security group, offering non-configurable credential protections. Members of this group have their credentials not cached, providing an additional layer of defense against credential theft. This group is specifically designed for high-value accounts. 3. Periodic Security Audits: Regularly auditing and monitoring systems for unauthorized access attempts, especially those targeting cached credentials, can help detect and mitigate potential threats. 4. Stay Informed and Updated: Keeping systems updated with the latest security patches and staying informed about new tools and techniques used by attackers ensures a proactive defense against evolving threats. In conclusion, understanding the dynamics of cached domain credentials is crucial for building robust defenses against credential theft. By implementing these mitigation strategies, organizations can significantly reduce the risk of compromise and enhance their overall security posture. Stay vigilant, stay secure, and stay ahead of potential threats. Akash Patel

  • Post 2: Credential Theft: Understanding and Securing Tokens

    In this blog post, we will delve into the significance of security tokens, explore the risks associated with token stealing, and outline robust strategies to defend against unauthorized privilege escalation. The Essence of Security Tokens Every Windows logon and process is accompanied by a security token, encapsulating the security context and privileges associated with an account. Special tokens, namely impersonate and delegate, play pivotal roles in access control and single sign-on. While impersonate tokens facilitate local security context shifts, delegate tokens are more potent, enabling authentication across network resources. The Peril of Token Stealing Token stealing poses a significant threat if a user with the necessary privileges gains access to a token on the system. This can lead to local privilege escalation, unauthorized user management, and the potential for lateral movement within a network. Attackers commonly exploit this technique to elevate privileges from local admin to domain admin, especially in scenarios where extracting hashes from LSASS is challenging. When Tokens Are Present Tokens are present on a system only when an account is logged in, making servers, with multiple simultaneous users, a lucrative target. Exploitation often occurs when administrators connect via RDP but fail to perform a proper session termination, leaving tokens vulnerable. Defending Credentials: Best Practices for Tokens To defend against token-related threats, it's essential to adopt proactive measures: Prevent Admin Account Compromise: Safeguarding highly privileged accounts is paramount to preventing token misuse. Stop Remote Interactive Sessions: Limiting the use of highly privileged accounts for remote interactive sessions minimizes the risk of token stealing. Proper Termination of RDP Sessions: Ensure RDP sessions are terminated correctly to prevent the persistence of tokens on a system. Windows 8.1+: Force Restricted Admin Mode: Forcing the use of Restricted Admin Mode in Windows 8.1+ mitigates the risk of token theft during interactive logons. Windows 10: Deploy Remote Credential Guard: Leveraging Remote Credential Guard in Windows 10 provides enhanced protection against token-related attacks. Active Directory Designations: Designate high-value accounts as "Account is Sensitive and Cannot be Delegated" in Active Directory to restrict token delegation. Group Policy for Disconnected Sessions: Set a time limit for disconnected RDP sessions using Group Policy to terminate old sessions effectively. Advanced Token Defense Mechanisms For more robust token defense: In Windows 8.1+, enforcing "Restricted Admin" usage prevents the availability of hashes and tokens on remote systems during RDP sessions. Designating high-value accounts in Active Directory as non-delegable adds an extra layer of protection. Windows 8.1+ systems benefit from the Protected Users security group, which does not create delegate tokens, providing an elegant solution for generic domain-admin level accounts. By implementing these strategies, organizations can significantly enhance their resilience against token-based attacks, reinforcing their overall security posture. Stay vigilant, stay informed, and stay secure in the face of evolving cybersecurity challenges. Akash Patel

  • Post 1: Credential Theft: Understanding and Securing Hashes

    Introduction: When it comes to credential compromise, a primary target is the account password hashes stored in Windows. These credentials exist in various formats, with LM (deprecated) and NT hashes being the most well-known. This information is stored in different locations, such as the SAM registry hive for local accounts and in-memory for domain accounts during interactive sessions. Attack Methods: Several standard attacks exist for accessing these credentials, all requiring administrator privileges: Memory Extraction: Direct extraction from the LSASS process. LSASS Process Dump: Dumping the LSASS process for offline attacks. SAM Hive Extraction: Extracting local account hashes from the SAM hive in memory or on disk. Cracking Password Hashes: Once these hashes are obtained, attackers can crack them easily using tools like John the Ripper or employ rainbow table pre-computation attacks. Alternatively, attackers can use the hashes for authentication, as explained in the "Pass the Hash" technique. Cleartext Passwords: Researchers have discovered various types of stored credentials in memory, including those from SSO methods like TsPkg and Wdigest, as well as LiveSSP derived from Windows "Live" cloud accounts. Tools like Mimikatz and Windows Credential Editor (WCE) can extract and decrypt these passwords. Pass-the-Hash Attacks: Pass-the-hash allows attackers to authenticate using a stolen account hash without knowing the actual password. This method is particularly valuable for attackers who have acquired highly privileged hashes. It works with NTLM authentication, utilizing the fact that only the hash is necessary for the NTLM challenge-response protocol. Despite the prevalence of Kerberos, NTLM is still widely available in Windows enterprises. Tools like Metasploit PsExec, WCE, and SMBshell facilitate pass-the-hash attacks, enabling actions such as mapping file shares and remote execution via protocols like SMB and tools like WMI. Defense: 1. Stop Remote Interactive Sessions with Highly Privileged Accounts: Emphasize the avoidance of console logons, RDP sessions, and runas commands for highly privileged accounts. Discuss the criticality of preventing attackers from gaining local administrative rights, which could lead to credential stealing. 2. Proper Termination of RDP Sessions: Highlight the risks associated with improper termination of RDP sessions, leading to persistent hashes on systems. Introduce the use of Group Policy to set time limits for disconnected sessions, ensuring that old RDP sessions are terminated appropriately. 3. Security Enhancements in Windows 8.1+ and Windows 10: Explore the security improvements introduced by Microsoft, such as the elimination of WDigest and TsPkg credentials by default in Windows 8.1+. Discuss pass-the-hash mitigations, including Restricted Administrator accounts, the Domain Protected User security group, and Protected Processes. Introduce Windows 10 features like Credential Guard and Remote Credential Guard, emphasizing their role in preventing hash exposure during interactive logons. 4. Monitoring and Auditing Registry Changes: Emphasize the significance of monitoring the Windows registry for unexpected changes, especially in critical keys like "UseLogonCredential." Encourage regular audits to ensure that security configurations remain intact. 5. Local Administrator Account Security: Introduce Microsoft's Local Administrator Password Solution (LAPS) for centralizing security and management of local administrator account passwords. Stress the importance of unique passwords for local administrator accounts, reducing the risk of lateral movement. Akash Patel

  • Exploring Credentials theft way and defense: Upcoming Topics

    In my upcoming blog series, we'll embark on a journey to unravel the complexities surrounding credential theft, exploring various attack vectors and, more importantly, delving into effective defense strategies. Compromising Credentials Post 1: Hashes - Unveiling the Silent Guardians Post 2: Tokens - Navigating the Identity Gateway Post 3: Cached Credentials - A Double-Edged Sword Post 4: LSA Secrets - Fortifying System Integrity Post 5: Tickets - The Unauthorized Access Keys Post 6: NTDS.DIT - Safeguarding the System Core Join me in this comprehensive exploration of credential theft, where knowledge is power, and proactive defense is the key to a resilient cybersecurity posture. Stay tuned for valuable insights and practical tips to safeguard your digital identity. Akash Patel

  • Part 4-(Persistence) DLL Persistence Attacks: Navigating Windows Vulnerabilities

    Introduction: DLL (Dynamic Link Library) persistence attacks are a sophisticated breed of cyber threats that exploit legitimate and legacy features within the Windows operating system. This blog post delves into three prevalent forms of DLL persistence attacks—search order hijacking, phantom DLL hijacking, and DLL side-loading—providing insights into their mechanisms and the challenges they pose to cybersecurity. Search Order Hijacking: Search order hijacking is a crafty technique employed by adversaries to manipulate the way Windows locates dynamically loaded libraries (DLLs). When an executable runs, it follows a specific search order, starting from the local directory and culminating in folders like C:\Windows\System32. By identifying executables outside the System32 folder that load DLLs not protected by the KnownDLLs Registry key, attackers can strategically place malicious DLLs in the same directory. This manipulation ensures the execution of their malicious code whenever the targeted application starts. EXAMPLE: if an executable is launched from the path "C:\ProgramFiles\Application\app.exe," the local directory for that execution is "C:\ProgramFiles\Application". In this directory, the operating system searches for the required DLLs before extending the search to other predefined locations, such as the Windows\System32 directory. Search order hijacking takes advantage of this behavior by manipulating the DLL search order. Attackers may place malicious DLLs in the local directory or other locations where the executable searches for DLLs, ensuring that their code is loaded instead of the legitimate library. Example: Exploiting Explorer.exe loading a vulnerable DLL named "ntshrui.dll." Detection and Mitigation: Due to its connection with backward compatibility, fixing search order hijacking is challenging. Forensic analysis focusing on detecting newly created DLLs in unusual locations becomes crucial. Cybersecurity professionals must stay vigilant and incorporate robust security measures to mitigate the risks associated with this form of attack. Phantom DLL Hijacking: 1. Exploiting Legacy Dependencies: Targets applications attempting to load unnecessary and outdated DLLs, even if no longer existent. Attackers leverage this behavior by providing a malicious file with the same name as a long-forgotten DLL. Example: Attackers replacing "fxsst.dll" (Fax Service) documented by Mandiant. 2. Real-World Usage: Malicious files executed when applications load these unnecessary DLLs. Attackers achieve code execution, demonstrating the effectiveness of Phantom DLL hijacking. Example: Replacement of the "fxsst.dll" (Fax Service) DLL in the System32 folder. DLL Side-Loading: 1. Leveraging Windows SxS Functionality: Abuses the Windows Side-by-Side (SxS) DLL loading mechanism to introduce an "updated" version of a DLL. Legitimate feature used by applications to prevent issues with DLL versions. 2. Exploitation Tactics: Abuses SxS with missing DLLs, relative paths, and shortcuts not considered by application developers. Used to circumvent AV protections, allowing known good executables to serve as persistence mechanisms. Example: PlugX RAT utilizes SxS during runtime to load a malicious DLL in memory. 3. Detection and Mitigation: Identifying new executables and helper files added during an attack. Continuous monitoring and security awareness to thwart DLL side-loading attempts. Example: PlugX RAT dropping a legitimate executable and using DLL side-loading during runtime. Detection and Mitigation: Identifying new executables and helper files added to the system during an attack is crucial for detecting DLL side-loading. Cybersecurity professionals should stay informed about emerging techniques and deploy comprehensive security measures to thwart these evolving threats. Conclusion: DLL persistence attacks continue to pose significant challenges in the cybersecurity landscape. Understanding the intricacies of search order hijacking, phantom DLL hijacking, and DLL side-loading is essential for devising effective detection and mitigation strategies. For Part 5 WMI Event Consumer Backdoors : I have already created a bunch of blogs which help you deep dive in WMI and attacks related to it. Go on tab Keynotes==> You will find WMI related blogs combined in 1 group: Happy Akash Patel

bottom of page