Skip to content

Instantly share code, notes, and snippets.

@dotps1
dotps1 / WannaCryVulnerbilityTesting.ps1
Last active May 31, 2017
Test for WannaCry Vulns using PSJobs
View WannaCryVulnerbilityTesting.ps1
#requires -module ActiveDirectory
# Input computers.
$threshold = (Get-Date).AddDays(-180)
$computers = Get-ADComputer -Filter { OperatingSystem -notlike "*server*" -and OperatingSystem -like "*windows*" -and PasswordLastSet -gt $threshold } |
Select-Object -ExpandProperty Name |
Sort-Object -Property Name
# Make sure there are not existing jobs.
Get-Job |
@leechristensen
leechristensen / settingcontent-ms.xsd
Created Jun 22, 2017
.settingcontent-ms XML Schema (embedded in shell.dll)
View settingcontent-ms.xsd
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ac="http://schemas.microsoft.com/Search/2013/SettingContent" targetNamespace="http://schemas.microsoft.com/Search/2013/SettingContent" elementFormDefault="qualified" >
<xsd:annotation>
<xsd:documentation xml:lang="en">Copyright (C) Microsoft. All rights reserved.
Searchable setting content file schema.
</xsd:documentation>
</xsd:annotation>
<xsd:element name="SearchableContent" type="ac:SearchableContentType"/>
<xsd:complexType name="SearchableContentType">
<xsd:sequence>
@mak
mak / hdoc.py
Last active Oct 28, 2018
Extract payload from H-docs
View hdoc.py
#!/usr/bin/env python2
import os
import re
import sys
import math
import pefile
import struct
import hashlib
import argparse
from oletools import olevba
View dedosfuscator.py
import sys
import re
if len(sys.argv) <= 1: exit()
scriptpath = sys.argv[1]
with open(scriptpath, 'r') as scriptfile:
script = scriptfile.read().replace('^', '')
p = re.compile('\([Ss][Ee][Tt][^=]+=([^&]+)&&')
s = p.search(script)
@bontchev
bontchev / unhide.py
Last active Jun 22, 2020
A script for unhiding hidden Excel sheets
View unhide.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
try:
import olefile
@djhohnstein
djhohnstein / theircorp.tlb
Created Jan 23, 2019
TypeLib - Details. .tlb
View theircorp.tlb
https://ghostbin.com/paste/4x325
<o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o>
* * * * * * * * * * * * * * * * * * * * *
* *
* *
* The Unofficial *
* *
@jcaraballo
jcaraballo / git-branch-between-different-repositories.md
Created Mar 6, 2012
How to fork a github repository in bitbucket
View git-branch-between-different-repositories.md

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync
@lonetwin
lonetwin / print_table.py
Last active May 7, 2021
print out ascii tables in python using data in the form: [ ('column 0 title', 'column 1 title' ..), ('row 0, column 0 data', 'row 0, column 1 data' ...) ...]
View print_table.py
# I needed to print out ascii tables from data in the form:
# [ ('column 0 title', 'column 1 title' ..),
# ('row 0, column 0 data', 'row 0, column 1 data' ...) ...]
#
# and surprisingly it got complicated because of variable lengths of the data.
# I googled for 'standard' ways of doing this and I found suggestions like:
# http://stackoverflow.com/questions/5909873/python-pretty-printing-ascii-tables
# ...which were a bit dated and hard to read or full scale modules like:
#
# http://pypi.python.org/pypi/texttable/
View gist:cee5cfb9d4bb1becc14fd1dd1df22601
# Unhide all the very hidden sheets in an Office 97 Excel file.
from __future__ import print_function
import re
import sys
# Read in the Excel file for which to unhide sheets.
fname = sys.argv[1]
f = open(fname, 'rb')
data = f.read()
@gpoulter
gpoulter / csv_to_mm.py
Created Apr 10, 2012
Build Freemind MindMap from Excel file
View csv_to_mm.py
#!/usr/bin/python
"""Convert CSV table to MindMap format
Usage: python csv_to_mm.py sometable.csv > mymap.mm
CSV format is rows representing tree leaves, e.g.:
A1,
A1,B1
A1,B1,C1
A1,B1,C2