Skip to content

Instantly share code, notes, and snippets.

View anmolj7's full-sized avatar

Anmol Jhamb anmolj7

View GitHub Profile
import subprocess as sp
from hashlib import md5, sha1, sha384, sha224, sha512, sha256
import os
HASHES = ['sha256', 'sha384', 'sha224', 'sha512', 'sha1', 'md5']
def breakline():
print('-'*80)
def clrscr():
@anmolj7
anmolj7 / tensor.yml
Created December 8, 2019 13:16
Ansible playbook to install tensorflow on fedora systems.
---
- hosts: localhost
become: yes
name: play_1
tasks:
- name: Installing Python3.6
dnf: name=python3.6 state=latest
- name: Downloading get-pip.py
shell: wget https://bootstrap.pypa.io/get-pip.py
from shodan import Shodan
import subprocess as sp
import requests
api = Shodan("iG0r3X7hjuIVWlopWTyy8DPO7eIF3wEG")
def clrscr():
sp.call(["clear"], shell=True)
def breakline():
import subprocess as sp
import socket
def clrscr():
sp.call("clear", shell=True)
def get_ip():
output = sp.check_output(["ip route | grep default"], shell=True) # Gets the gateway.
output = output.decode("utf8")
#!/bin/bash
file=$(ls -1 | python3 -c "import os; import random; files=os.listdir(os.getenv('HOME')+'/Pictures/Wallpapers'); print(random.choice(files));")
XDG_RUNTIME_DIR=/run/user/$(id -u) gsettings set org.gnome.desktop.background picture-uri file:///$HOME/Pictures/Wallpapers/$file
from PIL import Image
def gen_data(data):
new_data = []
for i in data:
new_data.append(format(ord(i), '08b'))
return new_data
@anmolj7
anmolj7 / control_mouse.py
Created December 4, 2019 06:00
I actually worked as an intern for an IOT company for 2 weeks, and I created a red object tracker there, so, I just modified the code to control the mouse. The directions are a bit confusing, Like, if you move your hand up, it moves the cursor down.
#import requests This is a required module if you want to use your android's webcam.
import cv2
import numpy as np
import pyautogui
import mouse
from math import sqrt
prev_cord = None
sX, sY = pyautogui.size()
sX, sY = sX//2, sY//2
import socket, threading
def connect(ip, port_number, delay, output):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.settimeout(delay)
try:
sock.connect((ip, port_number))
output[port_number] = True
except:
@anmolj7
anmolj7 / custom_dork.py
Last active December 3, 2019 20:38
The google search isn't working :(
import requests
from bs4 import BeautifulSoup
from fake_useragent import UserAgent
ua = UserAgent().random
def bing_search(string):
urls = []
payload = {
'q': string
@anmolj7
anmolj7 / reverseDNS.py
Created December 3, 2019 19:58
I first tried with requests and bs4 but it didn't work, the captcha came, so, instead, I had to use mechanize to browse the url, I mean, I could've used mechanize to fill out the form, and then, parse html, but why bother when you can just do this?
import mechanize
from bs4 import BeautifulSoup
name = input("Enter the name you wanna search for: ").replace(" ", "+")
br = mechanize.Browser()
br.addheaders = [("User-agent","Mozilla/5.0")]
resp = br.open("https://viewdns.info/reversewhois/?q={}".format(name))
soup = BeautifulSoup(resp.read(), "lxml")