-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add new module: Pcap OT/IOT analyzer #19481
Conversation
unless File.exist?(datastore['FILE_PCAP']) && File.extname(datastore['FILE_PCAP']) == '.pcap' | ||
print_error("Invalid or non-existent PCAP file: #{datastore['FILE_PCAP']}") | ||
return | ||
end | ||
|
||
unless File.exist?(datastore['FILE_PORT']) && File.extname(datastore['FILE_PORT']) == '.txt' | ||
print_error("Invalid or non-existent port file: #{datastore['FILE_PORT']}") | ||
return | ||
end | ||
|
||
if File.exist?(datastore['FILE_OUT']) | ||
print_error("Output file already exists: #{datastore['FILE_OUT']}") | ||
return | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of print_error for each of these you should use fail_with(Failure::BadConfig, ...
pkt = PacketFu::Packet.parse(packet) | ||
next unless pkt.is_ip? | ||
|
||
timestamp = Time.at(packet.timestamp.to_f).strftime('%y/%m/%d - %H:%M:%S') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we switch this to the ISO8601 format please? it's YYYY-MM-DDTHH:MM:SS IIRC.
timestamp = Time.at(packet.timestamp.to_f).strftime('%y/%m/%d - %H:%M:%S') | |
timestamp = Time.at(packet.timestamp.to_f).strftime() |
PCAP is already a supported import format that in theory, can populate the database (although I have not tested it recently). This module seems better suited as a standalone tool as it does not really take advantage of anything provided by A useful enhancement for |
Thanks for the input Jeffrey! I'd agree that might be a more useful enhancement for the framework. @jubachm would you be interested in attempting to make those suggested changes? We'd be happy to help. |
Thanks for your contribution to Metasploit Framework! We've looked at this pull request, and we agree that it seems like a good addition to Metasploit, but it looks like it is not quite ready to land. We've labeled it What does this generally mean? It could be one or more of several things:
We would love to land this pull request when it's ready. If you have a chance to address all comments, we would be happy to reopen and discuss how to merge this! |
Tell us what this change does. If you're fixing a bug, please mention
the github issue number.
Please ensure you are submitting from a unique branch in your repository to master in Rapid7's.
Verification
List the steps needed to make sure this thing works
msfconsole
use exploit/windows/smb/ms08_067_netapi
If you are opening a PR for a new module that exploits a specific piece of hardware or requires a complex or hard-to-find testing environment, we recommend that you send us a demo of your module executing correctly. Seeing your module in action will help us review your PR faster!
Specific Hardware Examples:
Complex Software Examples:
We will also accept demonstrations of successful module execution even if your module doesn't meet the above conditions. It's not a necessity, but it may help us land your module faster!
Demonstration of successful module execution can take the form of a packet capture (pcap) or a screen recording. You can send pcaps and recordings to [email protected]. Please include a CVE number in the subject header (if applicable), and a link to your PR in the email body.
If you wish to sanitize your pcap, please see the wiki.