Skip to main content

How To Gain Access MsSQL using Metasploit

Nowadays companies runs more SQL Server databases inhouse than any other database platform, according to Embarcadero Technologies’ Database Survey Report, 83 percent of respondents are running SQL Server in their database environment. Database administrators use simple passwords to facilitate their access to databases. In these two cases, many companies are endangered.
 
DB Usage of World

You can gain access the server systems of many enterprise companies using only the Metasploit Framework and a simple password list. Today I will show you how to get MSSQL passwords and what you can do with this valuable information.

We use the “MsSQL Login Module” to detect MsSQL passwords. You can use the following command to select the module.
Syntax example:
use auxiliary/scanner/mssql/mssql_login

We can list the parameters with “options” command.

MsSQL Login Module Options
All required parameters must be set before the “Mssql Login Module” is run. To start the module, there are 3 parameters that you need to specify.

Important Parameters : 

The PASSWORD parameter (Optional) : Specifies which password to authenticate with
The PASS_FILE parameter (Optional) : Specifies which file containing passwords to authenticate with
The RHOSTS parameter : Specifies the target address range 
The RPORT parameter : Specifies the target port
The USERNAME parameter (Optional) : Specifies which username to authenticate as
The USER_FILE parameter (Optional) : Specifies which file containing usernames to authenticate as

Setting up Parameters of MsSQL Login
After setting parameters, we are ready to exploit our module by sending “exploit” command.

Exploiting of MsSQL Login Module
As you see, there are 2 different response;
[-]  means the password we tried is incorrect
[+] means the password we tried is correct
Now we knows the password of MsSQL SA account and we can use another module of Metasploit which named “Mssql Exec” to gain access to the command line of target. To select “Mssql Exec”, we can use following command.
Syntax example:
use auxiliary/admin/mssql/mssql_exec
MsSQL Exec Module Options
All required parameters must be set before the “Mssql Exec Module” is run as it was in the previous module. To start the module, there are 4 parameters that you need to specify

Important Parameters : 
The CMD parameter (Optional) : Specifies which command to execute
The PASSWORD parameter (Optional) : Specifies which password to authenticate with
The RHOST parameter : Specifies the target address 
The RPORT parameter : Specifies the target port
The USERNAME parameter (Optional) : Specifies which username to authenticate as

Setting up Parameters of MsSQL Exec
After setting parameters, we are ready to exploit our module by sending “exploit” command.

"whoami" Command Output
As you see, we have system privileges. For example, running the "ipconfig" command is below.

"ipconfig" Command Output
BONUS : If you are interested in gaining access, I suggest you look at the content below.

Comments

Popular posts from this blog

TCP Flood & IP Spoofing Tutorial - Hping3 (With Effective Tricks)

hping is a command-line oriented TCP/IP packet assembler/analyzer. Using hping3 you are able to perform at least the following stuff: Test firewall rules Testing Network performance using different protocols, packet size, TOS (type of service) and fragmentation Remote OS fingerprinting. TCP/IP stack auditing Today, we will use hping3 for testing network performance. In other words we will use it to do DDOS Attack Tests. We can start “Help Document” by typing “hping3 --help” on the command line. Hping3 Important Parameters :  The flood parameter : Activates the fastest packet sending mode The destport(p) parameter : Specifies the destination port The spoof(a) parameter : Specifies which IP Adress is to be spoofed The rand-source parameter : Activates the random source address mode Although the above parameters are important, it should be selected which flag is set to determine the main attack type.  Main Attack Types :  The syn(S) parameter: Specifies tha

Top 110 Free Proxy Sites – Best Free Proxy Servers List 2017

Sometimes you may face problem while accessing some websites either it says this webpage is not available or this website/url has been blocked. If you still want to access a useful website from a place where it is blocked, the best way to access a blocked website is by using a proxy websites. Proxy sites can open restricted website which are blocked in colleges, schools, government offices, IP restricted etc. Proxy sites not only help you to access blocked websites, it also help to surf internet anonymously. Proxy sites are very easy to use. They redirect your network traffic through their servers so that you can access those websites because their servers are not blocked to access that site. So here in this tutorial we are providing you the list of top 110 proxy servers. The below we listed the best proxy sites: Skull Proxy: Skull Proxy is a new yet very powerful proxy server that should take you to your desired site with a blazing loading time. Hidester: Peo

NSA Releases GHIDRA 9.0 — Free, Powerful Reverse Engineering Tool

The United States' National Security Agency (NSA) today finally released GHIDRA version 9.0 for free, the agency’s home-grown classified software reverse engineering tool that agency experts have been using internally for over a decade to hunt down security bugs in software and applications. GHIDRA is a Java-based reverse engineering framework that features a graphical user interface (GUI) and has been designed to run on a variety of platforms including Windows, macOS, and Linux. Reverse engineering a program or software involves disassembling, i.e. converting binary instructions into assembly code when its source code is unavailable, helping software engineers, especially malware analysts, understand the functionality of the code and actual design and implementation information. Download  GHIDRA 9.0 — software package, slides, and exercises Adapted from  thehackernews.com