Hooks don’t play well with others

Posted by Eric | Code, Win32 Programming | Wednesday 2 April 2008 9:02 am

<meta name="GENERATOR" content="OpenOffice.org 2.0 (Linux)" /><meta name="CREATED" content="20080402;7434300" /><meta name="CHANGED" content="16010101;0" /><br /> <style> <!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --> </style> <p style="margin-bottom: 0in">Last night I spent a few hours hacking at some c code in an attempt to make two things.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">First, a Keylogger that doesn’t flag with AV and that uses minimul hooking, basically staying in UserLand.</p> <p style="margin-bottom: 0in">Second, A little utility I’m calling tigger. The concept behind Tigger is sort of like pivot from Metasploit. Take traffic in one side and throw it out the other. To visualize this:</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">Source -> Tigger Server -> Target.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">Ideally, Tigger could and will be used for something along the lines of DMZ hopping, or just hoping traffic around inside of a network in order to avoid burning your original point of access.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">I ran into a problem with the Keylogger however, when I went to Compile I got a compilation error stating KBDLLHOOKSTRUCT was undefined. After googling I only received two results, the one mentions to define a preprocessor, or add a preprocessor into the project properties. After adding the following line:</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">#define _WIN32_WINNT 0×401</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">Everything compiles just fine. The problem however, presents itself when you run the keylogger. Everything seems to be hooking correctly, but when you let it go, and type things in it doesn’t seem to log. Any one with more win32 experience have a reason why making the preprocessor declaration would allow me to compile, but somewhere hinder the functionality of the hooks?</p> <p> <!-- Begin Google Adsense code --> <script type="text/javascript"><!-- google_ad_client = "pub-9774791470740882"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <!-- End Google Adsense code --> </p> </div> <div class="feedback"> <a href="http://hamsterswheel.com/techblog/?p=56#respond" title="Comment on Hooks don’t play well with others">Comments (0)</a> </div> </div> </div> <div id="footer"> © Copyright 2009 | <a href="http://hamsterswheel.com/techblog">Phn1x – Hamsterswheel</a> | Theme by <a href="http://clubparexcellancetech.com/">Club Par Excellance</a> | All Rights Reserved | Sponsored by <a href="http://www.voipkit.ca/">VoIP</a> </div> </body> </html>