Skip to content

Instantly share code, notes, and snippets.

@itsecworks
itsecworks / find_reverse_duplicates.py
Created October 9, 2023 09:27
Palo Alto Panorama - Object Auditing scripts
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author: Ist wurst...
#
# Description:
# -------------
# This script finds the reverse duplicates like:
# /-h_9.9.9.9
#IP:9.9.9.9\32 =
@itsecworks
itsecworks / paloalto_check_counter_ifs.py
Last active October 5, 2023 07:44
Palo Alto Monitoring scripts
import argparse
import requests
import xml.etree.ElementTree as ET
import logging
import sys
import json
import datetime
import re
import socket
@itsecworks
itsecworks / conf_viz10.py
Created September 29, 2023 11:41
graphviz palo alto config vizualisation
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author: Ist wurst...
import pdb
import sys
import xml.etree.ElementTree as ET
import json
from graphviz import Digraph
import xml.etree.ElementTree as ET
# Load d3blocks
from d3blocks import D3Blocks
import pandas as pd
filename = 'C:\\temp\\running-config.xml'
tree = ET.parse(filename)
root = tree.getroot()
@itsecworks
itsecworks / split_tunnel_route_updater.py
Created July 25, 2023 22:08
GP Gateway Split tunnel exclude routes updater
import os
import pdb
import requests
import json
# key gen link
# https://192.168.150.200/api/?type=keygen&user=admin&password=yourpassword
# Step 1.: Set your variables and file: Panorama IP, Globalprotect gateway name, GP agent config in GP Gateway, template name and vsys name
# Office 365 EDL from Palo Alto
@itsecworks
itsecworks / conf_viz20.py
Last active October 29, 2023 21:45
panorama configuration graphing - beta
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author: Ist wurst...
import sys
import xml.etree.ElementTree as ET
from graphviz import Digraph
def getname(element):
@itsecworks
itsecworks / paloalto_systemlogs.conf
Created July 6, 2023 12:52
logstash palo alto system event enrichment
input {
file {
path => "/tmp/*_system_log.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
@itsecworks
itsecworks / netmon_cpu_mem.ps1
Created July 5, 2023 11:44
VPN Client Monitoring - Collector Scripts
##############################################################################################################################################################
# #
# This Script collects measurements from netstat command #
# Syntax for output lines is json that devided by newline #
# Example: #
# {"name":"In_Receives","currentuser":"akdaniel","gpgatewayaddress":"130.41.235.50","currentdomain":"PALOALTONETWORK","value":"1636236", #
# "timestamp":"2023-06-09 02:19:52","subtype":"ipstats","gpipv4address
# Import libraries
import requests
from bs4 import BeautifulSoup
import pandas as pd
import time
from datetime import date
def datacollector(releases, release, release_new, iss_type, release_placeholder):
# Create an URL object