-
Notifications
You must be signed in to change notification settings - Fork 103
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
Allow control of device discovery and other template options #133
Changes from 4 commits
b8d5aa8
e2ba2a2
9a67881
6c1ee24
2a03af7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,6 +176,56 @@ def host_threads=(threads) | |
host_threads.text = threads.to_s | ||
end | ||
|
||
# Enable/disable IP stack fingerprinting | ||
# @param [Boolean] enable or disable IP stack fingerprinting | ||
def enable_ip_stack_fingerprinting(enable) | ||
ns = REXML::XPath.first(@xml, 'ScanTemplate/Plugins/Plugin[@name="java/NetworkScanners"]') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [96/80] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think another branch has this changed to 120 max width since this could get annoying There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that is annoying. I'll fix the other legitimate feedback. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed max line width on master, so next time hound runs it shouldn't bark at these. ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've merged master to hopefully muzzle Hound. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Meanwhile Travis is taking forever to start builds for some reason, which is kind of annoying. |
||
param = REXML::XPath.first(ns, './param[@name="ipFingerprintEnabled"]') | ||
if param | ||
param.text = (enable ? 1 : 0) | ||
else | ||
param = REXML::Element.new('param') | ||
param.add_attribute('name', 'ipFingerprintEnabled') | ||
param.text = (enable ? 1 : 0) | ||
ns.add_element(param) | ||
end | ||
end | ||
|
||
# Enable/diisable ICMP device discovery | ||
# @param [Boolean] enable or disable ICMP device discovery | ||
def enable_icmp_discovery=(enable) | ||
icmp = REXML::XPath.first(@xml, 'ScanTemplate/DeviceDiscovery/CheckHosts/icmpHostCheck') | ||
icmp.attributes['enabled'] = (enable ? 1 : 0) | ||
end | ||
|
||
# Add custom TCP ports to scan for device discovery | ||
# @param [Array] ports to scan for device discovery | ||
def tcp_discovery_ports=(ports) | ||
tcp = REXML::XPath.first(@xml, 'ScanTemplate/DeviceDiscovery/CheckHosts/TCPHostCheck') | ||
REXML::XPath.first(tcp, './portList').text = ports.join(',') | ||
end | ||
|
||
# Enable/disable TCP device discovery | ||
# @param [Boolean] enable or disable TCP device discovery | ||
def enable_tcp_discovery=(enable) | ||
tcp = REXML::XPath.first(@xml, 'ScanTemplate/DeviceDiscovery/CheckHosts/TCPHostCheck') | ||
tcp.attributes['enabled'] = (enable ? 1 : 0) | ||
end | ||
|
||
# Add custom UDP ports to scan for UDP device discovery | ||
# @param [Array] posts to scan for UDP device discovery | ||
def udp_discovery_ports=(ports) | ||
udp = REXML::XPath.first(@xml, 'ScanTemplate/DeviceDiscovery/CheckHosts/UDPHostCheck') | ||
REXML::XPath.first(udp, './portList').text = ports.join(',') | ||
end | ||
|
||
# Enable/diisable UDP device discovery | ||
# @param [Boolean] enable or disable UDP device discovery | ||
def enable_udp_discovery=(enable) | ||
udp = REXML::XPath.first(@xml, 'ScanTemplate/DeviceDiscovery/CheckHosts/UDPHostCheck') | ||
udp.attributes['enabled'] = (enable ? 1 : 0) | ||
end | ||
|
||
# Add custom TCP ports to scan for services | ||
# @param [Array] ports to scan | ||
def tcp_service_ports=(ports) | ||
|
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.
I'll change this to the same
foo=(blah)
style used by the others, for consistency's sake.