Skip to content

Instantly share code, notes, and snippets.

View mheidari98's full-sized avatar
🕊️
Woman, Life, Freedom

Mahdi Heidari mheidari98

🕊️
Woman, Life, Freedom
View GitHub Profile
@mheidari98
mheidari98 / script.py
Created January 16, 2024 10:49
CTFTIME Comparing the distribution of points
import requests
from bs4 import BeautifulSoup
import matplotlib.pyplot as plt
def getPoint(event_id, topN=50):
headers = { "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0"}
r = requests.get(f"https://ctftime.org/event/{event_id}", headers=headers)
soup = BeautifulSoup(r.text, 'html.parser')
title = soup.find('div', class_="page-header").text.strip()
teams = soup.find_all('tr')[1:]
@mheidari98
mheidari98 / CNFinder.py
Created September 29, 2023 12:11
extract the Common Name (CN) from SSL certificates associated with given IP addresses or domains
import argparse
import ipaddress
import re
import socket
import ssl
import time
import dns.resolver # pip install dnspython
import dns.reversename
import pandas as pd # pip install pandas
import requests # pip install requests
@mheidari98
mheidari98 / checker.py
Created September 16, 2023 05:19
Check MENA teams rank in CSAW CTF
import requests
from bs4 import BeautifulSoup
MENA = {"Algeria", "Azerbaijan", "Bahrain", "Chad", "Djibouti", "Egypt", "Eritrea", "Georgia",
"Iran", "Iraq", "Israel", "Jordan", "Kuwait", "Lebanon", "Libya", "Mauritania", "Morocco", "Oman",
"Pakistan", "Palestine", "Qatar", "Saudi Arabia", "South Sudan", "Sudan", "Syria", "Tunisia", "Turkey",
"United Arab Emirates","Yemen"}
def getTeam(url):
@mheidari98
mheidari98 / LettersPositions.py
Created September 13, 2023 02:34
Letters Positions Encryption & Decryption
import time
import random
def encrypt(txt):
lst = [f"{c}{i+1}" for i, c in enumerate(txt)]
random.shuffle(lst)
print(f" cipher: {' '.join(lst)}\n")
def decrypt(enc):
@mheidari98
mheidari98 / unicode.json
Created August 24, 2023 08:18
unicode for CTF py jail
{
"a": [
97,
170,
7491,
8336,
65345
],
"b": [
98,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mheidari98
mheidari98 / asnlookup_scraper.py
Created February 27, 2023 09:26
scrape Cloudflare IPv4s from asnlookup.com
import re
import time
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
# old version and not working now
def getCfCIDR():
try:
r = requests.get('https://asnlookup.com/organization/cloudflare')
@mheidari98
mheidari98 / mathler.js
Created February 21, 2022 07:49
Solving mathler.com :D
const HARDWORDS = [
'(7-4)*92',
'96/3+8*2',
'112/4*25',
'(48-2)/4',
'185*4-17',
'96/(2+4)',
'456/12-5',
'(7-4)*92',
'96/3+8*2',