Update README.md

This commit is contained in:
skyper
2024-04-25 09:19:05 +01:00
committed by GitHub
parent 8e1120d6f5
commit fe13d06bb4
+5 -3
View File
@@ -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
```
---