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
| # https://blog.rapid7.com/2014/02/03/new-ms08-067/ | |
| nmap -p 445 -script smb-check-vulns $1 |
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
| # https://www.offensive-security.com/metasploit-unleashed/scanner-ssh-auxiliary-modules/ | |
| use auxiliary/scanner/ssh/ssh_login | |
| set RHOSTS 192.168.1.154 | |
| set USERPASS_FILE /usr/share/metasploit-framework/data/wordlists/root_userpass.txt | |
| set VERBOSE false | |
| run |
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 |
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
| @[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
| 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 | |
| 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
| @[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
| #include <pcap.h> | |
| int main() | |
| { | |
| char *dev; | |
| char errbuf[PCAP_ERRBUF_SIZE]; | |
| dev = pcap_lookupdev(errbuf); | |
| /* Check for failure */ |