This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import textwrap, re, urllib | |
parse_sig = re.compile( | |
'\[(.*?)\]\s+?signature\s*=\s*(.*?)(\s+\?\?)*\s*ep_only\s*=\s*(\w+)(?:\s*section_start_only\s*=\s*(\w+)|)', re.S) | |
sig_f = urllib.urlopen('userdb.txt') | |
sig_data = sig_f.read() | |
sig_f.close() | |
sigs = parse_sig.findall(sig_data) | |
for packer_name, signature, superfluous_wildcards, ep_only, section_start_only in sigs: | |
print packer_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def b64decode(string,alphabet): | |
string = string.replace("=","") | |
ret = "" | |
left = 0 | |
for i in range(0, len(string)): | |
if left == 0: | |
left = 6 | |
else: | |
value1 = alphabet.index(string[i - 1]) & (2 ** left - 1) | |
value2 = alphabet.index(string[i]) >> (left - 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import dpkt, sys | |
def b64decode(string,alphabet): | |
string = string.replace("=","") | |
ret = "" | |
left = 0 | |
for i in range(0, len(string)): | |
if left == 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dpkg -l 'linux-*' | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | grep -E "(image|headers)"|xargs sudo dpkg -P |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# twitter + insomnia + curiosity = crappy python code | |
# https://twitter.com/criznash/status/950268556544942080 | |
import requests | |
import bs4 | |
comedy = "https://en.wikipedia.org/wiki/Golden_Globe_Award_for_Best_Motion_Picture_%E2%80%93_Musical_or_Comedy" | |
director = "https://en.wikipedia.org/wiki/Golden_Globe_Award_for_Best_Director" | |
d = requests.get(comedy) |