byt3bl33d3r/MITMf

View on GitHub

Showing 400 of 608 total issues

Function _compat_system has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _compat_system(self, os_config, brw_config, os, browser):

        if (os_config == 'any') and (brw_config == 'any'):
            return True

Severity: Minor
Found in plugins/browsersniper.py - About 45 mins to fix

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

Avoid deeply nested control flow statements.
Open

                        with open(tmp.name, 'rb') as f:
                            new_tar_file.addfile(info, f)

        # finalize the writing of the tar file first
        new_tar_file.close()
Severity: Major
Found in plugins/filepwn.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                  if (img.script && img.script.parentNode) {
                    img.script.setAttribute("src", "about:blank");  // try to cancel running request
                    img.script.parentNode.removeChild(img.script);
                  }
    Severity: Major
    Found in core/javascript/screenshot.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              for exploit in exploits:
      
                                  jobs = self.msf.findjobs(exploit)
                                  if jobs:
                                      self.log.info('{} => {} already started'.format(vic_ip, exploit))
      Severity: Major
      Found in plugins/browsersniper.py - About 45 mins to fix

        Function tryMassPoison has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def tryMassPoison(self, url, data, headers, req_headers, ip):
                browser_id = ip + req_headers.get("user-agent", "")
        
                if not 'mass_poison_url_match' in self.app_config: # no url
                    return data
        Severity: Minor
        Found in plugins/appcachepoison.py - About 45 mins to fix

        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

        Avoid deeply nested control flow statements.
        Open

                        switch (navigator.productSub) {
                            case "2009101600": ua_version = "3.0.15"; break; // Can be either Mac or Linux
                            case "20091016": ua_version = "3.5.4"; os_name = oses_linux; os_vendor = "SUSE"; arch = arch_x86; break;
                        } break;
        Severity: Major
        Found in core/javascript/plugindetect.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                          switch (navigator.productSub) {
                              case "20091215": ua_version = "3.5.6"; os_name = oses_linux; os_vendor = "Ubuntu"; arch = arch_x86_64; break;
                              case "20100106": ua_version = "3.5.7"; os_name = oses_linux; os_vendor = "Ubuntu"; arch = arch_x86_64; break; // Could also be Mint x86-64
                          } break;
          Severity: Major
          Found in core/javascript/plugindetect.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                            if (version && ua_version && version.split(".")[0] == ua_version.split(".")[0]) {
                                // The version number will sometimes end with a space or end of
                                // line, so strip off anything after a space if one exists
                                if (-1 != version.indexOf(" ")) {
                                    version = version.substr(0,version.indexOf(" "));
            Severity: Major
            Found in core/javascript/plugindetect.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                            if(m3[1] === 'from') {
                              stop = 0.0;
                            }
              Severity: Major
              Found in core/javascript/screenshot.js - About 45 mins to fix

                Function findFirst2 has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def findFirst2(self, connId, smbServer, recvPacket, parameters, data, maxDataCount):
                Severity: Minor
                Found in core/servers/KarmaSMB.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                          if (!ua_version) {
                              // The ScriptEngine functions failed us, try some object detection
                              if (document.documentElement && (typeof document.documentElement.style.maxHeight)!="undefined") {
                                  // IE 11 detection, see: http://msdn.microsoft.com/en-us/library/ie/bg182625(v=vs.85).aspx
                                  try {
                  Severity: Major
                  Found in core/javascript/plugindetect.js - About 45 mins to fix

                    Function request has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def request(self, request):
                            if 'cookie' in request.headers:
                                host   = request.headers['host']
                                cookie = request.headers['cookie']
                                client = request.client.getClientIP()
                    Severity: Minor
                    Found in plugins/ferretng.py - About 45 mins to fix

                    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 _ip_filter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _ip_filter(self, ip):
                    
                            if self.white_ips[0] != '':
                                if ip in self.white_ips:
                                    return True
                    Severity: Minor
                    Found in plugins/inject.py - About 45 mins to fix

                    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

                    Avoid deeply nested control flow statements.
                    Open

                            switch (version){
                                case "514615":
                                    // IE 5.00.2920.0000, 2000 Advanced Server SP0 English
                                    ua_version = "5.0";
                                    os_name = "Windows 2000";
                    Severity: Major
                    Found in core/javascript/plugindetect.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                      if(m2[0] === 'circle'){
                                        gradient.rx = gradient.ry = Math.max(
                                          gradient.cx,
                                          gradient.cy,
                                          gradient.x1 - gradient.cx,
                      Severity: Major
                      Found in core/javascript/screenshot.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        if(m2[0] === 'circle'){
                                          gradient.rx = gradient.ry = Math.min(
                                            gradient.cx,
                                            gradient.cy,
                                            gradient.x1 - gradient.cx,
                        Severity: Major
                        Found in core/javascript/screenshot.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if (java is not None) and (java in details['PluginVersions']):
                                                      exploits.append(exploit)
                          
                          
                          Severity: Major
                          Found in plugins/browsersniper.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                            if (/Mac/.test(navigator.oscpu)) {
                                                os_name = oses_mac_osx;
                                            } else {
                                                os_name = oses_windows; // browsershots: Firefox 11.0 / Windows XP
                                            }
                            Severity: Major
                            Found in core/javascript/plugindetect.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                            if(m3[2]){
                                              stop = parseFloat(m3[2]);
                                              if(m3[3]){ // percentage
                                                stop /= 100;
                                              }
                              Severity: Major
                              Found in core/javascript/screenshot.js - About 45 mins to fix

                                Function _host_filter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def _host_filter(self, host):
                                
                                        if self.white_domains[0] != '':
                                            if host in self.white_domains:
                                                return True
                                Severity: Minor
                                Found in plugins/inject.py - About 45 mins to fix

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language