Skip to content

Instantly share code, notes, and snippets.

@defparam
defparam / fuzz.py
Created March 13, 2021 23:54
Differential Fuzzing of Regex using Atheris
import sys, re
import atheris
from urllib.parse import urlparse
# Our sketchy regex to be tested
OurRegex = re.compile(b"^(((([A-Za-z0-9.-]*\.)?example1\.com)|(([A-Za-z0-9.-]*\.)\?example2\.com)|(([A-Za-z0-9.-]*\.)?example3\.com)))")
# The allow list of domains the regex is trying to validate
Allowlist = [b"example1.com", b"example2.com", b"example3.com"]
@aydinnyunus
aydinnyunus / logistic_regression.py
Created December 3, 2019 15:11
Estimating Gender with Height and Weight
from sklearn.linear_model import LogisticRegression
from sklearn.linear_model import LinearRegression
import pandas as pd
import numpy as np
df = pd.read_csv('W.csv',sep = ',')
df['Height']= df.Height*2.54
df['Weight'] = df.Weight*0.45
Gender = df[df.columns[0]]
HW = df[df.columns[1:3]]
@aydinnyunus
aydinnyunus / NN.py
Created December 2, 2019 15:54
Basic Neural Networks on Python
from numpy import exp,array,random,dot
class NeuralNetwork():
def __init__(self):
random.seed(1)
self.synaptic_weights = 2* random.random((3,1))-1
def __sigmoid(self,x):
return 1/(1+exp(-x))
@aydinnyunus
aydinnyunus / Recommend.py
Created December 2, 2019 14:35
Clothes Recommender System
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import linear_kernel
ds = pd.read_csv("sample-data.csv")
tf = TfidfVectorizer(analyzer='word', ngram_range=(1, 3), min_df=0, stop_words='english')
tfidf_matrix = tf.fit_transform(ds['description'])
cosine_similarities = linear_kernel(tfidf_matrix, tfidf_matrix)
@aydinnyunus
aydinnyunus / Dict.py
Created December 2, 2019 14:33
English Dictionary on Python
import json
from difflib import get_close_matches
data = json.load(open("data.json"))
def translate(word):
word = word.lower()
if word in data:
return data[word]
elif word.title() in data:
@aydinnyunus
aydinnyunus / BreastCancerDetection.py
Created December 2, 2019 14:30
Breast Cancer Detection
import numpy as np
from sklearn.preprocessing import Imputer
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score
import pandas as pd
from sklearn import cross_validation
veri = pd.read_csv("cancer.data")
veri.replace("?",-99999,inplace=True)
@aydinnyunus
aydinnyunus / WpBot.py
Created December 2, 2019 14:24
Whatsapp Automatic Message System
# get current date in required format
import datetime
# store the birthdates of your contacts
import json
from selenium import webdriver
# add a delay so that all elements of
# the webpage are loaded before proceeding
@ur0
ur0 / README.md
Last active June 13, 2024 00:24
SockPuppet 3

SockPuppet 3

This is a kernel exploit targeting iOS 12.0-12.2 and 12.4. It exploits a dangling kernel pointer to craft a fake task port corresponding to the kernel task and gets a send right to it.

This code is not readily compilable — some common sense is a prerequisite. If you do get it going though, it is extremely reliable on any device with more than a gigabyte of RAM. Interested readers may want to investigate how reallocations can be prevented -- this might improve reliability even more.

License

@dogrocker
dogrocker / Wireless Penetration Testing Cheat Sheet.md
Created July 2, 2016 18:30
Wireless Penetration Testing Cheat Sheet

#Wireless Penetration Testing Cheat Sheet

##WIRELESS ANTENNA

  • Open the Monitor Mode
root@uceka:~# ifconfig wlan0mon down
root@uceka:~# iwconfig wlan0mon mode monitor
root@uceka:~# ifconfig wlan0mon up