Is it possible to decrypt and view ViewState value

2019-01-25 12:32发布

I know there are tools out there that will let you see the content of asp.net viewstate. Is it possible to see and modify the content of viewState if it has been encrypted by adding the <machineKey ... /> node to the web.config?

3条回答
Luminary・发光体
2楼-- · 2019-01-25 12:50

Sure. ViewState is simply base64 encoded (unless you specify that it should be encrypted). Here's a link to someone that wrote a ViewState viewer. Here's another by Fritz Onion. You probably will not be able to directly modify the ViewState (i.e. outside of code) because ASP.NET has checks in place to specifically ensure that nothing has tampered with the ViewState. See the EnableViewStateMAC setting for more.

Update

Thanks to link rot, the links to the various viewers are no longer valid. However, a simple search for "viewstate viewer" can find others on the Internet such as ASP.NET ViewState viewer

查看更多
▲ chillily
3楼-- · 2019-01-25 12:58

Please take a look into here How to decode viewstate I have provided full source code to get StateBag from viewstate string. Encrypted states are also possible to decrypt using same method but assigning keys.

查看更多
混吃等死
4楼-- · 2019-01-25 12:59

I like this view state decoder. Very easy to use.

http://ignatu.co.uk/ViewStateDecoder.aspx

enter image description here

查看更多
登录 后发表回答