modules/auxiliary/scanner/http/rdp_web_login.py
Function run
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def run(args):
"""Run the module, gathering the domain if desired and verifying usernames and passwords"""
module.LogHandler.setup(msg_prefix='{} - '.format(args['rhost']))
if DEPENDENCIES_MISSING:
module.log('Module dependencies are missing, cannot continue', level='error')
- 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
Function check_logins
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def check_logins(rhost, rport, targeturi, domain, usernames, passwords, timeout, user_agent):
Function check_login
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def check_login(rhost, rport, targeturi, domain, username, password, timeout, user_agent):
Function verify_service
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def verify_service(rhost, rport, targeturi, timeout, user_agent):
Avoid too many return
statements within this function. Open
Open
return properties
Avoid too many return
statements within this function. Open
Open
return None
Function get_ad_domain
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_ad_domain(rhost, rport, user_agent):
"""Retrieve the NTLM domain out of a specific challenge/response"""
domain_urls = ['aspnet_client', 'Autodiscover', 'ecp', 'EWS', 'OAB',
'Microsoft-Server-ActiveSync', 'PowerShell', 'rpc']
headers = {'Authorization': 'NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw==',
- 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"