Skip to content

Instantly share code, notes, and snippets.

Joshua Small technion

Block or report user

Report or block technion

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@technion
technion / otxhashget.ps1
Created Jul 26, 2019
Alien Vault OTX file hash IOC download Powershell
View otxhashget.ps1
# Script to create current IOC hash file from Alien Vault Open Threat Exchange
$apikey = "KEY"
$feedurl = "https://otx.alienvault.com/api/v1/pulses/subscribed/?limit=10&page=1"
Start-Transcript -Path E:\custom-hash-iocs.txt
function fetchOTX($url) {
$indicators = Invoke-RestMethod -Uri $url -Headers @{"X-OTX-API-KEY"="$apikey"}
foreach($ioc in $indicators.results.indicators) {
if ($ioc.type -like "FileHash-*") {
View phishget.rb
#!/usr/bin/env ruby
require 'httparty'
FILELIST = [
'/dropbox.zip',
'/robots.txt', # Not from the original list - this serves as a sanity check as it usually exists
'/css/business-frontpage.css',
'/newphase.zip',
'/Doc.zip',
'/wp-content.zip',
@technion
technion / assertions.c
Created Apr 27, 2019
Assertion testing
View assertions.c
$ cat assertion.c
#include <stdio.h>
#include <assert.h>
int main()
{
int i = 7;
assert(i > 10);
printf("Just printing something\n");
return 0;
View vlanconvert.rb
#!/usr/bin/env ruby
INTEST = '5 10 20 50-60 70-73 75-79 80 95'.freeze
OUTTEST = '5 10 20 50 51 52 53 54 55 56 57 58 59 60 70 71 72 73 75 76 77 78 79 80 95'.freeze
def rangeconvert(r)
start, finish = r.scan(/\d+/)
raise "Invalid input" unless start < finish
(start..finish).to_a.join(' ')
end
View godaddy tracking.js
! function(a, b) {
var c = function(a) {
function b(a) {
return c() + "-" + d() + "-" + e() + "-" + f() + "-" + g(a)
}
function c() {
var a = new Date,
b = Math.round(a.getTime() / 1e3); //to seconds rounded
b = parseInt(b.toString().slice(1)), //remove leading precision .. todo: substring
View P3S_FW_LOG_AB.txt
[00012937][01 00] Firmware upgrade finished successfully.
[00013055]Done.
[00013086]Packet [C:\P3S_FW_V01.11.0020.bin] resumed, card sn [0x90ce7f72].
[00013128]Packet vlink 01.11.0020 <-> 01.11.0020.
[00013202]Version checking[2]...
[00013262][03 06][00] v2.1.6.18 -> v2.4.20.50 need upgrade.
[00013322][03 05][00] v34.2.0.9 -> v34.2.0.9
[00013369][04 00][00] v1.38.0.0 -> v1.48.0.0 need upgrade.
[00013463][11 00][00] v1.6.1.0 -> v1.8.0.0 need upgrade.
@technion
technion / Get-VM-using-Virtualdisk.ps1
Created Dec 17, 2018
Scan a virtualdisk for VMs that are using it
View Get-VM-using-Virtualdisk.ps1
# Please set these two variables
$scanpath = "C:\ClusterStorage\SilverTier1"
$clustername = "cls.cluster.mycluster.cluster.cls"
$vmlist = Get-ClusterGroup -Cluster $clustername | where {$_.GroupType -eq 'VirtualMachine' } | Get-VM -ErrorAction SilentlyContinue
write-host "Scanning cluster for storage for $($vmlist.count) VMs"
foreach ($vm in $vmlist) {
if ($vm.Path -like "$scanpath*") {
@technion
technion / Crypto Cheat Sheet.md
Last active Oct 21, 2018
Crypto cheat sheet
View Crypto Cheat Sheet.md

Weaknesses

ECB mode - unauthenticated Cut and paste blocks Chosen plaintext - use length controlled input for byte at a time decryption

CBC mode - unauthenticated Bitflipping attack to alter message CBC padding oracle decryption

View modeven.v
Require Import Coq.Arith.Arith.
Require Import Coq.Arith.EqNat.
(* Definition from : https://coq.inria.fr/library/Coq.Arith.Even.html *)
Inductive even : nat -> Prop :=
| even_O : even 0
| even_S : forall n, odd n -> even (S n)
with odd : nat -> Prop :=
odd_S : forall n, even n -> odd (S n).
@technion
technion / getzones.rb
Created Jun 6, 2018
Export all Route 53 zones
View getzones.rb
#!/usr/bin/env ruby
zones = `./cli53-linux-amd64 l --profile d53`.lines
zones.each do |zone|
domain = zone.split(/\s+/)[1]
`./cli53-linux-amd64 export #{domain} --profile d53 > #{domain}.zone`
puts domain
end
You can’t perform that action at this time.