Didier Stevens


CASToggle is a program to manipulate Code Access Security enforcement for an individual program, unlike caspol, which works system-wide. And its effect is immediate.

Usage: CASToggle process-id [toggle]
 Use this program to read or change the SecurityState variable
 of a .NET program (enables/disables Code Access Security Policies)
  process-id is the ID of the running program you want to manipulate
  toggle must be 0, 1 or 2 to change the SecurityState variable
   0 means that the SecurityState variable is uninitialized and that the
     state must be derived from the state of the mutex created by
     caspol -security off
   1 means that CAS Policies are disabled
   2 means that CAS Policies are enabled

To see CASToggle at work, take a look here on YouTube, hires (XviD) version here.


CASToggle_V0_1_1_0.zip (https)

MD5: D565937B49DF96E6A8B88FEDCF15D82A

SHA256: 6DC6913136C74592C4833D1EEF5D70B4DA83AA9A111BC8DE6DDF16A709EF7E91


  1. […] new utility, CASToggle, gives you more control over CAS enforcement. First of all, it operates on a per-process basis. You […]

    Pingback by Fine-Grained Control over Code Access Security « Didier Stevens — Tuesday 12 February 2008 @ 7:12

  2. […] CASToggle « Didier Stevens […]

    Pingback by links for 2008-07-11 « Praveen’s Blog — Friday 11 July 2008 @ 10:59

RSS feed for comments on this post. TrackBack URI

Leave a Reply (comments are moderated)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.