Mysql and Mssql

mysql (port 3306) ....... mssql(port 1443)

connect

mysql -h $IP -u $username -p$password

nmap

  • imp cmd :

nmap -p3306 $IP -sCV
  • to enum other users on mysql (you'll need access & password of that user)

nmap -p3306 $IP --script mysql-users \
--script-args="mysqluser='username',mysqlpass=''"
  • dump hashes

nmap -p3306 $IP --script mysql-dump-hashes \
--script-args="username='username',password=''"

# --script ms-sql-dump-hashes 
  • to check all the imp variables

nmap -p3306 $IP --script mysql-variables \
--script-args="mysqluser='username',mysqlpass=''"
  • audit the database (GOOD & IMP)

  • run sql query with nmap

  • mysql info

  • ntlm info

  • bruteforce ms-sql

  • empty passwords

  • run query (ms sql) -> show logs : logins, what service are running etc.

  • run windows cmds with ms sql

metasploit / msfconsole

  • to see what directories are writeable

  • hashdump

  • dictionary attack

  • admin scan

  • obtain all logins

  • run commands

  • domain accounts scan

mysql cmds

  • to load files (if we have access to)

hydra

Last updated