aboutsummaryrefslogtreecommitdiffstats
path: root/Information gathering 2/Resources/crawl.bash
diff options
context:
space:
mode:
Diffstat (limited to 'Information gathering 2/Resources/crawl.bash')
-rwxr-xr-xInformation gathering 2/Resources/crawl.bash20
1 files changed, 20 insertions, 0 deletions
diff --git a/Information gathering 2/Resources/crawl.bash b/Information gathering 2/Resources/crawl.bash
new file mode 100755
index 0000000..13f729c
--- /dev/null
+++ b/Information gathering 2/Resources/crawl.bash
@@ -0,0 +1,20 @@
+#!/usr/bin/bash
+
+get_next_step() {
+ url="$1"
+ curl --follow --silent "$url" | grep '^<a href=' | grep --only-matching '"[^"]*"' | tr --delete \"
+}
+
+urls=(http://10.0.2.15/.hidden/)
+while ((${#urls[@]} > 0)); do
+ current="${urls[0]}"
+ urls=("${urls[@]:1}")
+
+ if [[ "${current[i]: -1}" == / ]]; then
+ mapfile -t next_steps < <(get_next_step "$current")
+ urls+=("${next_steps[@]/#/$current}")
+ else
+ echo -en "$current\t"
+ curl --silent "$current"
+ fi
+done