February 2018
Intermediate to advanced
396 pages
9h 38m
English
As mentioned earlier, a white hat hacker should know how to write their own tools and scripts. So, let's see how to create a simple Metasploit module. In this demonstration, we'll use Ruby as a programming language, and we'll build a TCP scanner.
First, create a Ruby file:
require 'msf/core'class Metasploit3 <Msf::Auxiliaryinclude Msf::Exploit::Remote::Tcpinclude Msf::Auxiliary::Scannerdef intializesuper('Name' => 'TCP scanner','Version' => '$Revisiov: 1 $','Description' => 'This is a Demo for Packt Readers','License' => MSF_LICENSSE)register_options([opt::RPORT(3000)], self.class)enddef run_host(ip)connect()greeting = "Hello Cybrary"sock.puts(greeting)data = sock.recv(1024)print_status("Received: #{data} ...Read now
Unlock full access