1. A method of generating a filter for inputs to a program comprising: generating an execution trace for the program using an exploit for a vulnerability, the execution trace comprising a list of instructions and a final instruction in the list comprising a vulnerability point; computing an initial set of filter conditions from the execution trace, each filter condition corresponding to an instruction in the execution trace; selecting a subset of the instructions in the execution trace that ensure the vulnerability can be exploited; and generating a revised set of filter conditions by removing conditions from the initial set that do not correspond to an instruction in the subset of instructions.