Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View fhightower's full-sized avatar
🎯
Focusing

Floyd fhightower

🎯
Focusing
View GitHub Profile
@fhightower
fhightower / temp_file_s3.py
Created December 30, 2017 18:23
Uploading a tempfile to Amazon S3.
import tempfile
import boto3
s3 = boto3.client('s3')
bucket_name = 'my-bucket'
file_key = 'myfile.txt'
temp_file = tempfile.TemporaryFile()
@fhightower
fhightower / tiddly_wiki.py
Created August 14, 2019 12:20
Making requests to tiddlywiki
"""Code showing how to create a tiddler in tiddly wiki using python. I was not able to get this working without the "X-Requested-With" header."""
import requests
TIDDLY_WIKI_URL = 'https://localhost:8080'
TIDDLY_WIKI_REQUEST_HEADERS = {
# this "X-Requested-With" header is the key to making these requests work
'X-Requested-With': 'TiddlyWiki',
'Content-Type': 'application/json'
}
@fhightower
fhightower / type_hints_to_english.py
Last active February 23, 2021 22:23
Convert python type hints to plain english
def _get_name(ele):
if hasattr(ele, '_name'):
return ele._name
else:
return ele.__name__
def f(a):
# todo: handle optional
# todo: handle union
@fhightower
fhightower / tql_queries.md
Last active May 16, 2020 02:01
List of helpful TQL (ThreatConnect Query Language) Queries and Browse Screen Views for ThreatConnect

View tasks assigned to me that are not completed or deferred:

typeName in ("Task") and taskAssignee = me and taskStatus != "Completed" and taskStatus != "Deferred"

View internationalized domains:

typeName in ("Host", "URL") and summary contains "xn--"

View over 50 security blogs in ThreatConnect:

@fhightower
fhightower / rcc_and_luther_baptism_logic_validator.pl
Last active January 14, 2020 02:09
Validation of the logic behind affirmations on the Roman Catholic Church's and Luther's teaching on baptism
/* You can test this code here: https://swish.swi-prolog.org/example/examples.swinb */
x('Baptism is necessary for salvation in most cases').
teaches(rcc, x).
teaches(luther, x).
false(x).
falseTeacher(N) :- teaches(N, X), false(X).
/* ?- falseTeacher(luther). (returns: true) */
/* ?- falseTeacher(rcc). (returns: true) */
@fhightower
fhightower / crontab.conf
Created July 23, 2019 14:39
Helpful crontab config
# It is helpful to add the following lines to crontab on a linux box:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
@fhightower
fhightower / indicator_status_example.pbx
Created June 6, 2019 12:28
Playbook using indicator status updater component
{
"name" : "Indicator status example",
"type" : "Standard",
"panX" : 20.0,
"panY" : 20.0,
"logLevel" : "DEBUG",
"description" : "",
"version" : "1.2",
"comment" : "Auto-Saved on Thu Jun 06 12:08:18 UTC 2019",
"jobList" : [ {
@fhightower
fhightower / twitter.txt
Last active August 24, 2018 11:58
twitter
illegalFawn
Honeypylog
phishingalert
---
JAMESWT_MHT - low
VK_Intel - low
c0d3inj3cT - low
ScumBots
@fhightower
fhightower / datastore.service.ts
Created May 8, 2018 12:12
Generic datastore service for using ThreatConnect's datastore
import { Injectable } from '@angular/core';
import {
SpacesLoggingService,
SpacesMessagesService
} from 'spaces-ng';
import { TcExchangeDbService } from 'threatconnect-ng';
@Injectable()
export class DatastoreService {
@fhightower
fhightower / imbd.json
Created April 28, 2018 20:56
aws imbd.json file used in demo for AWS Cloud Search
This file has been truncated, but you can view the full file.
[
{
"fields" : {
"directors" : [
"Joseph Gordon-Levitt"
],
"release_date" : "2013-01-18T00:00:00Z",
"rating" : 7.4,
"genres" : [
"Comedy",