0% found this document useful (0 votes)
60 views2 pages

Osep Resources

Uploaded by

thnhng105
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views2 pages

Osep Resources

Uploaded by

thnhng105
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#!

/usr/bin/python3

import argparse
import requests
import sys

# Interface class to display terminal messages


class Interface():
def __init__(self):
self.red = '\033[91m'
self.green = '\033[92m'
self.white = '\033[37m'
self.yellow = '\033[93m'
self.bold = '\033[1m'
self.end = '\033[0m'

def header(self):
print('\n >> Advanced Web Attacks and Exploitation')
print(' >> Python Skeleton Script\n')

def info(self, message):


print(f"[{self.white}*{self.end}] {message}")

def warning(self, message):


print(f"[{self.yellow}!{self.end}] {message}")

def error(self, message):


print(f"[{self.red}x{self.end}] {message}")

def success(self, message):


print(f"[{self.green}✓{self.end}] {self.bold}{message}{self.end}")

def sendGet(url, debug):


try:
if debug is True:
proxies = {'http': 'http://127.0.0.1:8080', 'https':
'http://127.0.0.1:8080'}
r = requests.get(url, proxies = proxies)
else:
r = requests.get(url)
except requests.exceptions.ProxyError:
output.error('Is your proxy running?')
sys.exit(-1)
return r

def main():
# Parse Arguments
parser = argparse.ArgumentParser()
parser.add_argument('-t', '--target', help='Target ip address or hostname',
required=True)
parser.add_argument('-li', '--ipaddress', help='Listening IP address for
reverse shell', required=False)
parser.add_argument('-lp', '--port', help='Listening port for reverse shell',
required=False)
parser.add_argument('-u', '--username', help='Username to target',
required=False)
parser.add_argument('-p', '--password', help='Password value to set',
required=False)
parser.add_argument('-d', '--debug', help='Instruct our web requests to use our
defined proxy', action='store_true', required=False)
args = parser.parse_args()

# Instantiate our interface class


global output
output = Interface()

# Banner
output.header()

# Debugging
if args.debug:
for k,v in sorted(vars(args).items()):
if k == 'debug':
output.warning(f"Debugging Mode: {v}")
else:
output.info(f"{k}: {v}")

# Authentication Bypass
sendGet(f"http://{args.target}", args.debug)

# Remote Code Execution


sendGet(f"http://{args.target}", args.debug)

# Try Harder
output.success('Exploit has been successfully executed. :eyes: on your
listener!')

if __name__ == '__main__':
main()

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy