-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·78 lines (63 loc) · 2.04 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·78 lines (63 loc) · 2.04 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
#!/bin/bash
# CyberSecurity Toolkit Build Script
set -e
echo "🔧 Building CyberSecurity Toolkit..."
# Check for required dependencies
echo "📋 Checking dependencies..."
# Check for libpcap and set environment variables for macOS
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS - set libpcap paths for Homebrew
export PKG_CONFIG_PATH="/opt/homebrew/opt/libpcap/lib/pkgconfig:$PKG_CONFIG_PATH"
export LDFLAGS="-L/opt/homebrew/opt/libpcap/lib $LDFLAGS"
export CPPFLAGS="-I/opt/homebrew/opt/libpcap/include $CPPFLAGS"
fi
if ! pkg-config --exists libpcap; then
echo "❌ libpcap not found. Please install:"
echo " macOS: brew install libpcap"
echo " Ubuntu: sudo apt-get install libpcap-dev"
echo " CentOS: sudo yum install libpcap-devel"
exit 1
fi
echo "✅ libpcap found"
# Check for CMake
if ! command -v cmake &> /dev/null; then
echo "❌ CMake not found. Please install CMake 3.16+"
exit 1
fi
echo "✅ CMake found"
# Create build directory
echo "📁 Creating build directory..."
mkdir -p build
cd build
# Configure with CMake
echo "⚙️ Configuring with CMake..."
cmake .. -DCMAKE_BUILD_TYPE=Release
# Build the project
echo "🔨 Building project..."
make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
echo "✅ Build completed successfully!"
# Run tests
echo "🧪 Running tests..."
if make test; then
echo "✅ All tests passed!"
else
echo "❌ Some tests failed. Check the output above."
exit 1
fi
echo ""
echo "🎉 CyberSecurity Toolkit built successfully!"
echo ""
echo "📍 Executables location: $(pwd)"
echo " • packet_analyzer - Packet capture and analysis"
echo " • port_scan - Port scanning tool"
echo " • cybersec_toolkit - Combined interactive toolkit"
echo ""
echo "📖 Usage examples:"
echo " ./packet_analyzer --help"
echo " ./port_scan --help"
echo " ./cybersec_toolkit"
echo ""
echo "⚠️ Note: Some features may require root privileges for:"
echo " • Live packet capture"
echo " • SYN scanning"
echo " • Raw socket operations"