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 | |
# Author: Gustavo Lichti | |
# Email: [email protected] | |
# Usage: ./scan_hosts.sh --hosts <hosts_file> --host xpto.xxx --host xpto2.xxx --threads <number_of_threads> --output <output_directory> | |
SCRIPT_STARTED=$(date +"%Y%m%d_%H%M") | |
# Function do add log Line |
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
### | |
# Explain | |
# RG Number -> AB.CDE.FGH-V | |
# X=(Hx9)+(Gx8)+(Fx7)+(Ex6)+(Dx5)+(Cx4)+(Bx3)+(Ax2)+(100xV) | |
# Y= X%11 | |
# If Y (rest of division) is 0 the RG is Valid | |
### | |
# Function to validate Brazilian "RG" | |
def isValidRG(number,dv): |
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/sh | |
# save dog.sh in /root/dog.sh. | |
# You can use winscp with scp protocol to do this. | |
# Using ssh set executation permission and replace the crontab: | |
# chmod +x /root/dog.sh | |
# echo "* * * * * /root/dog.sh" | crontab - | |
# fix wpad / wpad-mini / hostapd stop working bug | |
logread -l 100 | grep -n "IEEE 802.11: did not acknowledge authentication response" |
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
# Using yubikey to unlock LUKS partitions | |
# My SDB3 is a partitions with luks, with lvm and ma root fs (/) | |
# My SDA1 ia my data partition with luks mounted at /data | |
# I will use yubikey as 2FA to unlock the SDB3 and the SDA1 will be unlocked by a key file | |
## On SDB3 | |
# Configure the slot two of yubikey to challenge mode |
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
# Script to configure yubikey as a 2FA in linux login | |
# Distro Ubuntu 18.04 | |
# Install pam module | |
sudo apt install libpam-u2f | |
# Register device for user | |
pamu2fcfg -u<user> | sudo tee -a /etc/u2f_mappings | |
# Cofigure yubike as required to login |
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 | |
# This process do lock all sessions when a yubikey is removed from device | |
# Script to block all open sessions | |
cat <<-'EOF' | sudo tee /usr/local/bin/gnome_lock_all_sessions | |
#!/bin/sh | |
for bus in /run/user/*/bus; do | |
echo "bus: ${bus}" | |
uid=$(basename $(dirname $bus)) |
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
function lichti-swap-usage { | |
echo "Mem status"; | |
echo "========================================"; | |
free -m | |
echo "========================================"; | |
SORT="kb"; # {pid|kB|name} as first parameter, [default: kb] | |
[ "$1" != "" ] && { SORT="$1"; } | |
[ ! -x `which mktemp` ] && { echo "ERROR: mktemp is not available!"; exit; } | |
MKTEMP=`which mktemp`; |
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
git clone xxxx | |
cd xxxx | |
virtualenv .venv | |
source .venv/bin/activate | |
pip install bandit | |
bandit -r ./src -f html -o output.html -x /tests -v -ll -lll |
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
[all] | |
https://github.com/mre/awesome-static-analysis | |
https://www.owasp.org/index.php/Source_Code_Analysis_Tools | |
https://samate.nist.gov/index.php/Source_Code_Security_Analyzers.html | |
[Python] | |
https://bandit.readthedocs.io/en/latest/ | |
https://github.com/PyCQA/bandit | |
https://github.com/python-security/pyt |
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
https://github.com/uber/grafana-dash-gen | |
https://github.com/weaveworks/grafanalib |
NewerOlder