Extracts the package table of contents as an XML file
xar --dump-toc={header.xml} -f {file.pkg}
Clean up the TOC to just the RSA signature information
/usr/bin/xmllint --xpath '//signature[@style="RSA"]' {header.xml} > {rsa.raw}
| import json | |
| import uuid | |
| import argparse | |
| import os | |
| from stix2 import Indicator, Bundle, AttackPattern, MarkingDefinition | |
| # Author: @andythevariable | |
| # Usage: | |
| # python -m venv ecs-to-stix |
| # Shell script to update Elastic Agents that are stuck in an "Updating" state in Fleet. | |
| # Example : | |
| # KIBANA_URL="https://my-kibana-host:5601" | |
| # PASSWORD="secret-password" | |
| # ./update-agents.sh | |
| KIBANA_URL="https://kibana-url:port" | |
| PASSWORD="elastic-user-password" | |
| AGENT_IDS=` |
| #!/bin/bash | |
| #set -eux | |
| # Create Profile Directories | |
| mkdir ~/{bin,code,dev} | |
| # Installing Homebrew if necessary | |
| if system_profiler SPApplicationsDataType | grep brew >/dev/null 2>&1; then echo "Homebrew already installed. Moving on."; else /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"; fi | |
| # Install CLI Tools |
| # Bash script to download Malware Bazaar based on tag | |
| # Define tag and number of samples to download | |
| TAG=insert-malware-bazaar-tag | |
| DOWNLOAD_LIMIT=100 | |
| # Determin OS | |
| OS=$(uname -s) | |
| # Download hash values from tag, save the SHA256 hashes |
| cat input.ndjson | jq -s . |
| cat file.json | jq -c '.[]' > output.ndjson |
| # python3 csv-to-ndjson.py | |
| # pip3 install csv json | |
| import csv | |
| import json | |
| csvfile = open('in.csv', 'r') | |
| jsonfile = open('out.ndjson', 'w') | |
| fieldnames = ("field1","field2","field3") |
| #!/bin/bash -eux | |
| # Single script to install the Elastic Agent on macOS | |
| # Downloads the Elastic Agent and saves it to your computer in the current directory (example in Downloads, Desktop, etc.) | |
| curl -OL https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.2.0-darwin-x86_64.tar.gz | |
| # Uses the Tar command to decompress the Elastic Agent and prepare it for installation | |
| tar zxf elastic-agent-8.2.0-darwin-x86_64.tar.gz | |
| # Enters the Elastic Agent directory that was decompressed in the previous step |
| # https://www.virtualgyanis.com/post/step-by-step-how-to-install-and-configure-domain-controller-on-windows-server-2019 | |
| Import-Module ADDSDeployment | |
| Install-ADDSForest ` | |
| -CreateDnsDelegation:$false ` | |
| -DatabasePath "C:\Windows\NTDS" ` | |
| -DomainMode "WinThreshold" ` | |
| -DomainName "huntops.blue" ` | |
| -DomainNetbiosName "HUNTOPS" ` | |
| -ForestMode "WinThreshold" ` | |
| -InstallDns:$true ` |