Skip to content

Instantly share code, notes, and snippets.

View FlorianHeigl's full-sized avatar

Florian Heigl FlorianHeigl

View GitHub Profile
@FlorianHeigl
FlorianHeigl / cli_script
Last active April 6, 2022 22:56
avaya ers ssh config
# 1. dsa host key muss vorhanden sein, sonst startet server nicht
# 2. dsa auth kann man abschalten, ausser firmware ist extra alt. FW <=5.5 kann kein RSA FW >=5.6 kann RSA.
# 3. secure mode disabled alle anderen Protokolle - auch snmp!
# 4. pubkey download ist nur via tftp server (nicht usb)
# 5. RO user fuer backup funktioniert nicht wegen Problem mit `enable` ohne PW in oxidized
# 6. PW muss man manuell eingeben
# 7. telnet bleibt hier so erreichbar! (block via ipmgr)
no ssh
@FlorianHeigl
FlorianHeigl / alcatel-test.py
Last active April 4, 2022 19:26
textfsm-aos example alcatel
#!/usr/bin/env python3
from textfsm_aos.parser import parse
import re
sample_data = """
Local Chassis ID 1 (Master)
Model Name: OS6860E-24,
Module Type: 0x6062203,
Description: Chassis,
Part Number: 903708-90,
@FlorianHeigl
FlorianHeigl / elastiflow-tagging.py
Created March 2, 2022 03:41
tag elastiflow from ip list
#!/usr/bin/env python
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
from elasticsearch_dsl import query as q
from elasticsearch_dsl import Q
from elasticsearch_dsl.query import MultiMatch, Match
from elasticsearch_dsl import UpdateByQuery
import re, sys
@FlorianHeigl
FlorianHeigl / docker-compose.yml
Created February 24, 2022 23:54
check_mk via compose (clean config)
---
version: '3'
services:
checkmk:
image: checkmk/check-mk-raw:2.0.0-latest
ports:
- "162:162/udp"
- "514:514/udp"
- "514:514/tcp"
- "6557:6557/tcp"
# Powershell refuses to connect to the Netbox API on our setup without this.
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
@FlorianHeigl
FlorianHeigl / docker-compose.yml
Created February 11, 2022 01:39
check_mk compose file
---
version: '3'
services:
checkmk:
image: checkmk/check-mk-raw:2.0.0-latest
ports:
- "162:162/udp"
- "514:514/udp"
- "514:514/tcp"
- "6557:6557/tcp"
@FlorianHeigl
FlorianHeigl / gist:7940885367332d272b1139a88e369473
Last active February 7, 2022 18:43
find highest number of incoming and outgoing non-unicast packets
if ! type gawk >/dev/null ; then
echo "script requires gawk, please install it via apt/similar"
fi
cd ~/var/pnp4nagios/perfdata || exit 1
# out
for X in */Interface_*_outnucast.rrd; do
rrdtool fetch $X MAX -r 300 -s -1h | gawk -v x=$X '{printf(x",\t\t %s,%8.2f,%8.2f \n",strftime("%c",$1),$2,$3) }'
done |\
@FlorianHeigl
FlorianHeigl / ale-baseline-config.yml
Last active March 29, 2022 11:26
ale-baseline-config
---
# references
# [Switch Management Guide](https://www.al-enterprise.com/-/media/assets/internet/documents/os8-sw-87r3-rev-a.pdf)
# [Security Target for EAL2](https://www.fmv.se/globalassets/csec/alcatel-lucent-enterprise-omniswitch-with-aos-8.6.4.r11/alcatel-lucent-enterprise-omniswitch-with-aos-8.6.r11-security-target-for-eal2.pdf)
# [Security Best Practices in AOS](https://support.alcadis.nl/Support_files/Alcatel-Lucent/OmniSwitch//OS6450/Technotes/Security%20Best%20Practices%20in%20AOS%20v1.7.pdf)
# hier gesammelt in 8. AOS 8 example configuration (seite 68ff)
### ssh session limit
@FlorianHeigl
FlorianHeigl / unifi_sh_api.sh
Created January 23, 2022 23:34
patched unifi api
#!/bin/sh
#username=ubnt
#password=ubnt
#baseurl=https://unifi:8443
#site=default
#[ -f ./unifi_sh_env ] && . ./unifi_sh_env
cookie=$(mktemp)
@FlorianHeigl
FlorianHeigl / ipset_script.sh
Last active December 13, 2021 16:26
log4j / log4shell uebersicht (from mindforger, screenshots not incl)
setup_ipset() {
# this only needs to be run once
if ! type ipset 2>/dev/null ; then
ipset create log4j_attackers nethash
iptables -I INPUT -m set --match-set log4j_attackers src -j DROP
iptables -I OUTPUT -m set --match-set log4j_attackers dst -j DROP
}