Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError when decoding (old?) viewstate #29

Open
meme-lord opened this issue Jan 10, 2024 · 0 comments
Open

IndexError when decoding (old?) viewstate #29

meme-lord opened this issue Jan 10, 2024 · 0 comments

Comments

@meme-lord
Copy link

This is a viewstate from an IIS/7.5 server.

Viewstate:

/wEPDwUJOTM0NDI1NDMxD2QWBGYPFgIeBFRleHQFbTwhRE9DVFlQRSBodG1sIFBVQkxJQyAiLS8vVzNDLy9EVEQgWEhUTUwgMS4wIFN0cmljdC8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9UUi94aHRtbDEvRFREL3hodG1sMS1zdHJpY3QuZHRkIj5kAgQQZGQWAgIBD2QWBGYPZBYEZg9kFgIFC3dwOTI5MzI2MjM0D2QWAmYPZBYSAgEPDxYCHwAFE1JldHVybmluZyBDdXN0b21lcnNkZAIDDxYCHwAFbTxkaXYgY2xhc3M9InJjV2VsY29tZSI+UGxlYXNlIGxvZ2luIHVzaW5nIHRoZSB1c2VybmFtZSBhbmQgcGFzc3dvcmQgeW91IHJlY2VpdmVkIHdoZW4geW91IHNpZ25lZCB1cC4gPC9kaXY+DQpkAgUPDxYCHwAFCVVzZXJuYW1lOmRkAgcPDxYCHhBBdXRvQ29tcGxldGVUeXBlCyoqU3lzdGVtLldlYi5VSS5XZWJDb250cm9scy5BdXRvQ29tcGxldGVUeXBlARYCHgxhdXRvY29tcGxldGUFA29mZmQCCQ8PFgIfAAUJUGFzc3dvcmQ6ZGQCCw8PFgIfAQsrBAEWAh8CBQNvZmZkAg0PZBYCAgEPDxYCHwAFHURpZCB5b3UgZm9yZ2V0IHlvdXIgcGFzc3dvcmQ/FgIeB29uY2xpY2sFDXJldHVybiBmYWxzZTtkAg8PZBYCAgMPZBYCAgEPFgIeA3NyYwVDaHR0cHM6Ly9vcm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PFyUodqFF0sMA3YVI=

Error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/lib/python3.11/site-packages/viewstate/viewstate.py", line 44, in decode
    self.decoded, self.remainder = Parser.parse(self.body)
                                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 35, in parse
    return Parser.registry[marker].parse(remain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 136, in parse
    first, remain = Parser.parse(b)
                    ^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 35, in parse
    return Parser.registry[marker].parse(remain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 137, in parse
    second, remain = Parser.parse(remain)
                     ^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 35, in parse
    return Parser.registry[marker].parse(remain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 137, in parse
    second, remain = Parser.parse(remain)
                     ^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 35, in parse
    return Parser.registry[marker].parse(remain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 202, in parse
    val, remain = Parser.parse(remain)
                  ^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 35, in parse
    return Parser.registry[marker].parse(remain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 148, in parse
    third, remain = Parser.parse(remain)
                    ^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 35, in parse
    return Parser.registry[marker].parse(remain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 202, in parse
    val, remain = Parser.parse(remain)
                  ^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 35, in parse
    return Parser.registry[marker].parse(remain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 137, in parse
    second, remain = Parser.parse(remain)
                     ^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 35, in parse
    return Parser.registry[marker].parse(remain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 202, in parse
    val, remain = Parser.parse(remain)
                  ^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 35, in parse
    return Parser.registry[marker].parse(remain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 137, in parse
    second, remain = Parser.parse(remain)
                     ^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 35, in parse
    return Parser.registry[marker].parse(remain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 202, in parse
    val, remain = Parser.parse(remain)
                  ^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 35, in parse
    return Parser.registry[marker].parse(remain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 136, in parse
    first, remain = Parser.parse(b)
                    ^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 35, in parse
    return Parser.registry[marker].parse(remain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/viewstate/parse.py", line 238, in parse
    l[idx] = val
    ~^^^^^
IndexError: list assignment index out of range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant