Attacking Common Services

Getting IPs of web servers

for i in $(cat subdomainlist);do host $i | grep "has address" | grep $DOMAIN | cut -d" " -f1,4;donev

Server info using Shodan

for i in $(cat ip-addresses.txt);do shodan host $i;done

Cloud Enumeration

python3 o365spray.py --validate --domain $DOMAIN
python3 o365spray.py --enum -U users.txt --domain $DOMAIN
python3 o365spray.py --spray -U usersfound.txt -p '$PASSWORD' --count 1 --lockout 1 --domain $DOMAIN

Tips

Always check for these things:

  • Anonymous login

  • Misconfigured Access Rights

  • Dangerous Default Settings

  • Check for CVEs for current version of the service

FTP

  • File Tranfer Protocol, uses TCP Port 21

  • Application layer of the TCP/IP protocol stack

  • It is a Clear text protocol and data can be sniffed.

  • Trivial File Transfer Protocol (TFTP) is simpler than FTP and performs file transfers between client and server processes. It does not provide user authentication and other features supported by FTP.

  • Dangerous settings include: anonymous login, file upload, create directory, usage of commands like STOR, DELE, RNFR, RNTO, MKD, RMD, APPE, and SITE

  • Attacking FTP:

SSH

SMB

  • Server Message Block, uses TCP.

  • A client-server protocol that regulates access to files and entire directories and other network resources.

  • Access rights are defined by ACLs.

  • The ACLs are defined based on the shares and do not correspond to the rights assigned locally on the server.

  • Samba implements the Common Internet File System (CIFS) network protocol.

  • CIFS is a specific version of SMB.

  • When SMB commands are transmitted over Samba to an older NetBIOS service, connection occur over TCP ports 137, 138, and 139.

  • CIFS operates over TCP port 445 exclusively.

  • Dangerous settings include: allow guest to connect, insecure default permissions of files, logon script, magic script etc

  • Accessing SMB shares from Windows Host

  • Accessing SMB Shares from Linux

  • Attacking SMB:

  • Forced Authentication Attacks:

    • LLMNR Poisoning

    • NTLM Relay

    • SCF File Attack

NFS

DNS

If the administrator used a subnet for the allow-transfer option for testing purposes or as a workaround solution or set it to any, everyone would query the entire zone file at the DNS server. In addition, other zones can be queried, which may even show internal IP addresses and hostnames.

We can use evolution tool as well to access emails. Use this command: export WEBKIT_FORCE_SANDBOX=0 && evolution.

SMTP

IMAP/POP3

  • Bruteforcing creds on email services

SNMP

MySQL

  • Read and write local files on server.

In MySQL, a global system variable secure_file_priv limits the effect of data import and export operation. We can check it using: show variables like "secure_file_priv";

MSSQL

  • Execute commands on mssql server using xp_cmdshell

  • Read and write files on server.

  • Capture MSSQL Service Hash

  • Impersonate Existing Users with MSSQL

SQL Server has a special permission, named IMPERSONATE, that allows the executing user to take on the permissions of another user or login until the context is reset or the session ends.

  • Communicate with Other Databases with MSSQL

  • Enumerating SQL server admins in domain:

Oracle TNS

IPMI

Rsync - Linux

R-Services - Linux

RDP - Windows

  • Enumerating RDP:

  • Attacking RDP:

    • Password spray

    • Session hijacking

    • Pass the Hash

WinRM - Windows

WMI - Windows

Last updated