Skip to content

Instantly share code, notes, and snippets.

View blackfist's full-sized avatar

Kevin Thompson blackfist

View GitHub Profile
@blackfist
blackfist / Mandarin Notes.md
Last active December 22, 2015 01:09
Mandarin words and phrases that I'd like to remember.

My name

  • 凯文 - Kǎi wén

Questions

  • None right now

Phrases

  • 最近有什麼事嗎 - Zuìjìn yǒu shé me shì ma - What's new with you?
  • 我明天早上很早就走 (wŏ míngtiān zăoshàng hĕn zăo jiù zŏu) - I'm leaving very early tomorrow morning.
  • 很高兴跟你讲话 - Hěn gāoxìng gēn nǐ jiǎnghuà - It was nice speaking with you
@blackfist
blackfist / stolen-laptop.csv
Last active December 22, 2015 01:48
Script I wrote to take a csv file and produce VERIS schema-compatible JSON files representing the security incidents.
github vic.name vic.naics vic.country vic.state vic.employee reference summary discovery data.variety data.total asset.variety notification incident data.subject
111 Company 121212 US MN 25001 to 50000 Personal 82160 Other U - Laptop http://youtu.be/RmFnarFSj_U Something happened Days 12/24/2012 12/25/2012
@blackfist
blackfist / ddos-activist.py
Created September 1, 2013 03:31
Script I wrote to take a csv file and produce VERIS schema-compatible JSON files representing the security incidents. This script is for incidents where an activist or activist group launches a Denial of Service attack against a victim's web service.
import json
import uuid
import copy
import csv
import datetime
infile = csv.DictReader(open('list.csv','rU'))
template = {u'impact': {u'loss': [{u'rating': u'Minor', u'variety': u'Asset and fraud'}, {u'rating': u'Minor', u'variety': u'Brand damage'}, {u'rating': u'Minor', u'variety': u'Business disruption'}, {u'rating': u'Minor', u'variety': u'Operating costs'}, {u'rating': u'Minor', u'variety': u'Legal and regulatory'}, {u'rating': u'Minor', u'variety': u'Competitive advantage'}, {u'rating': u'Minor', u'variety': u'Response and recovery'}], u'overall_rating': u'Unknown'}, u'incident_id': u'osint1016', u'reference': u'http://news.softpedia.com/news/Dutch-Government-Identity-Management-Platform-DigiD-Disrupted-by-DDOS-Attack-376189.shtml (20130821) http://www.nrc.nl/nieuws/2013/08/16/digid-deels-plat-door-ddos-aanval/ (20130821)', u'attribute': {u'availability': {u'duration': {u'unit': u'Hours'}, u'notes': u'', u'variety': [u'Interruption']}}, u'discovery_method': u'Unknown', u'schema_version': u'1.2', u'sum
@blackfist
blackfist / CLASS_basic_networking
Last active December 22, 2015 03:09
Review of basic networking topics. #class
# OSI Model
1. Physical - electrical voltage on the wire
2. Data link - **ethernet** communication between two hosts on the same network
3. Network - **IP** - used for getting packets to the right network
4. Transport - **TCP/UDP** - quality control and error correction
5. Session - magic layer
6. Presentation - magic layer
7. Application - magic layer
## OSI Model Exercise
@blackfist
blackfist / CLASS_administrative_controls
Last active December 22, 2015 03:09
Administrative controls. Policies, Procedures, Standards, and Guidelines. #class
## IT Controls Matrix
| | Preventative | Detective | Corrective |
| ------------- |:-------------:|:----------:| -----------|
| Administrative| Policy | Audit | |
| Technical | | | |
| Physical | | | |
## Definitions of Administrative Controls
+ Policy - Broad statement of management intent. **Example:** IT is responsible for secure configuration of endpoints.
@blackfist
blackfist / legal-stuff
Last active December 22, 2015 03:18
Legal Stuff and Ethics. #class
@blackfist
blackfist / gist:6419155
Last active February 8, 2023 01:31
Professors: Stop Assigning Group Projects!

This week is the start of grad school. Since I'm also working full time I decided to take it easy and only registered for two classes. I know that is a small sample size, but I'm pretty disappointed to learn that both of the classes have a lot of group projects involved in them. And I remember from my time as an undergrad student that (almost) every professor was assigning group projects too. Ugh group projects suck! I had hoped that I would be done with group projets when I left undergrad behind. Collaborative learning: the go-to pedagogy for lazy professors when service learning isn't available for some reason.

First, a distinction

I draw a distinction between group projects and group work. To me, a group project is a larger deliverable where the intent is that students will work together over a longer period of time. Group work, on the other hand, is what I call it when you have students break into smaller groups within the class period to discuss something amongst themselves and possibly produce a sho

@blackfist
blackfist / gist:6427704
Last active December 22, 2015 05:58
We noticed a problem with the VERIS Community Database where incidents that involved loss or theft were not being coded up with the availability attribute set. This script fixes that for all those incidents. #VCDB
import json
import os
def FixAttribute(inDict,filename):
if 'availability' not in inDict['attribute'].keys():
print filename + " is messed up."
inDict['attribute']['availability'] = {}
inDict['attribute']['availability']['variety'] = ['Loss']
return inDict
@blackfist
blackfist / gist:6428581
Last active December 22, 2015 06:08
Simple script to count the number of issues closed by each person in a git repo
import urllib
import json
import operator
# Only going to grab 300 issues. May need to change this line
filehandle = urllib.urlopen('https://api.github.com/repos/vz-risk/VCDB/issues?state=closed&per_page=300')
usercount = {}
issues = json.loads(filehandle.read())
@blackfist
blackfist / deface-activisty.py
Created September 4, 2013 15:10
Python script that takes a csv file and turns it into a set of .json files which are VERIS 1.2 schema compliant. This script is for incidents where an external activist has defaced a website. #hacking #defacement #veris
import json
import uuid
import copy
import csv
import datetime
infile = csv.DictReader(open('list.csv','rU'))
template = {u'impact': {u'overall_rating': u'Unknown'}, u'incident_id': '', u'reference': '', u'attribute': {u'integrity': {u'notes': u'', u'variety': [u'Modify data', u'Misappropriation']}}, u'notes': u'', u'schema_version': u'1.2', u'summary': '', u'action': {u'hacking': {u'notes': u'', u'vector': [u'Web application'], u'variety': ['Unknown']}}, u'security_incident': u'Confirmed', u'plus': {u'f500': u'N', u'master_id': u'osint523', u'timeline': {u'notification': {}}}, u'actor': {u'external': {u'motive': ['Ideology'], u'country': [u'Unknown'], u'variety': ['Activist']}}, u'victim': [{u'victim_id': '', u'country': '', u'notes': u'', u'industry': ''}], u'timeline': {u'incident': {u'year': 2012}}, u'source_id': u'osint', u'discovery_method': u'Ext - actor disclosure', u'asset': {u'assets': [{u'variety': u'S - Web application'}]}}
for row in infile: