Skip to content

Instantly share code, notes, and snippets.

curl -u elastic:changeme http://`hostname`:9200/_cat
=^.^=
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/tasks
/_cat/indices
/_cat/indices/{index}
@raresteak
raresteak / gist:8d4c03fe9f11ae783cac62dc678879f8
Created March 8, 2018 14:14
bash one liner nslookup from list of ip addresses
for i in $(cat list.ips);do echo -n $i,;nslookup $i|grep name|awk {'print $4'}; done
@raresteak
raresteak / vm.ks
Created March 13, 2018 10:46
kickstart minimal
lang en_US
keyboard us
timezone America/Atlanta
#platform x86, AMD64, or Intel EM64T
reboot
url --url=http://169.254.1.1//
bootloader --location=mbr --append="rhgb quiet crashkernel=auto"
zerombr
clearpart --all --initlabel
autopart
@raresteak
raresteak / crontab.nmon
Last active March 13, 2018 13:58
starting nmon from cron
# Create daily nmon performance file
# http://nmon.sourceforge.net/pmwiki.php Nigel's
0 0 * * * cd /var/log/nmon && /your/path/to/nmon -ft -s 60 -c 1440
@raresteak
raresteak / keybase.md
Created March 31, 2018 17:01
Keybase proof raresteak

Keybase proof

I hereby claim:

  • I am raresteak on github.
  • I am raresteak (https://keybase.io/raresteak) on keybase.
  • I have a public key whose fingerprint is 81D2 1A1A A2F7 779A 462A 7BD3 89E1 606A 4696 9C36

To claim this, I am signing this object:

@raresteak
raresteak / rsync.notes
Created June 9, 2018 02:22
rsync notes
Copy one directory to another
rsync -avxHAX --progress <source> <destination>
When transfering sparse files special care is needed.
First time transferring sparse files use --sparse.
Next time, when the sparse files already exist on destination, don't use --sparse, instead us --inplace.
@raresteak
raresteak / Retrieve_Administrator_pw.ps1
Last active August 27, 2018 00:28
Get Laps Password
param($ComputerName)
# Requires Domain Administrator
Get-AdmPwdPassword -ComputerName $ComputerName | Format-List
@raresteak
raresteak / patch_policy.xml.sh
Created August 30, 2018 19:27
Patch recent Ghostscript ImageMagick bypass vulnerabilities in CERT 332928
#!/bin/bash
# Fix Ghostscript bypass vulnerabilities with ImageMagick CERT 332928
# Disable PS, EPS, PDF, and XPS coders in ImageMagick policy.xml
# https://www.kb.cert.org/vuls/id/332928
cd /etc/ImageMagick?? || exit
cp -v policy.xml policy.xml.tmp
cp -v policy.xml policy.xml.orig
sed -i 's/<\/policymap>//' policy.xml.tmp
cat <<EOF >> policy.xml.tmp
@raresteak
raresteak / enumerate_sudo_users
Last active March 15, 2019 16:52
Enumerate users with sudo access on a system
#!/bin/bash
###############################################################################
#Script Name : enumerate_sudo_users
#Description : Check which users on system can sudo with some form of
# privileged access.
#Author : Github raresteak
###############################################################################
[[ "$TRACE" ]] && set -x
[[ "$HEADER" ]] && echo "UserName,SystemName" # Useful for putting in a spreadsheet
#Linux
sed -i 's/1024x768/800x600/g' /etc/default/grub
update-grub
#
#win2016
powershell.exe -c Set-DisplayResolution -Width 800 -Height 600 -Force
#
#win10
#