Skip to content

Commit ce6b19d

Browse files
committed
Added colored output and a header message.
1 parent e6246d3 commit ce6b19d

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

Extractor/extractor.sh

+22-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
11
#!/bin/bash
22
#$1 : Folder containing .git directory to scan
33
#$2 : Folder to put files to
4+
function init_header() {
5+
cat <<EOF
6+
###########
7+
# Extractor is part of https://github.com/internetwache/GitTools
8+
#
9+
# Developed and maintained by @gehaxelt from @internetwache
10+
#
11+
# Use at your own risk. Usage might be illegal in certain circumstances.
12+
# Only for educational purposes!
13+
###########
14+
EOF
15+
}
16+
17+
init_header
418

519
if [ $# -ne 2 ]; then
6-
echo "USAGE: extractor.sh GIT-DIR DEST-DIR";
20+
echo -e "\e[33m[*] USAGE: extractor.sh GIT-DIR DEST-DIR\e[0m";
721
exit 1;
822
fi
923

1024
if [ ! -d "$1/.git" ]; then
11-
echo "There's no .git folder";
25+
echo -e "\e[31m[-] There's no .git folder\e[0m";
1226
exit 1;
1327
fi
1428

1529
if [ ! -d "$2" ]; then
16-
echo "Destination folder does not exist";
17-
echo "Creating..."
30+
echo -e "\e[33m[*] Destination folder does not exist\e[0m";
31+
echo -e "\e[32m[*] Creating...\e[0m"
1832
mkdir "$2"
1933
fi
2034

@@ -37,10 +51,10 @@ function traverse_tree() {
3751
fi
3852

3953
if [ "$type" = "blob" ]; then
40-
echo "Found file: $path/$name"
54+
echo -e "\e[32m[+] Found file: $path/$name\e[0m"
4155
git cat-file -p $hash > "$path/$name"
4256
else
43-
echo "Found folder: $path/$name"
57+
echo -e "\e[32m[+] Found folder: $path/$name\e[0m"
4458
mkdir -p "$path/$name";
4559
#Recursively traverse sub trees
4660
traverse_tree $hash "$path/$name";
@@ -55,7 +69,7 @@ function traverse_commit() {
5569
local count=$3
5670

5771
#Create folder for commit data
58-
echo "Found commit: $commit";
72+
echo -e "\e[32m[+] Found commit: $commit\e[0m";
5973
path="$base/$count-$commit"
6074
mkdir -p $path;
6175
#Add meta information
@@ -95,6 +109,4 @@ find ".git/objects" -type f |
95109

96110
done;
97111

98-
cd $OLDDIR;
99-
100-
echo "Finished";
112+
cd $OLDDIR;

Finder/gitfinder.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@ def findgitrepo(domain):
2626
return
2727

2828
if __name__ == '__main__':
29-
29+
print("""
30+
###########
31+
# Finder is part of https://github.com/internetwache/GitTools
32+
#
33+
# Developed and maintained by @gehaxelt from @internetwache
34+
#
35+
# Use at your own risk. Usage might be illegal in certain circumstances.
36+
# Only for educational purposes!
37+
###########
38+
""")
3039
# Parse arguments
3140
parser = argparse.ArgumentParser()
3241
parser.add_argument('-i', '--inputfile', default='domains.txt', help='input file')

0 commit comments

Comments
 (0)