mirror of
https://github.com/hackerschoice/thc-tips-tricks-hacks-cheat-sheet.git
synced 2026-05-19 22:54:43 +02:00
Update README.md
This commit is contained in:
@@ -1692,18 +1692,20 @@ grep -HEronasi '.{16}password.{,64}' .
|
||||
grep -r -F -- " PRIVATE KEY-----" .
|
||||
```
|
||||
|
||||
Find Subdomains in files:
|
||||
Find Subdomains or emails in files:
|
||||
```bash
|
||||
find_subdomains() {
|
||||
local d="${1}"
|
||||
local rexf='[0-9a-z.-]{0,64}'"${d}"
|
||||
local rex="$rexf"'([^a-z0-9]{1}|$)'
|
||||
local rexf='[0-9a-zA-Z_.-]{0,64}'"${d}"
|
||||
local rex="$rexf"'([^0-9a-zA-Z_]{1}|$)'
|
||||
[ $# -le 0 ] && { echo -en >&2 "Extract sub-domains from all files (or stdin)\nUsage : find_subdomains <apex-domain> <file>\nExample: find_subdomain \.com | anew"; return; }
|
||||
shift 1
|
||||
[ $# -le 0 ] && [ -t 0 ] && set -- .
|
||||
command -v rg >/dev/null && { rg -oaIN --no-heading "$rex" "$@" | grep -Eo "$rexf"; return; }
|
||||
grep -Eaohr "$rex" "$@" | grep -Eo "$rexf"
|
||||
}
|
||||
# find_subdomain foobar.com
|
||||
# find_subdomain @gmail.com
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user