Skip to content

Instantly share code, notes, and snippets.

local function search_google(...)
local fields = {...};
for i, field in ipairs( fields ) do
if (field.name == 'http.host') then
browser_open_url("https://www.google.com/search?q=" .. field.value)
break
end
end
end
register_packet_menu("HTTP/Search host in Google", search_google, "http.host");
# Download launchpad bugs
import sys
import subprocess
import requests
from launchpadlib.launchpad import Launchpad
cachedir = '.'
launchpad = Launchpad.login_anonymously('just testing', 'production', cachedir, version='devel')
@moshekaplan
moshekaplan / aircrack_coverity.sh
Created August 5, 2019 00:56
Aircrack Coverity build
#!/bin/sh
PROJECT_DIR="/home/moshe/Desktop/aircrack-ng"
COV_BUILD="/home/moshe/Downloads/cov-analysis-linux64-7.6.0/bin/cov-build"
PROJECT_NAME="aircrack-ng"
BUILD_DIR="/home/moshe/Desktop/aircrack-ng_cov/cov-int"
TAR_DIR="/home/moshe/Desktop/aircrack-ng_cov/"
BUILD_CMD="make sqlite=true experimental=true pcre=true -j 4"
# Prepare to build commands
@moshekaplan
moshekaplan / pdf_decrypt.py
Created November 16, 2016 17:54
PyPDF2 attempt at decryption
PyPDF2 attempt at decryption
Modifications to file: pdf.py
References:
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf
https://github.com/qpdf/qpdf/blob/master/libqpdf/QPDF_encryption.cc#L400
http://security.stackexchange.com/questions/95781/what-security-scheme-is-used-by-pdf-password-encryption-and-why-is-it-so-weak
def decode_permissions(self, permissions_code):
@moshekaplan
moshekaplan / PatchExtract125.ps1
Created November 15, 2016 23:27 — forked from anonymous/PatchExtract125.ps1
Patch Extract v1.25 by Greg Linares (@Laughing_Mantis)
<#
================
PATCHEXTRACT.PS1
=================
Version 1.25 Microsoft MSU Patch Extraction and Patch Organization Utility by Greg Linares (@Laughing_Mantis)
This Powershell script will extract a Microsoft MSU update file and then organize the output of extracted files and folders.
Organization of the output files is based on the patch's files and will organize them based on their archicture (x86, x64, or wow64)
as well as their content-type, ie: resource and catalog files will be moved to a JUNK subfolder and patch binaries and index files will
@moshekaplan
moshekaplan / msg.py
Last active November 15, 2016 14:28
Extract features from MSG files. Based on https://github.com/mattgwwalker/msg-extractor/blob/master/ExtractMsg.py Raw
#!/usr/bin/env python
# -*- coding: latin-1 -*-
"""
ExtractMsg:
Extracts emails and attachments saved in Microsoft Outlook's .msg files
https://github.com/mattgwwalker/msg-extractor
"""
__author__ = "Matthew Walker"
@moshekaplan
moshekaplan / TextHandler.py
Last active February 25, 2024 01:33
A Logging Handler that allows logging to a Tkinter Text Widget
#!/usr/bin/env python
# Built-in modules
import logging
import Tkinter
import threading
class TextHandler(logging.Handler):
"""This class allows you to log to a Tkinter Text or ScrolledText widget"""
def __init__(self, text):
@moshekaplan
moshekaplan / selenium_cookies_to_mechanize.py
Created August 29, 2014 14:18
Selenium cookies to Mechanize
import mechanize
import cookielib
import selenium.webdriver
# Create a selenium instance for browsing web pages
driver = selenium.webdriver.Firefox()
# ... Perform some actions
# Grab the cookie
@moshekaplan
moshekaplan / merge_dicts.py
Created August 17, 2014 15:27
Merge Python dictionaries
def merge_dicts(*dicts):
all_items = []
for dictionary in dicts:
all_items += dictionary.items()
return dict(all_items)
#!/usr/bin/env python
"""
Given the result of a multiplication and one of the factors, calculate the
other factor
Arguments:
known_factor = the factor we're given
result = the result of the multiplication modulo some number
size_of_modulo_result = The number of bits in the result