This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "packetz" | |
capture = Packetz.capture | |
capture.enable_monitor_mode! if capture.supports_monitor_mode? | |
capture.start! | |
capture.each do |packet| | |
puts packet.hexdump |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Built ontop of the work started by this gangster: | |
# https://www.darkoperator.com/installing-metasploit-in-ubunt/ | |
function install::updates() { | |
sudo apt-get update -y | |
} | |
function install::upgrades() { | |
sudo apt-get upgrade -y | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <pcap.h> | |
int main() | |
{ | |
char *dev; | |
char errbuf[PCAP_ERRBUF_SIZE]; | |
dev = pcap_lookupdev(errbuf); | |
/* Check for failure */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@[Link("pcap")] | |
lib LibPcap | |
PCAP_ERRBUF_SIZE = UInt8.new(256) | |
fun pcap_lookupdev(errbuf : LibC::Char* ) : LibC::Char* | |
end | |
err = LibPcap::PCAP_ERRBUF_SIZE.dup | |
dev = LibPcap.pcap_lookupdev(pointerof(err)) | |
raise Exception.new("Couldn't find a default interface: #{String.new(err)}") if dev.null? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@[Link("pcap")] | |
lib LibPcap | |
PCAP_ERRBUF_SIZE = UInt8.new(256) | |
fun pcap_lookupdev(errbuf : LibC::Char*) : LibC::Char* | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
err = LibPcap::PCAP_ERRBUF_SIZE.dup | |
dev = LibPcap.pcap_lookupdev(pointerof(err)) | |
raise Exception.new("Couldn't find a default interface: #{err}") if dev.null? | |
puts String.new(dev) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@[Link("pcap")] | |
lib LibPcap | |
# previous code ... | |
type PcapT = Void* | |
alias UChar = UInt8 | |
alias BpfUInt32 = LibC::UInt | |
struct Timeval | |
tv_sec : LibC::Long |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# previous code ... | |
err = LibPcap::PCAP_ERRBUF_SIZE.dup | |
cap = LibPcap.pcap_open_live("en0", 65535, 0, 1, pointerof(err)) | |
raise Exception.new("An error happened: #{String.new(err)}") if cap.null? | |
loop do | |
result = LibPcap.pcap_next_ex(cap, out pkt_header, out pkt_data) | |
case result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service postgresql start | |
msfdb init | |
msfconsole |