Skip to content

Instantly share code, notes, and snippets.

import pyshark
import json
from collections import defaultdict
def process_pcap(pcap_file, target_uri, ssl_keylog_file=None):
# Set up capture with TLS decryption if keylog file is provided
display_filter = f'http.request.uri contains "{target_uri}" or http.response'
if ssl_keylog_file:
cap = pyshark.FileCapture(pcap_file,
display_filter=display_filter,
@lrhazi
lrhazi / t.sh
Last active March 27, 2024 15:50
[object Object]
devices = $(
"ADC-ISAZ-DEV-AWAF-1A.inw.cigna.com",
"ADC-ISAZ-DEV-AWAF-1B.inw.cigna.com",
"ADC-ISAZ-DEV-LTM-1A.inw.cigna.com",
"ADC-ISAZ-DEV-LTM-1B.inw.cigna.com",
"WDC-ISAZ-DMZ-DEV-LTM-1A.inw.cigna.com",
"WDC-ISAZ-DMZ-DEV-LTM-1B.inw.cigna.com",
"ADC-ISAZ-DMZ-LTM-1A.inw.cigna.com",
"ADC-ISAZ-DMZ-LTM-1B.inw.cigna.com",
"ADC-ISAZ-DMZ-LTM-2A.inw.cigna.com",
import os
import time
from playwright.sync_api import sync_playwright, expect
import logging
URL = "https://admin.google.com/"
URL_USERS = "https://admin.google.com/ac/users"
USERNAME = input("Enter Google Admin username: ")
PASSWORD = input("Enter the password: ")
DELETION_DATE = input("""Enter the deletion date (e.g. "Fri, Mar 22, 2024"): """)
import os
import time
from playwright.sync_api import sync_playwright, expect
from logger import logger
from utils import get_db_version_from_filename
URL = "https://my.f5.com/manage/s/downloads"
when HTTP_REQUEST {
if {[HTTP::has_responded]}{return}
set collect_length 2048
if {([HTTP::uri] eq "/login") && ([HTTP::method] eq "POST")} {
# check content length
if {[HTTP::header "Content-Length"] ne "" && [HTTP::header "Content-Length"] <= $collect_length }{
set content_length [HTTP::header "Content-Length"]
} else {
set content_length $collect_length
}
@lrhazi
lrhazi / prep-contacts.py
Last active August 14, 2022 12:36
Fix Contact Groups IDs
import csv,sys
# contact groups export from source account (CSV)
fn1=sys.argv[1]
# contact groups export from target account (CSV)
fn2=sys.argv[2]
# Exported contacts from source account
contacts_csv_fn=sys.argv[3]
# Exported contacts from source account (Corrected)
contacts_csv_fn2=sys.argv[4]
@lrhazi
lrhazi / copy-contacts.sh
Last active August 14, 2022 12:36
Copy Google Workspace Contacts from one account to another
#!/bin/bash
shopt -s expand_aliases
alias gam='/root/bin/gamadv-xtd3/gam'
if [[ $# -ne 2 ]]; then
echo "Usage: $0 [email protected] [email protected]" >&2
exit 2
fi
USER_SRC=$1
@lrhazi
lrhazi / basic.irule.tcl
Last active September 24, 2020 23:10
sample irule
when HTTP_REQUEST {
set uriLowered [string tolower [HTTP::uri]]
if { $uriLowered starts_with "/home" } {
pool home_pool
} else {
pool default_pool
}
}
FROM stackbrew/ubuntu:saucy
RUN apt-get update
RUN apt-get install -y --force-yes \
software-properties-common \
pciutils \
debconf-utils
RUN add-apt-repository -y ppa:saltstack/salt
RUN apt-get update