How to use the boofuzz.primitives.Static function in boofuzz

To help you get started, we’ve selected a few boofuzz examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jtpereyda / boofuzz / boofuzz / __init__.py View on Github external
def s_static(value, name=None):
    """
    Push a static value onto the current block stack.

    :see: Aliases: s_dunno(), s_raw(), s_unknown()

    :type  value: Raw
    :param value: Raw static data
    :type  name:  str
    :param name:  (Optional, def=None) Specifying a name gives you direct access to a primitive
    """

    static = primitives.Static(value, name)
    blocks.CURRENT.push(static)
github jtpereyda / boofuzz / examples / fuzz_http_server.py View on Github external
# Connection: close
        s_static("Connection"),
        s_delim(":"),
        s_delim(" "),
        s_string("close"),
        s_static("\r\n\r\n"),
    ],
)

OpenHeader = Group(
    "HTTP Open Header",
    definition=[
        # GET / HTTP/1.1\r\n
        Static("GET / HTTP/1.1\r\n"),
        # Connection: close
        Static("Connection"),
        Delim(":"),
        Delim(" "),
        String("open"),
        Static("\r\n\r\n"),
    ],
github jtpereyda / boofuzz / boofuzz / __init__.py View on Github external
parsed = parsed.replace(" ", "")
    parsed = parsed.replace("\t", "")
    parsed = parsed.replace("\r", "")
    parsed = parsed.replace("\n", "")
    parsed = parsed.replace(",", "")
    parsed = parsed.replace("0x", "")
    parsed = parsed.replace("\\x", "")

    value = b""
    while parsed:
        pair = parsed[:2]
        parsed = parsed[2:]

        value += six.int2byte(int(pair, 16))

    static = primitives.Static(value, name)
    blocks.CURRENT.push(static)
github jtpereyda / boofuzz / boofuzz / __init__.py View on Github external
def s_static(value, name=None):
    """
    Push a static value onto the current block stack.

    :see: Aliases: s_dunno(), s_raw(), s_unknown()

    :type  value: Raw
    :param value: Raw static data
    :type  name:  str
    :param name:  (Optional, def=None) Specifying a name gives you direct access to a primitive
    """

    static = primitives.Static(value, name)
    blocks.CURRENT.push(static)
github jtpereyda / boofuzz / examples / fuzz_http_server.py View on Github external
# GET / HTTP/1.1\r\n
        s_static("GET / HTTP/1.1\r\n"),
        # Connection: close
        s_static("Connection"),
        s_delim(":"),
        s_delim(" "),
        s_string("close"),
        s_static("\r\n\r\n"),
    ],
)

OpenHeader = Group(
    "HTTP Open Header",
    definition=[
        # GET / HTTP/1.1\r\n
        Static("GET / HTTP/1.1\r\n"),
        # Connection: close
        Static("Connection"),
        Delim(":"),
        Delim(" "),
        String("open"),
        Static("\r\n\r\n"),
    ],
github jtpereyda / boofuzz / boofuzz / __init__.py View on Github external
parsed = parsed.replace(" ", "")
    parsed = parsed.replace("\t", "")
    parsed = parsed.replace("\r", "")
    parsed = parsed.replace("\n", "")
    parsed = parsed.replace(",", "")
    parsed = parsed.replace("0x", "")
    parsed = parsed.replace("\\x", "")

    value = b""
    while parsed:
        pair = parsed[:2]
        parsed = parsed[2:]

        value += six.int2byte(int(pair, 16))

    static = primitives.Static(value, name)
    blocks.CURRENT.push(static)
github jtpereyda / boofuzz / boofuzz / primitives.py View on Github external
def __init__(self, value, name=None):
        """
        Primitive that contains static content.

        @type  value: str
        @param value: Raw static data
        @type  name:  str
        @param name:  (Optional, def=None) Specifying a name gives you direct access to a primitive
        """

        super(Static, self).__init__()

        self._fuzz_complete = True
        self.fuzzable = False
        self._value = self.original_value = value
        self.name = name
        self.s_type = "static"