This file contains 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
# Task Scheduler | |
# General | |
# Use local service-user of SYSTEM | |
# Enable 'Run whether user is logged in or not' | |
# Enable 'Do not store password' | |
# Enable 'Run with highest privileges' | |
# | |
# Action | |
# Program: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe | |
# Arguments: -File C:\scripts\GracefulReboot.ps1 |
This file contains 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
# Task Scheduler | |
# General | |
# Select user SYSTEM (admin user will not work correctly) | |
# Enable 'Run with highest privileges' | |
# | |
# Action | |
# Program: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe | |
# Arguments: -File C:\scripts\RemoveUserFWRules.ps1 | |
# NOTE: to get the rule-names you need to execute 'Get-NetFirewallRule' as SYSTEM-USER - some rules have other display-names in that context.. |
This file contains 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
# Task Scheduler | |
# General | |
# Use local service-user of SYSTEM | |
# Enable 'Run whether user is logged in or not' | |
# Enable 'Do not store password' | |
# Enable 'Run with highest privileges' | |
# | |
# Action | |
# Program: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe | |
# Arguments: -File C:\scripts\rds\RemoveTmpProfiles.ps1 |
This file contains 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
#!/bin/bash | |
if [ -z "$1" ] | |
then | |
echo 'Provide the target hostname!' | |
exit 1 | |
fi | |
TARGET="$1" |
This file contains 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
#!/bin/bash | |
if [ -z "$1" ] | |
then | |
echo 'Provide a hostname of a website to check!' | |
exit 1 | |
fi | |
if [ -z "$2" ] | |
then |
This file contains 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
#!/usr/bin/env python3 | |
from sys import argv as sys_argv | |
from socket import socket, AF_INET, AF_INET6, SOCK_STREAM | |
if len(sys_argv) < 3: | |
raise ValueError(""" | |
You need to provide two arguments: | |
1 > Target IP | |
2 > Target port (only TCP) |
This file contains 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 can be useful in CI environments if you need to process config or secrets and pipe them to the parent process in a secure manner | |
# example file: secrets.yml | |
> my_secret1: !vault | | |
> $ANSIBLE_VAULT;1.1;AES256 | |
> ... | |
> service_xyz: !vault | | |
> $ANSIBLE_VAULT;1.1;AES256 | |
> ... |
This file contains 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
#!/usr/bin/env python3 | |
# this can be useful in CI environments if you need to process config or secrets and pipe them to the parent process in a secure manner | |
import io | |
import os | |
from time import sleep | |
w = io.open(69, 'wb', 0) | |
w.write(b'MY SECRE3T') |
This file contains 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 csv import DictWriter | |
import xml.etree.ElementTree as ET | |
# reads unencrypted OPNSense backup file and extracts its rules in CSV format | |
FILE_IN = 'firewall.xml' | |
FILE_OUT = 'firewall.csv' | |
FIELDS = [ | |
'uuid', 'type', 'interface', 'ipprotocol', 'statetype', 'descr', 'direction', 'floating', 'log', 'quick', | |
'protocol', 'source', 'destination', 'category', 'disabled', 'gateway', 'icmptype', 'associated-rule-id', |
This file contains 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
# NOTES: | |
# you need to install chocolatey first: https://community.chocolatey.org/install.ps1 | |
# source for ChocolateyInstallPackage: https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/helpers/functions/Install-ChocolateyInstallPackage.ps1 | |
# source for helper functions: https://github.com/chocolatey/choco/tree/master/src/chocolatey.resources/helpers/functions | |
# this script need to be copied to your client; it may not work if executed through a network share | |
# you also need to copy those helper-function (see HELPERS_INCLUDE below) to your clients (see HELPERS_PATH below) | |
$LOGFILE = 'C:\gpo\logs\choco.log' | |
$SCRIPT_PATH = 'C:\gpo\scripts\choco' | |
$HELPERS_PATH = "$SCRIPT_PATH\helpers" |
NewerOlder