File netenum.rb
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
@@exec_opts = Rex::Parser::Arguments.new(
"-h" => [ false, "Help menu." ],
"-r" => [ true, "The target address range or CIDR identifier" ],
"-p" => [ false, "To Perform Ping Sweep on IP Range" ],
"-l" => [ false, "To Perform DNS Reverse Lookup on IP Range" ],
Method pingsweep
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def pingsweep(session, iprange, dest)
dest = dest + "-pingsweep.txt"
print_status("Performing ping sweep for IP range #{iprange}")
filewrt(dest,"Ping sweep for IP range #{iprange}")
iplst = []
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method reverselookup
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def reverselookup(session, iprange, dest)
dest = dest + "-DNS-reverse-lookup.txt"
print_status("Performing DNS reverse lookup for IP range #{iprange}")
filewrt(dest,"DNS reverse lookup for IP range #{iprange}")
iplst =[]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method pingsweep
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pingsweep(session, iprange, dest)
dest = dest + "-pingsweep.txt"
print_status("Performing ping sweep for IP range #{iprange}")
filewrt(dest,"Ping sweep for IP range #{iprange}")
iplst = []
Method reverselookup
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def reverselookup(session, iprange, dest)
dest = dest + "-DNS-reverse-lookup.txt"
print_status("Performing DNS reverse lookup for IP range #{iprange}")
filewrt(dest,"DNS reverse lookup for IP range #{iprange}")
iplst =[]
Method frwdlp
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def frwdlp(session, hostlst, domain, dest)
dest = dest + "-DNS-forward-lookup.txt"
print_status("Performing DNS forward lookup for hosts in #{hostlst} for domain #{domain}")
filewrt(dest,"DNS forward lookup for hosts in #{hostlst} for domain #{domain}")
result = []
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method frwdlp
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def frwdlp(session, hostlst, domain, dest)
dest = dest + "-DNS-forward-lookup.txt"
print_status("Performing DNS forward lookup for hosts in #{hostlst} for domain #{domain}")
filewrt(dest,"DNS forward lookup for hosts in #{hostlst} for domain #{domain}")
result = []
Method stdlookup
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def stdlookup(session, domain, dest)
dest = dest + "-general-record-lookup.txt"
print_status("Getting MX and NS Records for domain #{domain}")
filewrt(dest,"SOA, NS and MX Records for domain #{domain}")
types = ["SOA","NS","MX"]
Method srvreclkp
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def srvreclkp(session, domain, dest)
dest = dest + "-srvenum.txt"
srout = []
garbage = []
srvrcd = [
Avoid deeply nested control flow statements. Open
if dom != nil && hostlist!= nil &&
message(logs)
frwdlp(session, hostlist, dom, dest)
elsif dom == nil
print_error("Please add a domain name for DNS forward lookup: -d <value>")
Avoid deeply nested control flow statements. Open
elsif stdlkp == 1
if dom != nil
message(logs)
stdlookup(session, dom, dest)
else
Method stdlookup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def stdlookup(session, domain, dest)
dest = dest + "-general-record-lookup.txt"
print_status("Getting MX and NS Records for domain #{domain}")
filewrt(dest,"SOA, NS and MX Records for domain #{domain}")
types = ["SOA","NS","MX"]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"