Skip to content

Instantly share code, notes, and snippets.

View sebrem's full-sized avatar

Sebastian Bremicker sebrem

View GitHub Profile
@byt3bl33d3r
byt3bl33d3r / log4j_rce_check.py
Created December 10, 2021 06:02
Python script to detect if an HTTP server is potentially vulnerable to the log4j 0day RCE (https://www.lunasec.io/docs/blog/log4j-zero-day/)
#! /usr/bin/env python3
'''
Needs Requests (pip3 install requests)
Author: Marcello Salvati, Twitter: @byt3bl33d3r
License: DWTFUWANTWTL (Do What Ever the Fuck You Want With This License)
This should allow you to detect if something is potentially exploitable to the log4j 0day dropped on December 9th 2021.
@nikallass
nikallass / check-smb-v3.11.sh
Created March 11, 2020 04:57
CVE-2020-0796. Scan HOST/CIDR with nmap script smb-protocols.nse and grep SMB version 3.11.
#!/bin/bash
if [ $# -eq 0 ]
then
echo $'Usage:\n\tcheck-smb-v3.11.sh TARGET_IP_or_CIDR'
exit 1
fi
echo "Checking if there's SMB v3.11 in" $1 "..."
nmap -p445 --script smb-protocols -Pn -n $1 | grep -P '\d+\.\d+\.\d+\.\d+|^\|.\s+3.11' | tr '\n' ' ' | replace 'Nmap scan report for' '@' | tr "@" "\n" | grep 3.11 | tr '|' ' ' | tr '_' ' ' | grep -oP '\d+\.\d+\.\d+\.\d+'
@awesome
awesome / jq-json-to-associative-array-command-line-example.txt
Created August 22, 2018 20:10
jq parse JSON to bash4 associative array! "jq is like sed for JSON data" https://stedolan.github.io/jq/
admin@ip-172-31-90-86:~$ json=$(
cat <<- EOF
{
"foo": "baru-1",
"su": "baru-2",
"dive": "baru-3"
}
EOF
)
admin@ip-172-31-90-86:~$ echo $json
@itsprdp
itsprdp / disable_jenkins.groovy
Last active October 31, 2022 08:48
Groovy script to disable all jenkins jobs in a view
jenkins = Hudson.instance
jenkins.instance.getView("PS_Portal").items.each { job ->
println "\nJob: $job.name"
job.disabled = true
}
@kekru
kekru / 1-Enable Docker Remote API with TLS client verification.md
Last active June 14, 2024 09:01
Docker Remote API with client verification via daemon.json

Enable Docker Remote API with TLS client verification

Docker's Remote API can be secured via TLS and client certificate verification.
First of all you need a few certificates and keys:

  • CA certificate
  • Server certificate
  • Server key
  • Client certificate
  • Client key

Create certificate files

#!/bin/bash
set -x
DATE=`date +%Y%m%d_%H%M%S`
OUTPUT_DIR=${DATE}
mkdir ${OUTPUT_DIR}
ROOT_PATH="/Users/gbougeard/REGISTRY/data"
@AntonTyutin
AntonTyutin / postfix-mailcatcher-config.txt
Last active January 21, 2022 14:56
Postfix mailcatcher configuration
# ====================== /etc/postfix/main.cf =========================
# ...
catcher_destination_recipient_limit = 1
virtual_mailbox_domains = reply.domain.com
virtual_transport = catcher
virtual_mailbox_maps =
virtual_alias_maps =
recipient_delimiter = +
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active September 19, 2024 03:12
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@jalogisch
jalogisch / Netflix - Unitymedia | Customer Hell!
Last active May 15, 2016 09:45
I have since last Monday(2016-02-22) - first day i notice - problems getting Netflix Content into my home. - Lost in a Customer Hell between Netflix and Unitymedia
2016-02-22
During the Day (2016-01-22) i notice that Netflix is not working on my TV. I tried other Devices but always getting an Error pointing me to http://netflix.com/proxy.
I called netflix (Germany) and over 30 min the agent followed his script what need to be done (reboot the modem, change devices and use mobile data) to show me that netflix does not have a problem and i should call my ISP.
Short after that, i called my ISP. The Agent told me that this morning they got notified by the tech department that unitymedia tech is working with netflix tech on this issue.
If i use another connection - a VPN to my Server, mobile data - connection is possible. Netflix relax and say "look your ISP has an issue"
Detailed Information are written down as note to my Account.
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE