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
-- Find ssh sessions that are hiding from 'w'/'who' | |
SELECT * FROM ( | |
SELECT p.pid,p.name,p.cmdline,GROUP_CONCAT(DISTINCT pof.path) AS open_files | |
FROM processes p | |
LEFT JOIN process_open_files pof ON p.pid = pof.pid | |
WHERE p.name = "sshd" | |
GROUP BY p.pid | |
) | |
WHERE cmdline LIKE "%@notty%" | |
OR |
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 script can ruin your day, if you run it without fully understanding what it does, you don't know what you are doing, | |
:: | |
:: OR BOTH!!! | |
:: | |
:: YOU HAVE BEEN WARNED!!!!!!!!!! | |
:: | |
:: This script is provided "AS IS" with no warranties, and confers no rights. | |
:: Feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section, |
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
:: Windows 10 Hardening Script | |
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering. | |
:: Obligatory 'views are my own'. :) | |
:: Thank you @jaredhaight for the Win Firewall config recommendations! | |
:: Thank you @ricardojba for the DLL Safe Order Search reg key! | |
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings! | |
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater | |
: |
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 -eux | |
yesterday=$(date -d yesterday +%s) | |
# dnsdock should not be stopped : we limit to the containers created after it | |
docker ps --filter since=dnsdock -q --format "{{.ID}} {{.CreatedAt}}" | while read line | |
do | |
# line looks like: | |
# 123456789abcdef 2017-01-01 00:00:00 +02:00 CEST | |
set $line | |
id=$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
#!/usr/bin/python | |
# Quick and dirty script to kill containers older than some number of minutes | |
# Kills all containers older than 60 minutes by default! | |
import sys | |
import subprocess | |
from sets import Set | |
CMD_DOCKER_CONTAINERS_WITH_AGE = 'docker ps -a --format "{{.ID}} {{.Status}}"' |