You're going to need three terminals open for this.
Terminal 1 for starting metasploit
Terminal 2 for importing the exploit to local Metasploit repository
Terminal 3 for searchsploit which we will use to search for the exploit instead of opening your browser and looking in exploitdb.
Let's be done with it!
1. First, open the first terminal to run metasploit with the following commands:
> service postgresql start
> msfconsole
2. Go to Terminal 3 and run the following command to update its database:
> searchsploit -u
3. Open Terminal 2, then go to the metasploit modules directory by:
> cd .msf4/modules
4. Then create a directory inside the msf4 modules folder:
> mkdir exploits
5. Now, back to the Terminal 3. We will to search for an exploit we want to import. Let's first try to look for the explore ms15-100 by typing:
> searchsploit msf15-100
After pressing Enter, you should be able to see the search result. It will be a table with two columns -- Exploit Title and Path. We are interested in the path for now for the next step.
6. In the Terminal 2, I assume that you are still in .msf4/modules/exploits. Now we want to create the same directory structure as the one in the searchsploit result for ms15-100. There are two. Let's get the one with the Ruby for now. Using the terminal, create the same folder structure:
> mkdir windows
> cd windows
>mkdir remote
>cd remote
7. Now let's copy the exploit into our newly created folder. The exploit should be inside the /usr/share/exploitdb/ folder as stated in searchsploit results. So go ahead and type:
> cp /usr/share/exploitdb/exploits/windows/remote/38195.rb /root/.msf4/modules/exploits/windows/remote/
8. Now if you type the ls command, you should see the newly pasted file 38195.rb
9. Now, in order to use the newly imported exploit in msfconsole, we need to update the kali folder directory with:
>updatedb
10. No, in the Terminal 1 restart the msconsole:
> exit
>msfconsole
11. Now in the same Terminal 1 when msfconsole started successfully, you can search the ms15-100 exploit:
>search ms15-100
You will find that it is located in our folder exploit/windows/remote/38195.
You can now use it without the internet.
Terminal 1 for starting metasploit
Terminal 2 for importing the exploit to local Metasploit repository
Terminal 3 for searchsploit which we will use to search for the exploit instead of opening your browser and looking in exploitdb.
Let's be done with it!
1. First, open the first terminal to run metasploit with the following commands:
> service postgresql start
> msfconsole
2. Go to Terminal 3 and run the following command to update its database:
> searchsploit -u
3. Open Terminal 2, then go to the metasploit modules directory by:
> cd .msf4/modules
4. Then create a directory inside the msf4 modules folder:
> mkdir exploits
5. Now, back to the Terminal 3. We will to search for an exploit we want to import. Let's first try to look for the explore ms15-100 by typing:
> searchsploit msf15-100
After pressing Enter, you should be able to see the search result. It will be a table with two columns -- Exploit Title and Path. We are interested in the path for now for the next step.
6. In the Terminal 2, I assume that you are still in .msf4/modules/exploits. Now we want to create the same directory structure as the one in the searchsploit result for ms15-100. There are two. Let's get the one with the Ruby for now. Using the terminal, create the same folder structure:
> mkdir windows
> cd windows
>mkdir remote
>cd remote
7. Now let's copy the exploit into our newly created folder. The exploit should be inside the /usr/share/exploitdb/ folder as stated in searchsploit results. So go ahead and type:
> cp /usr/share/exploitdb/exploits/windows/remote/38195.rb /root/.msf4/modules/exploits/windows/remote/
8. Now if you type the ls command, you should see the newly pasted file 38195.rb
9. Now, in order to use the newly imported exploit in msfconsole, we need to update the kali folder directory with:
>updatedb
10. No, in the Terminal 1 restart the msconsole:
> exit
>msfconsole
11. Now in the same Terminal 1 when msfconsole started successfully, you can search the ms15-100 exploit:
>search ms15-100
You will find that it is located in our folder exploit/windows/remote/38195.
You can now use it without the internet.