Skip to content

Instantly share code, notes, and snippets.

View barryirwin's full-sized avatar

Barry Irwin barryirwin

View GitHub Profile
@barryirwin
barryirwin / testsample.php
Last active June 26, 2023 12:24
Demo script for generating email based off a Yara scan complete with two samples to trigger some basic rules
<?php
phpinfo();
php?>
@barryirwin
barryirwin / clamscan.sh
Last active June 26, 2023 14:41
A quick hack wrapper script to allow for clamscan to run with some error checkign and send a report to a specified email address ( uses ssmtp rather than mail for leaf node servers)
#!/bin/sh
# Script scans system using clamAV
# (c) 2023 bvi at moria.org
# v0.1.1 - typo cleanup
#check required files are present
if [ ! -f /usr/bin/clamscan ]; then
echo ERROR
echo clamscan binary not found: /usr/bin/clamscan
@barryirwin
barryirwin / gist:065349633ddf1baf27fd6ed697b16170
Created February 22, 2023 16:34
Grab ATTACK items from MITRE CVE's
curl -s https://attack.mitre.org/campaigns/C0014/ | grep -oE 'T[0-9]{4}(\/[0-9]{3})?>' | sed 's/">//g' | sort | uniq
@barryirwin
barryirwin / gist:cd1d6dac09763146f62f04d13c7198f4
Created January 16, 2023 21:19
TXT mode table for NUC WAR Tut - APT
+----+------+----------------------------------------------------------------------------------------------+----------------+-----+----+
| NO | Year | Attack Description | APT Group Name | Yes | No |
+----+------+----------------------------------------------------------------------------------------------+----------------+-----+----+
| 1 | 2001 | Anna Kurnikova virus. Massive infections after opening the attachment | | | |
+----+------+----------------------------------------------------------------------------------------------+----------------+-----+----+
| 2 | 2003 | SQL Slammer massive infections including DDoS attack effect against many servers | | | |
+----+------+----------------------------------------------------------------------------------------------+----------------+-----+----+
| 3 | 2008 | Chanology Attack on Scientology website by Anonymou
@barryirwin
barryirwin / gist:5b0121f30db93eff4c4769a5299f75e0
Last active January 13, 2023 10:19
Packet structures fotr IPv4 / TCP/ UDP and ICMP for use in LaTeX documents. These depend on the bytefield package
%% These require the use of the bytefield package
Snippets are suitabel for inclusion in tha figure environment
%%IPv4 after Postel 1981 & Stevens 1993
\centering
\begin{bytefield}{32}
\bitheader{0,3,4,7,8,15,16,23,24,31} \\
\bitbox{4}{\tiny{Version}} & \bitbox{4}{\tiny{Header length}} & \bitbox{8}{TOS} & \bitbox{16}{Total Length} \\
\bitbox{16}{Identification} &\bitbox{1}{\tiny 0} &\bitbox{1}{\tiny D\\F}
&\bitbox{1}{\tiny M\\F} & \bitbox{13}{Fragment Offset} \\
@barryirwin
barryirwin / gist:167e4269811f0fd002d885280aa6fc33
Created August 25, 2022 08:53
Converting from number of IP addresses to a /notation using awk
# easy case where /24 is the smallext allocation $1 is the number
$ echo 8192 | awk '{print 32-log($1)/log(2)}'
13
$ echo 32 | awk '{print 32-log($1)/log(2)}'
5
# this can be used to convert 1.2.4.0 8192 to 1.2.3.0/19
$ echo 1.2.4.0 8192 | awk '{print $"/"32-log($2)/log(2)}'
1.2.3.0/19
@barryirwin
barryirwin / visual_cryptography_py3.py
Created February 5, 2022 22:16 — forked from deibit/visual_cryptography_py3.py
Visual Cryptography (Python3)
# Copyright, Robert Donovan, LessonStudio, 2014
# If you use this then tweet what you did with it @LessonStudio.
# This file takes one argument which is a file that you would like to split into two encrypted images.
# The original image can only be viewed by overlaying the two encrypted images.
# If printed on clear plastic, It can be very finicky to align the two images if the pixel count is too high.
# For best results keep the original image below 200x200 pixels and print as large as possible onto clear plastic to
# obtain the best results.
# You can go to higher resolutions but you then really have to be precise when aligning the two images.
@barryirwin
barryirwin / gist:6418dce585f775e46afe3739ae892801
Created July 29, 2021 12:17
Restyling of \href in LateX
% requires fontawesome package for icon
%save old command
\let\orighref\href
%redefine the command without circular references
\renewcommand{\href}[2]{\orighref{#1}{{\small\faLink{}} #2}}
% generate a clickabel link with a link icon next to it.
\href{https://google.com}{moo}
@barryirwin
barryirwin / gist:05dd3fe890fafb38fc3afe4934d25e7d
Created September 19, 2020 16:52
Dump Wifi passwords n Windows 10
netsh wlan show profile name=WifiConnectionName key=clear
@barryirwin
barryirwin / gist:d6d0adc1a95def747c76ae0afb809c9d
Created March 19, 2019 12:37
Font sizes in tables LATEX
There's no \medium font size between \small and \large; you have \normalsize (which is the default font size).
The standard font size switches are:
\tiny, \scriptsize, \footnotesize, \small, \normalsize, \large, \Large, \LARGE, \huge, and \Huge.
You only need one font switch command inside the table and braces are not required since table forms a group, so you can simply say something like this:
\begin{table}
\small
\begin{tabular}{p{3.5cm}p{8cm}p{5cm}}