Skip to content

Instantly share code, notes, and snippets.

View pedramamini's full-sized avatar
👋

Pedram Amini pedramamini

👋
View GitHub Profile
@pedramamini
pedramamini / disable_ddeauto.reg
Created October 20, 2017 03:41 — forked from wdormann/disable_ddeauto.reg
Disable DDEAUTO for Outlook, Word, and Excel versions 2010, 2013, 2016
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Word\Options]
"DontUpdateLinks"=dword:00000001
[HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Word\Options]
"DontUpdateLinks"=dword:00000001
[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Word\Options]
"DontUpdateLinks"=dword:00000001
@pedramamini
pedramamini / XProtect.yara
Created October 19, 2017 20:18
Apple OSX built in file defense is powered by YARA: /System/Library/CoreServices/XProtect.bundle/Contents/Resources
import "hash"
private rule Macho
{
meta:
description = "private rule to match Mach-O binaries"
condition:
uint32(0) == 0xfeedface or uint32(0) == 0xcefaedfe or uint32(0) == 0xfeedfacf or uint32(0) == 0xcffaedfe or uint32(0) == 0xcafebabe or uint32(0) == 0xbebafeca
}
@pedramamini
pedramamini / yara_fn.py
Created August 19, 2016 13:41 — forked from williballenthin/yara_fn.py
generate a yara rule that matches the basic blocks of the current function in IDA Pro
'''
IDAPython script that generates a YARA rule to match against the
basic blocks of the current function. It masks out relocation bytes
and ignores jump instructions (given that we're already trying to
match compiler-specific bytes, this is of arguable benefit).
If python-yara is installed, the IDAPython script also validates that
the generated rule matches at least one segment in the current file.
author: Willi Ballenthin <william.ballenthin@fireeye.com>
@pedramamini
pedramamini / 00_close_to_low.py
Last active April 22, 2016 18:03
Stock Market Games... these are from 2008.
import sys
import thax
import datetime
y = thax.misc.finance.yahoo()
my_adds = ["ALU", "AMZN", "CMG", "COMS", "DCA", "PLA", "PZZA", "RICK", "UA", "VMW"]
sp_500 = ["BBT", "BDX", "BBBY", "BMS", "BBY", "BIG", "BIIB", "BJS", "BDK", "HRB", "BMC", "BA", "BXP", "BSX", "BMY", "BRCM", "BF.B", "BNI", "CHRW", "CA", "COG", "CAM", "CPB", "COF", "CAH", "CCL", "CAT", "CBG", "CBS", "CELG", "CNP", "CTX", "CTL", "CF", "SCHW", "CHK", "CVX", "CB", "CIEN", "CI", "CINF", "CTAS", "CSCO", "CIT", "C", "CTXS", "CLX", "CME", "CMS", "COH", "KO", "CCE", "CTSH", "CL", "CMCSA", "CMA", "CSC", "CPWR", "CAG", "COP", "CNX", "ED", "STZ", "CEG", "CVG", "CBE", "GLW", "COST", "CVH", "COV", "CSX", "CMI", "CVS", "DHI", "DHR", "DRI", "DVA", "DF", "DE", "DELL", "DDR", "DVN", "DTV", "DFS", "D", "RRD", "DOV", "DOW", "DPS", "DTE", "DD", "DUK", "DYN", "ETFC", "EMN", "EK", "ETN", "EBAY", "ECL", "EIX", "EP", "ERTS", "EQ", "EMC", "EMR", "ESV", "ETR", "EOG", "EFX", "EQR", "EL", "EXC", "EXPE", "EXPD", "ESRX", "XOM", "FDO", "FAST", "FII", "FDX", "FIS", "FITB
@pedramamini
pedramamini / osx_messages_peek.py
Created May 20, 2015 05:04
Extract URLs and related contact information from your OSX Messages.app database.
#!/usr/bin/env python
# Extract URLs and related contact information from your OSX Messages.app database.
#
# TODO
# - automatically resolve username and discover contacts database (by largest item count if there is more than one).
# - make a machine parseable format.
# - keep track of last found URL (by hash?), allow for periodic run of script and addition to output.
# - update to latest gruber regex.
@pedramamini
pedramamini / blaze.py
Last active June 12, 2022 15:22
Blaze your way through Tinder (the dating app).
#!/usr/bin/env python
"""
blaze through tinder
Setup:
- proxy / sniff out your auth token and edit constant under imports.
- API may have changed.
- it's hard coded to search for girls looking for guys.
- this was a quick hack, i'm not maintaining it or answering questions about it.
#!/usr/bin/env python
"""
Desktop Background Rotater
Background images:
http://bitday.me
Crontab entry:
# min hr mday month wday command
@pedramamini
pedramamini / split_mbox_by_year.py
Last active August 29, 2015 14:11
Break an mbox file out into multiple files by year. Written to chunk my GMail Takeout into manageable pieces.
#!/usr/bin/env python
"""
What
Break an mbox file out into multiple files by year.
Written to chunk my GMail Takeout into manageable pieces.
Will prefix YEAR- to mbox name and *append* to those file names.
Who
Pedram Amini
@pedramamini
pedramamini / keybase.md
Created September 30, 2014 16:52
keybase.io proof of ID.

Keybase proof

I hereby claim:

  • I am pedramamini on github.
  • I am pedram (https://keybase.io/pedram) on keybase.
  • I have a public key whose fingerprint is 0724 E980 0B61 5F47 F78E 850C 3232 2632 B543 8A67

To claim this, I am signing this object:

@pedramamini
pedramamini / levenshtein_distance.py
Created September 22, 2014 23:12
Provides the Levenshtein distance between two strings. ie: The number of transformations required to transform one string to the other
########################################################################################################################
def levenshtein_distance (first, second):
"""
Provides the Levenshtein distance between two strings. ie: The number of transformations required to transform
one string to the other.
@type first: String
@param first: First string.
@type second: String
@param second: Second string.