Slides and code examples from my "Pythons Sinister Secrets" presentation.
The slide deck can be downloaded here.
https://github.com/MarkBaggett/MarkBaggett/blob/master/Python's%20Sinister%20Secrets%20SlideDeck.pdf
#!/bin/bash | |
# store the current dir | |
CUR_DIR=$(pwd) | |
# Let the person running the script know what's going on. | |
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
# Find all git repositories and update it to the master latest revision | |
for i in $(find . -name ".git" | cut -c 3-); do |
#!/usr/bin/env python3 | |
import ipaddress | |
import re | |
def mac2eui64(mac, prefix=None): | |
''' | |
Convert a MAC address to a EUI64 address | |
or, with prefix provided, a full IPv6 address | |
''' |
# Gawk version | |
# Remote | |
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}' | |
# Local | |
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}' | |
# No Gawk | |
# Local | |
grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){ |
Slides and code examples from my "Pythons Sinister Secrets" presentation.
The slide deck can be downloaded here.
https://github.com/MarkBaggett/MarkBaggett/blob/master/Python's%20Sinister%20Secrets%20SlideDeck.pdf
#include <Windows.h> | |
#include <ImageHlp.h> | |
#include <strsafe.h> | |
#include "loaded_psp_drivers.h" | |
#include <set> | |
#include <string> | |
#include <algorithm> | |
#pragma comment(lib, "crypt32.lib") |
# Based on gist https://gist.github.com/staaldraad/4c4c80800ce15b6bef1c1186eaa8da9f | |
# - added TCP states | |
awk 'BEGIN{states["01"]="TCP_ESTABLISHED" | |
states["02"]="TCP_SYN_SENT" | |
states["03"]="TCP_SYN_RECV" | |
states["04"]="TCP_FIN_WAIT1" | |
states["05"]="TCP_FIN_WAIT2" | |
states["06"]="TCP_TIME_WAIT" | |
states["07"]="TCP_CLOSE" |
set -eEu | |
set -o pipefail | |
trap 'echo "L$LINENO"; O70; exit -1' ERR | |
O54=4 | |
function O70() | |
{ | |
if [[ ! -z "${O57+x}" ]]; then | |
if [[ -f "${O57}" ]]; then | |
rm -f "${O57}" | |
fi |
Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)