In this paper the authors describe how to detect passive attack and after that provide prevention from passive attacks. For detection of passive attacks the authors use the concept of key loggers and the concept of registry files. For prevention from passive attacks here they use the concept of virtual keyboards and concept of NAC during online transmission of data. The major function of key-loggers is to record all inputs, hide itself and monitor applications. Here, they will also discuss the behavior and types of key-loggers, basically the concept of key-strokes used by the virtual keyboards.