{"id":22448432,"url":"https://github.com/yuvadm/viewstate","last_synced_at":"2025-10-04T00:18:50.520Z","repository":{"id":48463442,"uuid":"54600633","full_name":"yuvadm/viewstate","owner":"yuvadm","description":"ASP.NET View State Decoder","archived":false,"fork":false,"pushed_at":"2024-05-20T10:32:51.000Z","size":148,"stargazers_count":105,"open_issues_count":17,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T01:11:18.280Z","etag":null,"topics":["asp-net","dotnet","hacktoberfest","python","python3","scraping","security","viewstate","web-security"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yuvadm.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-23T23:42:57.000Z","updated_at":"2025-02-20T02:16:19.000Z","dependencies_parsed_at":"2024-06-19T00:23:27.909Z","dependency_job_id":"15492562-5dff-45aa-9cdd-e8c16bfc5cc0","html_url":"https://github.com/yuvadm/viewstate","commit_stats":{"total_commits":108,"total_committers":3,"mean_commits":36.0,"dds":0.09259259259259256,"last_synced_commit":"d71ef41dee820f8403bc7c57bcf3bc5756806549"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuvadm%2Fviewstate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuvadm%2Fviewstate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuvadm%2Fviewstate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuvadm%2Fviewstate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuvadm","download_url":"https://codeload.github.com/yuvadm/viewstate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247563942,"owners_count":20958971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net","dotnet","hacktoberfest","python","python3","scraping","security","viewstate","web-security"],"created_at":"2024-12-06T04:27:47.438Z","updated_at":"2025-10-04T00:18:50.515Z","avatar_url":"https://github.com/yuvadm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"ASP.NET View State Decoder\n==========================\n\nA small Python library for decoding ASP.NET viewstate.\n\nViewstate is a method used in the ASP.NET framework to persist changes to a web form across postbacks. It is usually saved on a hidden form field:\n\n.. code-block:: html\n\n   \u003cinput type=\"hidden\" name=\"__VIEWSTATE\" id=\"__VIEWSTATE\" value=\"/wEP...\"\u003e\n\nDecoding the view state can be useful in penetration testing on ASP.NET applications, as well as revealing more information that can be used to efficiently scrape web pages.\n\n.. image:: https://github.com/yuvadm/viewstate/workflows/Build/badge.svg\n    :target: https://github.com/yuvadm/viewstate/actions\n\n.. image:: https://img.shields.io/pypi/v/viewstate\n    :target: https://pypi.org/project/viewstate/\n\nInstall\n-------\n\n.. code-block:: shell\n\n   $ pip install viewstate\n\nUsage\n-----\n\nThe Viewstate decoder accepts Base64 encoded .NET viewstate data and returns the decoded output in the form of plain Python objects.\n\nThere are two main ways to use this package. First, it can be used as an imported library with the following typical use case:\n\n.. code-block:: python\n\n  \u003e\u003e\u003e from viewstate import ViewState\n  \u003e\u003e\u003e base64_encoded_viewstate = '/wEPBQVhYmNkZQ9nAgE='\n  \u003e\u003e\u003e vs = ViewState(base64_encoded_viewstate)\n  \u003e\u003e\u003e vs.decode()\n  ('abcde', (True, 1))\n\nIt is also possible to feed the raw bytes directly:\n\n.. code-block:: python\n\n  \u003e\u003e\u003e vs = ViewState(raw=b'\\xff\\x01....')\n\nAlternatively, the library can be used via command line by directly executing the module:\n\n.. code-block:: shell\n\n  $ cat data.base64 | python -m viewstate\n\nWhich will pretty-print the decoded data structure.\n\nThe command line usage can also accept raw bytes with the ``-r`` flag:\n\n.. code-block:: shell\n\n  $ cat data.base64 | base64 -d | python -m viewstate -r\n\nViewstate HMAC signatures are also supported. In case there are any remaining bytes after parsing, they are assumed to be HMAC signatures, with the types estimated according to signature length.\n\n.. code-block:: python\n\n   \u003e\u003e\u003e vs = ViewState(signed_view_state)\n   \u003e\u003e\u003e vs.decode()\n   \u003e\u003e\u003e vs.mac\n   'hmac_sha256'\n   \u003e\u003e\u003e vs.signature\n   b'....'\n\nDevelopment\n-----------\n\nDevelopment packages can be installed with ``uv``. Unit tests, lints and code formatting tasks can be run with:\n\n.. code-block:: shell\n\n  $ uv sync --group dev\n  $ uv run pytest\n  $ uv run ruff\n\nFor PyPI releases, run build and publish:\n\n.. code-block:: shell\n\n  $ uv build\n  $ uv publish\n\nNote that for uploading a new package version, a valid PyPI auth token should be configured.\n\nReferences\n----------\n\nSince there is no publically available specification of how .NET viewstate is encoded, reverse engineering was based on prior work:\n\n- https://github.com/mutantzombie/JavaScript-ViewState-Parser\n- http://viewstatedecoder.azurewebsites.net/\n- https://referencesource.microsoft.com/#System.Web/UI/ObjectStateFormatter.cs,45\n- https://msdn.microsoft.com/en-us/library/ms972976.aspx\n\nAny official documents would be gladly accepted to help improve the parsing logic.\n\nLicense\n-------\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuvadm%2Fviewstate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuvadm%2Fviewstate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuvadm%2Fviewstate/lists"}