Skip to content

Instantly share code, notes, and snippets.

View ianatha's full-sized avatar

Ian Atha ianatha

View GitHub Profile
@ianatha
ianatha / quick_linux_setup.sh
Last active March 1, 2022 14:56
quick linux setup
useradd -m -d /home/iwa -s /bin/bash iwa
mkdir /home/iwa/.ssh
curl -s https://api.github.com/users/ianatha/keys | grep '"key"' | grep --color=never -o "ssh-rsa .*[^\"]" > /home/iwa/.ssh/authorized_keys
chmod 0700 /home/iwa/.ssh
chmod 0600 /home/iwa/.ssh/authorized_keys
chown -R iwa:iwa /home/iwa/.ssh
usermod -a -G sudoers iwa || usermod -a -G sudo iwa || usermod -a -G wheel iwa
passwd iwa
curl -fsSL https://tailscale.com/install.sh | sh
@ianatha
ianatha / dicom-bruteforce.py
Created August 21, 2019 00:28
DEFCON 27 BHV CTF
#/usr/bin/env python3
# run me with ulimits -n 2048
import itertools
import string
from pydicom.dataset import Dataset
from pynetdicom import AE, QueryRetrievePresentationContexts
from pynetdicom.sop_class import PatientRootQueryRetrieveInformationModelFind
import sys
import time
@ianatha
ianatha / short_medmonitor.py
Created August 20, 2019 23:57
DEFCON 27 BHV CTF MedMonitor task
#!/usr/bin/python2
import os
import sys
import struct
from flask import Flask, request, render_template, redirect, url_for, flash, make_response
import pickle
app = Flask(__name__)
@app.route('/register_patient')
@ianatha
ianatha / bacnetlightingxfil.py
Created August 17, 2019 00:24
Solution for a DEFCON 26 Biohacking Village CTF challenge
#!/usr/local/bin/python3
import binascii
import pyshark
set_brightness_cap = pyshark.FileCapture('bacnetlightingxfil.pcap',
display_filter='bacnet && (bacapp.confirmed_service == 15) && (bacapp.type == 0)'
)
vals = [ int(packet.bacapp.present_value_real) for packet in set_brightness_cap ]
system_profiler SPHardwareDataType | grep "Serial Number" | cut -d':' -f2 | pbcopy
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew cask install google-chrome slack
brew install dockutil
dockutil --add "/Applications/Google Chrome.app" --position beginning
dockutil --add "/Applications/Slack.app" --after "Google Chrome"
open "/Applications/Google Chrome.app"
open "/Applications/Slack.app"
dockutil --remove "Siri" --remove "Launchpad" --remove "Contacts" --remove "Reminders" --remove "Notes" --remove "Maps" --remove "Photos" --remove "Messages" --remove "Safari"
dockutil --remove "FaceTime" --remove "Pages" --remove "Numbers" --remove "Keynote" --remove "iTunes" --remove "iBooks"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew cask install google-chrome slack
brew install dockutil
dockutil --add "/Applications/Google Chrome.app" --position beginning
dockutil --add "/Applications/Slack.app" --after "Google Chrome"
open "/Applications/Google Chrome.app"
open "/Applications/Slack.app"
dockutil --remove "Siri" --remove "Launchpad" --remove "Contacts" --remove "Reminders" --remove "Notes" --remove "Maps" --remove "Photos" --remove "Messages" --remove "Safari"
dockutil --remove "FaceTime" --remove "Pages" --remove "Numbers" --remove "Keynote" --remove "iTunes" --remove "iBooks"
@ianatha
ianatha / duplicate_files.kt
Created October 11, 2018 03:43
Quickly find files with duplicate content in Kotlin
import java.io.RandomAccessFile
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
import java.security.MessageDigest
import java.security.DigestInputStream
import kotlin.streams.toList
fun ByteArray.toHexString(): String {
val result = StringBuilder()

Keybase proof

I hereby claim:

  • I am ianatha on github.
  • I am ianatha (https://keybase.io/ianatha) on keybase.
  • I have a public key whose fingerprint is 00FD 9E6A 4AD7 70E8 3595 FCC9 292C B8B9 3CEF 4A43

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am ianatha on github.
  • I am ianatha (https://keybase.io/ianatha) on keybase.
  • I have a public key whose fingerprint is 00FD 9E6A 4AD7 70E8 3595 FCC9 292C B8B9 3CEF 4A43

To claim this, I am signing this object: