Skip to content

Instantly share code, notes, and snippets.

@pcurylo
pcurylo / ssh-check-keys.sh
Created January 3, 2017 04:27
Check SSH key lengths
#!/bin/bash
files=$@
for keyfile in $files; do ssh-keygen -l -f "${keyfile}"; done | uniq
@pcurylo
pcurylo / kali_dhcpd
Created January 2, 2017 00:42
Add DHCPD to Kali
#!/usr/bin/env view
command prefixes: $ normal user; # sudo
file contents between ............
check if dhcpd installed
$ apt --list|grep isc-dhcp-server
if not, install it
# apt-get install isc-dhcp-server -y
PowerShell - already on Win7+
-create profile folder ~/Documents/WindowsPowershell/
-create modules folder ~/Documents/WindowsPowershell/Modules
-Keep this handy: http://technet.microsoft.com/en-us/library/ee692764.aspx
-recommend
installing Chocolatey: http://chocolatey.org/ (you'll need something like CPAN for Perl to keep track of PS stuff and other things)
to install:
cmd.exe> @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin - See more at: http://chocolatey.org/#sthash.5KjLIpD5.dpuf
IMPORTANT NOTE: You can install apps through Chocolatey as .Install or not (.Install shows up in Windows Add/Remove Pgm; the other is "portable")
See the following for more info:
@pcurylo
pcurylo / vlans_in_*nix
Last active December 17, 2016 01:45
Ways to setup VLANs in *nix/BSDs
Ways to setup VLANs in Linux
Typical for Ubuntu
##use vconfig and ifconfig or ip
lsmod // modprobe 8021q
apt-get install vconfig -y
vconfig add <if> <vlanid>
ifconfig <if>.<vlanid> <ipaddr> netmask <mask>
or ip addr add <ipaddr>/<bitmask> dev <if>.<vlanid>
@pcurylo
pcurylo / kali_rpi_tplink_wlan0
Last active December 17, 2016 01:39
Getting TP Link TL-WN725N up on RPI running Kali
@pcurylo
pcurylo / lxde_shortcuts
Last active December 17, 2016 01:36
LXDE Shortcuts
Default LXDE/Openbox bindings
ACTION BINDING
Go to desktop (direction) ctrl + alt + arrow
Go to desktop (number) super + f1/f2/f3/f4
Send to desktop shift + alt + arrow
Toggle show desktop super + d
Close window alt + f4
Hide window alt + esc
Window menu alt + space
@pcurylo
pcurylo / new_kali_setup.sh
Last active December 11, 2016 06:14
new_kali_setup.sh
#!/bin/bash
# This script assumes the following as taken place
# - Create a secure root password 10+chars and LVM passphrase 20+chars
# - Obtain iso (2016.2) from source: kali.org
# - dd to usb drive
# - boot into graphical install
# - accept all defaults unless noted below
# Encrypted LVM - all files in one partition
@pcurylo
pcurylo / empty_trash.service
Last active December 11, 2016 04:49
empty_trash.service
[Unit]
Description=Empty trash
Requries=local-fs.target
Before=shutdown.target reboot.target halt.target
[Service]
ExecStart=/bin/true
ExecStop=/usr/local/bin/secure_trash
Type=oneshot
RemainAfterExit=true
@pcurylo
pcurylo / secure_trash
Last active December 11, 2016 04:37
secure_trash
#!/bin/bash
# Requires scrub
# place in /usr/local/bin
# CREDITS
# from testingresults URL: https://forums.kali.org/showthread.php?485-How-To-Securely-Sanitize-your-Trash
#
find ~/.local/share/Trash/files ~/.local/share/Trash/info -type f -print0 | xargs -0 -I{} /usr/bin/scrub -Sfp random {}
@pcurylo
pcurylo / bash_aliases
Last active December 11, 2016 03:45
.bash_aliases
# ~/.bash_aliases file source by ~/.bashrc
# https://gist.github.com/pcurylo/91a5664301695fdade07ab54b74fe56e
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias 'ls=ls --color=auto'
alias 'dir=dir --color=auto'
alias 'vdir=vdir --color=auto'
alias 'grep=grep --color=auto'
alias 'igrep=igrep --color=auto'