-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-attack.sh
More file actions
executable file
·67 lines (60 loc) · 1.61 KB
/
Copy pathtest-attack.sh
File metadata and controls
executable file
·67 lines (60 loc) · 1.61 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
#!/bin/bash
# Configuration
API_URL="http://localhost:5000/api/logs/ingest"
echo "[*] Initializing Cloud Security Monitoring Baseline..."
# Generate normal traffic
for i in {1..20}; do
curl -s -X POST $API_URL \
-H "Content-Type: application/json" \
-d '{
"user": "sys_admin",
"event": "login_success",
"ip": "192.168.1.'$((RANDOM % 50))'",
"source": "web_portal",
"severity": "info"
}' > /dev/null
done
echo "[+] Normal traffic baseline generated."
sleep 2
echo "[*] Simulating Brute Force Attack from 10.0.0.99..."
for i in {1..12}; do
curl -s -X POST $API_URL \
-H "Content-Type: application/json" \
-d '{
"user": "root",
"event": "login_failed",
"ip": "10.0.0.99",
"source": "ssh",
"severity": "warning"
}' > /dev/null
sleep 0.1
done
echo "[!] Brute force complete."
sleep 2
echo "[*] Simulating API Abuse (Rate Limit Exceeded) from 45.33.22.11..."
for i in {1..60}; do
curl -s -X POST $API_URL \
-H "Content-Type: application/json" \
-d '{
"user": "anonymous",
"event": "api_request",
"ip": "45.33.22.11",
"source": "public_api",
"severity": "info"
}' > /dev/null
done
echo "[!] API abuse complete."
sleep 1
echo "[*] Simulating Malicious File Upload from 172.16.0.4..."
curl -s -X POST $API_URL \
-H "Content-Type: application/json" \
-d '{
"user": "guest",
"event": "file_upload",
"ip": "172.16.0.4",
"source": "upload_portal",
"severity": "critical",
"fileType": ".sh"
}' > /dev/null
echo ""
echo "[SUCCESS] All simulated attacks sent. Check the React Dashboard!"