Attacking Common Services
Last updated
Last updated
Vulnerabilities are commonly discovered by people who use and understand technology, a protocol, or a service. As we evolve in this field, we will find different services to interact with, and we will need to evolve and learn new technology constantly.
To be successful at attacking a service, we need to know its purpose, how to interact with it, what tools we can use, and what we can do with it. This section will focus on common services and how we can interact with them.
With the shared folder mapped as the n
drive, we can execute Windows commands as if this shared folder is on our local computer. Let's find how many files the shared folder and its subdirectories contain.
dir
command explanation:
With dir
we can search for specific names in files such as:
cred
password
users
secrets
key
Common File Extensions for source code such as: .cs, .c, .go, .java, .php, .asp, .aspx, .html.
To provide a username and password with Powershell, we need to create a PSCredential object. It offers a centralized way to manage usernames, passwords, and credentials.
We can use the property -Include
to find specific items from the directory specified by the Path parameter.
As an alternative, we can use a credential file (sudo apt install cifs-utils
).
Credentials file:
Suggested client: evolution
Command Line Utilities (mysql
or sqsh
)
Programming Languages
A GUI application to interact with databases such as HeidiSQL, MySQL Workbench, or SQL Server Management Studio.
MSSQL:
Linux: sqsh -S 10.129.20.13 -U username -P Password123
Windows: sqlcmd -S 10.129.20.13 -U username -P Password123
MySQL
Linux: mysql -u username -pPassword123 -h 10.129.20.13
Windows: mysql.exe -u username -pPassword123 -h 10.129.20.13
dbeaver is a multi-platform database tool for Linux, macOS, and Windows that supports connecting to multiple database engines such as MSSQL, MySQL, PostgreSQL, among others,
To install dbeaver using a Debian package we can download the release .deb package from https://github.com/dbeaver/dbeaver/releases and execute the following command:
Syntax
Description
dir
Application
n:
Directory or drive to search
/a-d
/a
is the attribute and -d
means not directories
/s
Displays files in a specified directory and all subdirectories
/b
Uses bare format (no heading information or summary)
SMB
FTP
Databases