Exfilling Lambda RCE Results #6
wdahlenburg
started this conversation in
General
Replies: 1 comment 1 reply
-
I went with the /dev/tcp method with a listener setup to catch the output. While the lambda environment might be lacking in certain tools like curl or wget, /dev/tcp can be used to pull down scripts, or open a reverse shell. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A few of the challenges use Lambdas that are vulnerable to remote code execution vulnerabilities. Lambda environments don't typically come with many libraries and the system binaries are usually limited. This means that common tools like the aws-cli, curl, wget, etc. aren't available.
I'd be interested to hear what techniques people have used to obtain the output of their RCE payloads.
For example:
I ended up referring to the logs of the Lambda functions to view my command output. Per https://hackingthe.cloud/aws/exploitation/lambda-steal-iam-credentials/, you can usually manage to read
/proc/self/environ
, which will output temporary role credentials.I'll note that either this requires a higher privileged role or a read-only role with
logs:DescribeLogGroups
,logs:DescribeLogStreams
, andlogs:GetLogEvents
(whichctf-starting-user
doesn't currently havelogs:Get*
).Beta Was this translation helpful? Give feedback.
All reactions