Skip to content

Instantly share code, notes, and snippets.

View krlplm's full-sized avatar

Hem Karlapalem krlplm

View GitHub Profile
@Neo23x0
Neo23x0 / detect-dirtycow.sh
Last active February 2, 2023 03:26
One-Liner to Detect DirtyCOW Code
#!/bin/bash
# - Matches on source and compiled code
# - Searches in user home directories by default
# - Detects certain strings in files smaller 300 kbyte
# - Does not print anything if nothing was found
# - Appends the file's time stamp of the files in question > good indicator to spot false positives
# - Should work on most Linux systems with bash
# Old version
# for f in $(find /home/ -type f -size -300 2> /dev/null); do if [[ $(strings -a "$f" 2> /dev/null | egrep "/proc/(self|%d)/(mem|maps)") != "" ]];then m=$(stat -c %y $f); echo "Contains DirtyCOW string: $f MOD_DATE: $m"; fi; done;
for f in $(find /home/ -type f -size -300 2> /dev/null); do if [[ $(egrep "/proc/(self|%d)/(mem|maps)" "$f") != "" ]];then m=$(stat -c %y "$f"); echo "Contains DirtyCOW string: $f MOD_DATE: $m"; fi; done;
@englehardt
englehardt / get_alexa_category_list.py
Last active September 14, 2020 17:01
A scraper that grabs urls for the top 500 sites in each Alexa category. Requires python packages `dill` and `bs4`.
from collections import defaultdict
import dill
import requests
from bs4 import BeautifulSoup
alexa_categories = defaultdict(list)
BASE_URL = 'http://www.alexa.com/topsites/category'
print "Grabbing categories of top sites from %s" % BASE_URL