-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
156 lines (137 loc) · 4.02 KB
/
entrypoint.sh
File metadata and controls
156 lines (137 loc) · 4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/bin/bash
set -e
# ReconFlow Docker Entrypoint Script
# Handles initialization and tool validation
echo "=========================================="
echo " ReconFlow Docker Container"
echo "=========================================="
echo ""
# Color codes for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Function to print colored output
print_status() {
echo -e "${GREEN}[+]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[!]${NC} $1"
}
print_error() {
echo -e "${RED}[-]${NC} $1"
}
# Check if required tools are installed
check_tools() {
print_status "Checking required tools..."
local required_tools=(
"subfinder"
"httpx"
"ffuf"
"masscan"
"nmap"
"katana"
"dnsx"
"gau"
"waybackurls"
)
local missing_tools=()
for tool in "${required_tools[@]}"; do
if command -v "$tool" &> /dev/null; then
version=$($tool -version 2>/dev/null || echo "installed")
echo " $tool: $version"
else
print_warning " $tool: not found"
missing_tools+=("$tool")
fi
done
if [ ${#missing_tools[@]} -gt 0 ]; then
print_warning "Some tools are missing. The container may not function properly."
print_warning "Missing tools: ${missing_tools[*]}"
else
print_status "All required tools are installed"
fi
}
# Initialize subfinder API configuration
init_subfinder() {
print_status "Initializing subfinder configuration..."
mkdir -p "$HOME/.config/subfinder"
}
# Create output directories
setup_output() {
print_status "Setting up output directories..."
mkdir -p /app/output
chmod 755 /app/output
}
# Check capabilities
check_capabilities() {
print_status "Checking container capabilities..."
# Check for NET_RAW capability (needed for masscan)
if capsh --print 2>/dev/null | grep -q "cap_net_raw"; then
print_status "NET_RAW capability: available"
else
print_warning "NET_RAW capability: not available (needed for masscan)"
print_warning "Run with: docker run --cap-add=NET_RAW ..."
fi
# Check for NET_ADMIN capability (needed for masscan)
if capsh --print 2>/dev/null | grep -q "cap_net_admin"; then
print_status "NET_ADMIN capability: available"
else
print_warning "NET_ADMIN capability: not available (needed for masscan)"
print_warning "Run with: docker run --cap-add=NET_ADMIN ..."
fi
# Check for SYS_ADMIN capability (needed for some scanning)
if capsh --print 2>/dev/null | grep -q "cap_sys_admin"; then
print_status "SYS_ADMIN capability: available"
else
print_warning "SYS_ADMIN capability: not available"
fi
}
# Show usage information
show_usage() {
echo ""
echo "ReconFlow - Automated Reconnaissance Framework"
echo ""
echo "Usage:"
echo " reconflow <command> [options]"
echo ""
echo "Commands:"
echo " scan Start a new reconnaissance scan"
echo " resume Resume an interrupted scan"
echo " install Install required tools"
echo " version Show version"
echo " help Show this help message"
echo ""
echo "Examples:"
echo " reconflow scan -d example.com --full"
echo " reconflow resume -d example.com"
echo " reconflow install --check"
echo ""
echo "Docker Examples:"
echo " docker run --rm -it \\"
echo " --cap-add NET_RAW --cap-add NET_ADMIN \\"
echo " -v \$(pwd)/output:/app/output \\"
echo " reconflow scan -d example.com --full"
echo ""
}
# Handle commands
case "${1:-}" in
--help|-h|"")
show_usage
check_tools
check_capabilities
setup_output
exec reconflow "$@"
;;
scan|resume|install|version|help)
check_tools
check_capabilities
setup_output
exec reconflow "$@"
;;
*)
print_error "Unknown command: $1"
show_usage
exit 1
;;
esac