This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check status of a list of websites in the file check_hosts.txt. Increase --max-time if sites are slow to respond | |
cat check_hosts.txt | while read host; do echo $host $(curl --ssl -Is "$host" -K HEAD --max-time 3 | head -1); done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Output to console | |
Get-AzSubscription | ForEach-Object {Set-AzContext -Subscription $_.Name *>$null; Get-AzPublicIpAddress} | Where-Object {$_.IpAddress -ne 'Not Assigned'} | Select-Object -Property Name,PublicIpAllocationMethod,ipAddress,ProvisioningState,Location,ResourceGroupName,Id | |
# Write to CSV | |
Get-AzSubscription | ForEach-Object {Set-AzContext -Subscription $_.Name *>$null; Get-AzPublicIpAddress} | Where-Object {$_.IpAddress -ne 'Not Assigned'} | Select-Object -Property Name,PublicIpAllocationMethod,ipAddress,ProvisioningState,Location,ResourceGroupName,Id | Export-Csv -Path .\pips.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import requests | |
import re | |
import gzip | |
import json | |
from bs4 import BeautifulSoup | |
from io import BytesIO | |
from datetime import datetime | |
# NVD feed URL. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Anti-malware resolver. | |
import re | |
from azure.common.credentials import ServicePrincipalCredentials | |
from azure.mgmt.compute import ComputeManagementClient | |
from azure.mgmt.subscription import SubscriptionClient | |
from azure.mgmt.advisor import AdvisorManagementClient | |
from azure.mgmt.security import SecurityCenter | |
import pprint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from azure.common.credentials import ServicePrincipalCredentials | |
from azure.mgmt.compute import ComputeManagementClient | |
from azure.mgmt.resource import ResourceManagementClient | |
from azure.mgmt.resource.resources.models import GenericResource | |
from azure.mgmt.subscription import SubscriptionClient | |
from msrestazure.azure_exceptions import CloudError | |
vm_list = [] | |
with open('vms.csv', 'r') as f: | |
for line in f.readlines(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SocketServer | |
HOST, PORT = "0.0.0.0", 514 | |
class SyslogUDPHandler(SocketServer.BaseRequestHandler): | |
def handle(self): | |
data = bytes.decode(self.request[0].strip()) | |
socket = self.request[1] | |
print(str(data)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from azure.common.credentials import ServicePrincipalCredentials | |
from azure.mgmt.subscription import SubscriptionClient | |
from azure.mgmt.resource import ResourceManagementClient | |
from azure.mgmt.network import NetworkManagementClient | |
import pprint, json | |
pp = pprint.PrettyPrinter(indent=4, depth=40) | |
# Configure the locations to look at | |
locations = ['eastus', 'australiaeast', ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# One liner. The input file should contain one entry per line. | |
# `grep -i -E '(OrgName|Country)'` can be removed to show all of the whois output or modified to select preferred items. | |
cat lookupips.txt | while read ip; do echo $ip; whois -H $ip | grep -i -E '(OrgName|Country)'; done | |
# Same but includes a ptr lookup - change 1.1.1.1 to whichever server you want to use or remove to use your local server. | |
cat lookupips.txt | while read ip; do echo $ip; nslookup $ip 1.1.1.1 | grep -o -E 'name = .*$'; whois -H $ip | grep -i -E '(OrgName|Country)'; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script first clears the CRL cache in the event a proxy CA, internal CA, scanning tool CA or AV CA gets trusted for | |
# something it shouldn't and your mac won't accept the genuine certificate. | |
# After clearing the CRL cache this script shreds the App Store caches - probably restart after and try downloading from the | |
# App Store again. | |
# If it doesn't fix your problem.... well good luck, may Google be by your side. | |
# Clear crl and oscp cache | |
sudo rm /var/db/crls/*.db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright 2020 Anthony Hawkes | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |