hackedteam/vector-exploit

View on GitHub

Showing 389 of 389 total issues

Identical blocks of code found in 4 locations. Consider refactoring.
Open

if sys.argv[2][-1] == "/":
    EXE_URL = sys.argv[2] + EXE_RANDOM_NAME
    SWF_URL = sys.argv[2] + SWF_RANDOM_NAME
else:
    EXE_URL = sys.argv[2] + '/' + EXE_RANDOM_NAME
Severity: Major
Found in src/exploit_vps/html/admin/2013-002-Word/exploit.py and 3 other locations - About 7 hrs to fix
ht-2013-002-Word/exploit.py on lines 45..50
ht-2013-003-Powerpoint/exploit.py on lines 45..50
src/exploit_vps/html/admin/2013-003-PowerPoint/exploit.py on lines 41..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 113.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 4 locations. Consider refactoring.
Open

if sys.argv[2][-1] == "/":
    EXE_URL = sys.argv[2] + EXE_RANDOM_NAME
    SWF_URL = sys.argv[2] + SWF_RANDOM_NAME
else:
    EXE_URL = sys.argv[2] + '/' + EXE_RANDOM_NAME
Severity: Major
Found in ht-2013-003-Powerpoint/exploit.py and 3 other locations - About 7 hrs to fix
ht-2013-002-Word/exploit.py on lines 45..50
src/exploit_vps/html/admin/2013-002-Word/exploit.py on lines 41..46
src/exploit_vps/html/admin/2013-003-PowerPoint/exploit.py on lines 41..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 113.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

def byteArray2String(param):
    with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            tmp = os.tempnam()

Severity: Major
Found in ht-2013-002-Word/exploit.py and 2 other locations - About 7 hrs to fix
ht-2013-003-Powerpoint/exploit.py on lines 80..98
src/exploit_vps/html/admin/2013-003-PowerPoint/exploit.py on lines 71..89

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

def byteArray2String(param):
    with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            tmp = os.tempnam()

Severity: Major
Found in src/exploit_vps/html/admin/2013-003-PowerPoint/exploit.py and 2 other locations - About 7 hrs to fix
ht-2013-002-Word/exploit.py on lines 80..98
ht-2013-003-Powerpoint/exploit.py on lines 80..98

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

def byteArray2String(param):
    with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            tmp = os.tempnam()

Severity: Major
Found in ht-2013-003-Powerpoint/exploit.py and 2 other locations - About 7 hrs to fix
ht-2013-002-Word/exploit.py on lines 80..98
src/exploit_vps/html/admin/2013-003-PowerPoint/exploit.py on lines 71..89

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function stage2 has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

function stage2(page, base, iframe, xml, documentarea) {
    // Area available:
    // 0x3fff00 bytes starting at page.base (~4MB). Can't overwrite from pagebase+0x0 to pagebase+0x7.
    // page is aligned to 0x1000

Severity: Minor
Found in src/ht-webkit-Android4-src/precompiled/debug/script.js - About 7 hrs 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 stage2_overwrite has 173 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function stage2_overwrite(xsltobj, page, webcoretext) {
    
    var addr = page.base + 0x3000;
    var nobj = 0;
    var i;
Severity: Major
Found in src/ht-webkit-Android4-src/precompiled/debug/script.js - About 6 hrs to fix

    Function __init__ has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, file):
            self.numfiles = self._read64Bit(file)
            self.files = [{'emptystream': False} for x in xrange(self.numfiles)]
            numemptystreams = 0
            while True:
    Severity: Minor
    Found in ht-2013-003-Powerpoint/pylzma.egg/py7zlib.py - About 6 hrs 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 __init__ has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, file):
            self.numfiles = self._read64Bit(file)
            self.files = [{'emptystream': False} for x in xrange(self.numfiles)]
            numemptystreams = 0
            while True:
    Severity: Minor
    Found in ht-2013-002-Word/pylzma.egg/py7zlib.py - About 6 hrs 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 __init__ has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, file):
            self.numfiles = self._read64Bit(file)
            self.files = [{'emptystream': False} for x in xrange(self.numfiles)]
            numemptystreams = 0
            while True:
    Severity: Minor
    Found in ht-2013-004-IE/pylzma.egg/py7zlib.py - About 6 hrs 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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    for i in range(len(ole_link_bytearray)):
        #if i == ole_link_offt or i == ole_link2_offt or i == ole_link3_offt:
        if i == ole_link_offt or i == ole_link2_offt:
            y = 0
            for x in range(len(swf_url_bytearray)):
    Severity: Major
    Found in src/exploit_vps/html/admin/2013-003-PowerPoint/exploit.py and 1 other location - About 6 hrs to fix
    ht-2013-003-Powerpoint/exploit.py on lines 305..312

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 107.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    for i in range(len(ole_link_bytearray)):
        #if i == ole_link_offt or i == ole_link2_offt or i == ole_link3_offt:
        if i == ole_link_offt or i == ole_link2_offt:
            y = 0
            for x in range(len(swf_url_bytearray)):
    Severity: Major
    Found in ht-2013-003-Powerpoint/exploit.py and 1 other location - About 6 hrs to fix
    src/exploit_vps/html/admin/2013-003-PowerPoint/exploit.py on lines 248..255

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 107.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function stage3 has 165 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function stage3 (memobj, webcoretext, node, addr, page) {
        INFO("> [ Stage 3 ]");
    
        // Find libwebcore.so ELF header
        var webcore_base = memobj.findimagebase(webcoretext);
    Severity: Major
    Found in src/ht-webkit-Android4-src/precompiled/debug/script.js - About 6 hrs to fix

      Function __init__ has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(self, file, password=None):
              self._file = file
              self.password = password
              self.header = file.read(len(MAGIC_7Z))
              if self.header != MAGIC_7Z:
      Severity: Minor
      Found in ht-2013-003-Powerpoint/pylzma.egg/py7zlib.py - About 5 hrs 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 __init__ has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(self, file, password=None):
              self._file = file
              self.password = password
              self.header = file.read(len(MAGIC_7Z))
              if self.header != MAGIC_7Z:
      Severity: Minor
      Found in ht-2013-002-Word/pylzma.egg/py7zlib.py - About 5 hrs 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 __init__ has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(self, file, password=None):
              self._file = file
              self.password = password
              self.header = file.read(len(MAGIC_7Z))
              if self.header != MAGIC_7Z:
      Severity: Minor
      Found in ht-2013-004-IE/pylzma.egg/py7zlib.py - About 5 hrs 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 onload has 142 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          iframe2.onload = function () {
          // Execute the rest of stage2()
          INFO("Document loaded.");
          var xml2 = iframe2.contentWindow.document;
          if (xml2 === undefined) {
      Severity: Major
      Found in src/ht-webkit-Android4-src/precompiled/debug/script.js - About 5 hrs to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            if (ENABLE_DEBUG) {
            for (var name in gadgets) {
                var extra = "";
                for (var attr in gadgets[name]) {
                if (attr != "addr") {
        Severity: Major
        Found in src/ht-webkit-Android4-src/precompiled/debug/script.js and 1 other location - About 5 hrs to fix
        src/ht-webkit-Android4-src/precompiled/debug/script.js on lines 1890..1903

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 145.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            if (ENABLE_DEBUG) {
            for (var name in gadgets) {
                var extra = "";
                for (var attr in gadgets[name]) {
                if (attr != "addr") {
        Severity: Major
        Found in src/ht-webkit-Android4-src/precompiled/debug/script.js and 1 other location - About 5 hrs to fix
        src/ht-webkit-Android4-src/precompiled/debug/script.js on lines 1568..1581

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 145.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function stage3_alternate has 134 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function stage3_alternate(memobj, node, addr, page, libwebcore, libc) {
            var gadgets = {};
        
            // Gadget 2 in libc
        
        
        Severity: Major
        Found in src/ht-webkit-Android4-src/precompiled/debug/script.js - About 5 hrs to fix
          Severity
          Category
          Status
          Source
          Language