Skip to content

Commit 37e0142

Browse files
committed
CentOS method 2
Now you can use method 2 in CentOS
1 parent 2c21d24 commit 37e0142

3 files changed

Lines changed: 107 additions & 0 deletions

File tree

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/bin/bash
2+
3+
# Crowdstrike-Deploy Banner
4+
echo ""
5+
echo " ██████╗██████╗ ██████╗ ██╗ ██╗██████╗ ███████╗████████╗██████╗ ██╗██╗ ██╗███████╗"
6+
echo " ██╔════╝██╔══██╗██╔═══██╗██║ ██║██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██║██║ ██╔╝██╔════╝"
7+
echo " ██║ ██████╔╝██║ ██║██║ █╗ ██║██║ ██║███████╗ ██║ ██████╔╝██║█████╔╝ █████╗"
8+
echo " ██║ ██╔══██╗██║ ██║██║███╗██║██║ ██║╚════██║ ██║ ██╔══██╗██║██╔═██╗ ██╔══╝"
9+
echo " ╚██████╗██║ ██║╚██████╔╝╚███╔███╔╝██████╔╝███████║ ██║ ██║ ██║██║██║ ██╗███████╗"
10+
echo " ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚══════╝"
11+
echo ""
12+
echo " ██████╗ ███████╗██████╗ ██╗ ██████╗ ██╗ ██╗"
13+
echo " ██╔══██╗██╔════╝██╔══██╗██║ ██╔═══██╗╚██╗ ██╔╝"
14+
echo " ██║ ██║█████╗ ██████╔╝██║ ██║ ██║ ╚████╔╝"
15+
echo " ██║ ██║██╔══╝ ██╔═══╝ ██║ ██║ ██║ ╚██╔╝"
16+
echo " ██████╔╝███████╗██║ ███████╗╚██████╔╝ ██║"
17+
echo " ╚═════╝ ╚══════╝╚═╝ ╚══════╝ ╚═════╝ ╚═╝"
18+
echo ""
19+
echo " Created & Maintained by: Eilay Yosfan"
20+
echo " GitHub.com/YosfanEilay"
21+
echo " Method: 2"
22+
echo ""
23+
24+
set -e
25+
26+
####################### Please Paste Your Information in Here ##############
27+
Operation="" # Choose operation: "Split" or "Deploy"
28+
Parts="" # Number of parts to split the file into
29+
OriginalFilePath="" # Full path to the original file (for splitting)
30+
SplittedFilesLocation="" # Path where split parts are stored (for deploying)
31+
CrowdstrikeCID="" # Tenant CID string
32+
TenantName="" # Display name for tenant (for logging)
33+
############################################################################
34+
35+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
36+
37+
split_file() {
38+
if [ ! -f "$OriginalFilePath" ]; then
39+
echo "Error: File not found: $OriginalFilePath"
40+
exit 1
41+
fi
42+
43+
FILESIZE=$(stat -c%s "$OriginalFilePath")
44+
CHUNK_SIZE=$(( (FILESIZE + Parts - 1) / Parts ))
45+
46+
echo "Splitting '$OriginalFilePath' into $Parts parts..."
47+
48+
for ((i=1; i<=Parts; i++)); do
49+
OFFSET=$(( (i - 1) * CHUNK_SIZE ))
50+
OUTPUT_FILE="$SCRIPT_DIR/file_split_part_$i"
51+
dd if="$OriginalFilePath" of="$OUTPUT_FILE" bs=1 skip=$OFFSET count=$CHUNK_SIZE status=none
52+
echo "Created: $OUTPUT_FILE"
53+
done
54+
55+
echo "Split complete."
56+
}
57+
58+
deploy_sensor() {
59+
echo "Rebuilding original file from parts in: $SplittedFilesLocation"
60+
61+
OUTPUT_FILE="$SCRIPT_DIR/CrowdstrikeSensor.rpm"
62+
rm -f "$OUTPUT_FILE"
63+
64+
for part in $(ls "$SplittedFilesLocation"/file_split_part_* 2>/dev/null | sort -V); do
65+
cat "$part" >> "$OUTPUT_FILE"
66+
echo "Appended: $part"
67+
done
68+
69+
if [ ! -f "$OUTPUT_FILE" ]; then
70+
echo "Error: Reconstructed file not found."
71+
exit 1
72+
fi
73+
74+
echo "Crowdstrike sensor file reconstructed as: $OUTPUT_FILE"
75+
echo ""
76+
77+
echo "[+] Starting Crowdstrike sensor installation..."
78+
yum -y localinstall "$OUTPUT_FILE"
79+
80+
echo "[+] Waiting for the service to settle..."
81+
sleep 60
82+
83+
echo "[+] Configuring sensor with CID..."
84+
/opt/CrowdStrike/falconctl -s --cid="$CrowdstrikeCID" -f
85+
86+
echo "[+] Starting falcon-sensor service..."
87+
systemctl start falcon-sensor
88+
89+
echo "[+] Verifying that falcon-sensor is running:"
90+
ps aux | grep "[f]alcon"
91+
92+
echo ""
93+
echo "[+] Done. Host will appear in the Falcon console under tenant '$TenantName' in 5-10 minutes."
94+
}
95+
96+
case "$Operation" in
97+
"Split")
98+
split_file
99+
;;
100+
"Deploy")
101+
deploy_sensor
102+
;;
103+
*)
104+
echo "Error: Unknown Operation: $Operation (use 'Split' or 'Deploy')"
105+
exit 1
106+
;;
107+
esac

deploy_crowdstrike/linux/method_1/linux_crowdstrike_deploy_method_1.sh renamed to deploy_crowdstrike/linux/Ubuntu/method_1/linux_crowdstrike_deploy_method_1.sh

File renamed without changes.

deploy_crowdstrike/linux/method_2/linux_crowdstrike_deploy_method_2.sh renamed to deploy_crowdstrike/linux/Ubuntu/method_2/linux_crowdstrike_deploy_method_2.sh

File renamed without changes.

0 commit comments

Comments
 (0)