/honeytrap-modsec
43 | ```
44 |
45 |
46 |
--------------------------------------------------------------------------------
/honeytraps/waf_modsec/aws-ecs-container-definition.json:
--------------------------------------------------------------------------------
1 | {
2 | "family": "honeytrap",
3 | "executionRoleArn": "arn:aws:iam::544316695133:role/ecsTaskExecutionRole",
4 | "networkMode": "awsvpc",
5 | "cpu": "512",
6 | "containerDefinitions": [
7 | {
8 | "name": "honeytrap-modsec",
9 | "image": "floyd0122/honeytrap-modsec",
10 | "cpu": 1,
11 | "memoryReservation": 512,
12 | "links": [],
13 | "portMappings": [
14 | {
15 | "hostPort": 80,
16 | "protocol": "tcp",
17 | "containerPort": 80
18 | },
19 | {
20 | "hostPort": 8000,
21 | "protocol": "tcp",
22 | "containerPort": 8000
23 | },
24 | {
25 | "hostPort": 8080,
26 | "protocol": "tcp",
27 | "containerPort": 8080
28 | },
29 | {
30 | "hostPort": 8888,
31 | "protocol": "tcp",
32 | "containerPort": 8888
33 | }
34 | ],
35 | "essential": true,
36 | "entryPoint": [],
37 | "command": [],
38 | "environment": [
39 | {
40 | "name": "LOGSTASH_HOST",
41 | "value": "192.168.0.12:5044"
42 | }
43 | ],
44 | "mountPoints": [],
45 | "volumesFrom": [],
46 | "linuxParameters": {},
47 | "secrets": [],
48 | "privileged": false,
49 | "readonlyRootFilesystem": false,
50 | "dnsServers": [],
51 | "dnsSearchDomains": [],
52 | "disableNetworking": false,
53 | "extraHosts": [],
54 | "systemControls": [],
55 | "logConfiguration": {
56 | "logDriver": "awslogs",
57 | "secretOptions": [],
58 | "options": {
59 | "awslogs-group": "/ecs/honeytrap-modsec",
60 | "awslogs-region": "eu-west-1",
61 | "awslogs-stream-prefix": "ecs"
62 | }
63 | }
64 | }
65 | ],
66 | "placementConstraints": [],
67 | "memory": "1024",
68 | "requiresCompatibilities": [
69 | "FARGATE"
70 | ]
71 | }
--------------------------------------------------------------------------------
/honeytraps/waf_modsec/docker-compose.yml:
--------------------------------------------------------------------------------
1 | modsec_crs:
2 | env_file:
3 | - ./env
4 | ports:
5 | - "9091:80"
6 | - "8000:8000"
7 | - "8080:8080"
8 | - "8888:8888"
9 | environment:
10 | - PARANOIA=5
11 | volumes:
12 | - .:/app
13 | build: ./
14 | container_name: modsec_app
15 | privileged: true
16 |
--------------------------------------------------------------------------------
/honeytraps/waf_modsec/example-log.json:
--------------------------------------------------------------------------------
1 | {
2 | "transaction": {
3 | "time": "08/Jan/2020:09:29:17 +0000",
4 | "transaction_id": "XhWg7dIVjbnaIo0jT3v1-wAAAIA",
5 | "remote_address": "172.17.0.1",
6 | "remote_port": 56224,
7 | "local_address": "172.17.0.2",
8 | "local_port": 80
9 | },
10 | "request": {
11 | "request_line": "GET /?q=\"> HTTP/1.1",
12 | "headers": {
13 | "Host": "localhost:9091",
14 | "User-Agent": "curl/7.67.0",
15 | "Accept": "*/*"
16 | }
17 | },
18 | "response": {
19 | "protocol": "HTTP/1.1",
20 | "status": 403,
21 | "headers": {
22 | "Set-Cookie": "(null)=Admin:0",
23 | "Content-Length": "209",
24 | "Content-Type": "text/html; charset=iso-8859-1"
25 | },
26 | "body": "\n\n403 Forbidden\n\nForbidden
\nYou don't have permission to access /\non this server.
\n
\n\n"
27 | },
28 | "audit_data": {
29 | "messages": ["Warning. Found 9 byte(s) in ARGS:q outside range: 38,44-46,48-58,61,65-90,95,97-122. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf\"] [line \"1391\"] [id \"920273\"] [msg \"Invalid character in request (outside of very strict set)\"] [data \"ARGS:q=\\x22>\"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-protocol\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/PROTOCOL_VIOLATION/EVASION\"] [tag \"paranoia-level/4\"]", "Warning. detected XSS using libinjection. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf\"] [line \"59\"] [id \"941100\"] [msg \"XSS Attack Detected via libinjection\"] [data \"Matched Data: XSS data found within ARGS:q: \\x22>\"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-xss\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/XSS\"] [tag \"WASCTC/WASC-8\"] [tag \"WASCTC/WASC-22\"] [tag \"OWASP_TOP_10/A3\"] [tag \"OWASP_AppSensor/IE1\"] [tag \"CAPEC-242\"]", "Warning. Pattern match \"(?i)\"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-xss\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/XSS\"] [tag \"WASCTC/WASC-8\"] [tag \"WASCTC/WASC-22\"] [tag \"OWASP_TOP_10/A3\"] [tag \"OWASP_AppSensor/IE1\"] [tag \"CAPEC-242\"]", "Warning. Pattern match \"(?i:(?:<\\\\w[\\\\s\\\\S]*[\\\\s\\\\/]|['\\\"](?:[\\\\s\\\\S]*[\\\\s\\\\/])?)(?:on(?:d(?:e(?:vice(?:(?:orienta|mo)tion|proximity|found|light)|livery(?:success|error)|activate)|r(?:ag(?:e(?:n(?:ter|d)|xit)|(?:gestur|leav)e|start|drop|over)|op)|i(?:s(?:c(?:hargingtimechange ...\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf\"] [line \"218\"] [id \"941160\"] [msg \"NoScript XSS InjectionChecker: HTML Injection\"] [data \"Matched Data: \"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-xss\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/XSS\"] [tag \"WASCTC/WASC-8\"] [tag \"WASCTC/WASC-22\"] [tag \"OWASP_TOP_10/A3\"] [tag \"OWASP_AppSensor/IE1\"] [tag \"CAPEC-242\"]", "Warning. Pattern match \"<(?:a|abbr|acronym|address|applet|area|audioscope|b|base|basefront|bdo|bgsound|big|blackface|blink|blockquote|body|bq|br|button|caption|center|cite|code|col|colgroup|comment|dd|del|dfn|dir|div|dl|dt|em|embed|fieldset|fn|font|form|frame|frameset|h1|head ...\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf\"] [line \"879\"] [id \"941320\"] [msg \"Possible XSS Attack Detected - HTML Tag Handler\"] [data \"Matched Data: \"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-xss\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/XSS\"] [tag \"WASCTC/WASC-8\"] [tag \"WASCTC/WASC-22\"] [tag \"OWASP_TOP_10/A2\"] [tag \"OWASP_AppSensor/IE1\"] [tag \"PCI/6.5.1\"] [tag \"paranoia-level/2\"]", "Warning. Pattern match \"(?:^\\\\s*[\\\"'`;]+|[\\\"'`]+\\\\s*$)\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf\"] [line \"550\"] [id \"942110\"] [msg \"SQL Injection Attack: Common Injection Testing Detected\"] [data \"Matched Data: \\x22 found within ARGS:q: \\x22>\"] [severity \"WARNING\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-sqli\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/SQL_INJECTION\"] [tag \"WASCTC/WASC-19\"] [tag \"OWASP_TOP_10/A1\"] [tag \"OWASP_AppSensor/CIE1\"] [tag \"PCI/6.5.2\"] [tag \"paranoia-level/2\"]", "Warning. Pattern match \"(?i:[\\\\s'\\\"`()]*?([\\\\d\\\\w]++)[\\\\s'\\\"`()]*?(?:<(?:=(?:[\\\\s'\\\"`()]*?(?!\\\\1)[\\\\d\\\\w]+|>[\\\\s'\\\"`()]*?(?:\\\\1))|>?[\\\\s'\\\"`()]*?(?!\\\\1)[\\\\d\\\\w]+)|(?:not\\\\s+(?:regexp|like)|is\\\\s+not|>=?|!=|\\\\^)[\\\\s'\\\"`()]*?(?!\\\\1)[\\\\d\\\\w]+|(?:(?:sounds\\\\s+)?like|r(?:egexp|lik ...\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf\"] [line \"628\"] [id \"942130\"] [msg \"SQL Injection Attack: SQL Tautology Detected.\"] [data \"Matched Data: script>alert found within ARGS:q: \\x22>\"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-sqli\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/SQL_INJECTION\"] [tag \"WASCTC/WASC-19\"] [tag \"OWASP_TOP_10/A1\"] [tag \"OWASP_AppSensor/CIE1\"] [tag \"PCI/6.5.2\"] [tag \"paranoia-level/2\"]", "Warning. Pattern match \"(?i:[\\\"'`]\\\\s*?(?:(?:n(?:and|ot)|(?:x?x)?or|between|\\\\|\\\\||and|div|&&)\\\\s+[\\\\s\\\\w]+=\\\\s*?\\\\w+\\\\s*?having\\\\s+|like(?:\\\\s+[\\\\s\\\\w]+=\\\\s*?\\\\w+\\\\s*?having\\\\s+|\\\\W*?[\\\"'`\\\\d])|[^?\\\\w\\\\s=.,;)(]++\\\\s*?[(@\\\"'`]*?\\\\s*?\\\\w+\\\\W+\\\\w|\\\\*\\\\s*?\\\\w+\\\\W+[\\\"'`])|(?:unio ...\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf\"] [line \"803\"] [id \"942260\"] [msg \"Detects basic SQL authentication bypass attempts 2/3\"] [data \"Matched Data: \\x22>\"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-sqli\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/SQL_INJECTION\"] [tag \"WASCTC/WASC-19\"] [tag \"OWASP_TOP_10/A1\"] [tag \"OWASP_AppSensor/CIE1\"] [tag \"PCI/6.5.2\"] [tag \"paranoia-level/2\"]", "Warning. Pattern match \"((?:[~!@#\\\\$%\\\\^&\\\\*\\\\(\\\\)\\\\-\\\\+=\\\\{\\\\}\\\\[\\\\]\\\\|:;\\\"'\\xc2\\xb4\\xe2\\x80\\x99\\xe2\\x80\\x98`<>][^~!@#\\\\$%\\\\^&\\\\*\\\\(\\\\)\\\\-\\\\+=\\\\{\\\\}\\\\[\\\\]\\\\|:;\\\"'\\xc2\\xb4\\xe2\\x80\\x99\\xe2\\x80\\x98`<>]*?){6})\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf\"] [line \"1526\"] [id \"942431\"] [msg \"Restricted SQL Character Anomaly Detection (args): # of special characters exceeded (6)\"] [data \"Matched Data: \\x22>\"] [severity \"WARNING\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-sqli\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/SQL_INJECTION\"] [tag \"WASCTC/WASC-19\"] [tag \"OWASP_TOP_10/A1\"] [tag \"OWASP_AppSensor/CIE1\"] [tag \"PCI/6.5.2\"] [tag \"paranoia-level/3\"]", "Warning. Pattern match \"((?:[~!@#\\\\$%\\\\^&\\\\*\\\\(\\\\)\\\\-\\\\+=\\\\{\\\\}\\\\[\\\\]\\\\|:;\\\"'\\xc2\\xb4\\xe2\\x80\\x99\\xe2\\x80\\x98`<>][^~!@#\\\\$%\\\\^&\\\\*\\\\(\\\\)\\\\-\\\\+=\\\\{\\\\}\\\\[\\\\]\\\\|:;\\\"'\\xc2\\xb4\\xe2\\x80\\x99\\xe2\\x80\\x98`<>]*?){2})\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf\"] [line \"1717\"] [id \"942432\"] [msg \"Restricted SQL Character Anomaly Detection (args): # of special characters exceeded (2)\"] [data \"Matched Data: \\x22> found within ARGS:q: \\x22>\"] [severity \"WARNING\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-sqli\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/SQL_INJECTION\"] [tag \"WASCTC/WASC-19\"] [tag \"OWASP_TOP_10/A1\"] [tag \"OWASP_AppSensor/CIE1\"] [tag \"PCI/6.5.2\"] [tag \"paranoia-level/4\"]", "Access denied with code 403 (phase 2). Operator GE matched 5 at TX:anomaly_score. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf\"] [line \"91\"] [id \"949110\"] [msg \"Inbound Anomaly Score Exceeded (Total Score: 44)\"] [severity \"CRITICAL\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-generic\"]", "Warning. Operator GE matched 5 at TX:inbound_anomaly_score. [file \"/etc/modsecurity.d/owasp-crs/rules/RESPONSE-980-CORRELATION.conf\"] [line \"86\"] [id \"980130\"] [msg \"Inbound Anomaly Score Exceeded (Total Inbound Score: 44 - SQLI=19,XSS=20,RFI=0,LFI=0,RCE=0,PHPI=0,HTTP=0,SESS=0): individual paranoia level scores: 15, 18, 3, 8\"] [tag \"event-correlation\"]"],
30 | "error_messages": ["[file \"apache2_util.c\"] [line 273] [level 3] [client 172.17.0.1] ModSecurity: Warning. Found 9 byte(s) in ARGS:q outside range: 38,44-46,48-58,61,65-90,95,97-122. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf\"] [line \"1391\"] [id \"920273\"] [msg \"Invalid character in request (outside of very strict set)\"] [data \"ARGS:q=\\\\\\\\x22>\"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-protocol\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/PROTOCOL_VIOLATION/EVASION\"] [tag \"paranoia-level/4\"] [hostname \"localhost\"] [uri \"/\"] [unique_id \"XhWg7dIVjbnaIo0jT3v1-wAAAIA\"]", "[file \"apache2_util.c\"] [line 273] [level 3] [client 172.17.0.1] ModSecurity: Warning. detected XSS using libinjection. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf\"] [line \"59\"] [id \"941100\"] [msg \"XSS Attack Detected via libinjection\"] [data \"Matched Data: XSS data found within ARGS:q: \\\\\\\\x22>\"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-xss\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/XSS\"] [tag \"WASCTC/WASC-8\"] [tag \"WASCTC/WASC-22\"] [tag \"OWASP_TOP_10/A3\"] [tag \"OWASP_AppSensor/IE1\"] [tag \"CAPEC-242\"] [hostname \"localhost\"] [uri \"/\"] [unique_id \"XhWg7dIVjbnaIo0jT3v1-wAAAIA\"]", "[file \"apache2_util.c\"] [line 273] [level 3] [client 172.17.0.1] ModSecurity: Warning. Pattern match \"(?i)\"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-xss\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/XSS\"] [tag \"WASCTC/WASC-8\"] [tag \"WASCTC/WASC-22\"] [tag \"OWASP_TOP_10/A3\"] [tag \"OWASP_AppSensor/IE1\"] [tag \"CAPEC-242\"] [hostname \"localhost\"] [uri \"/\"] [unique_id \"XhWg7dIVjbnaIo0jT3v1-wAAAIA\"]", "[file \"apache2_util.c\"] [line 273] [level 3] [client 172.17.0.1] ModSecurity: Warning. Pattern match \"(?i:(?:<\\\\\\\\\\\\\\\\w[\\\\\\\\\\\\\\\\s\\\\\\\\\\\\\\\\S]*[\\\\\\\\\\\\\\\\s\\\\\\\\\\\\\\\\/]|['\\\\\\\\\"](?:[\\\\\\\\\\\\\\\\s\\\\\\\\\\\\\\\\S]*[\\\\\\\\\\\\\\\\s\\\\\\\\\\\\\\\\/])?)(?:on(?:d(?:e(?:vice(?:(?:orienta|mo)tion|proximity|found|light)|livery(?:success|error)|activate)|r(?:ag(?:e(?:n(?:ter|d)|xit)|(?:gestur|leav)e|start|drop|over)|op)|i(?:s(?:c(?:hargingtimechange ...\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf\"] [line \"218\"] [id \"941160\"] [msg \"NoScript XSS InjectionChecker: HTML Injection\"] [data \"Matched Data: \"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-xss\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/XSS\"] [tag \"WASCTC/WASC-8\"] [tag \"WASCTC/WASC-22\"] [tag \"OWASP_TOP_10/A3\"] [tag \"OWASP_AppSensor/IE1\"] [tag \"CAPEC-242\"] [hostname \"localhost\"] [uri \"/\"] [unique_id \"XhWg7dIVjbnaIo0jT3v1-wAAAIA\"]", "[file \"apache2_util.c\"] [line 273] [level 3] [client 172.17.0.1] ModSecurity: Warning. Pattern match \"<(?:a|abbr|acronym|address|applet|area|audioscope|b|base|basefront|bdo|bgsound|big|blackface|blink|blockquote|body|bq|br|button|caption|center|cite|code|col|colgroup|comment|dd|del|dfn|dir|div|dl|dt|em|embed|fieldset|fn|font|form|frame|frameset|h1|head ...\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf\"] [line \"879\"] [id \"941320\"] [msg \"Possible XSS Attack Detected - HTML Tag Handler\"] [data \"Matched Data: \"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-xss\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/XSS\"] [tag \"WASCTC/WASC-8\"] [tag \"WASCTC/WASC-22\"] [tag \"OWASP_TOP_10/A2\"] [tag \"OWASP_AppSensor/IE1\"] [tag \"PCI/6.5.1\"] [tag \"paranoia-level/2\"] [hostname \"localhost\"] [uri \"/\"] [unique_id \"XhWg7dIVjbnaIo0jT3v1-wAAAIA\"]", "[file \"apache2_util.c\"] [line 273] [level 3] [client 172.17.0.1] ModSecurity: Warning. Pattern match \"(?:^\\\\\\\\\\\\\\\\s*[\\\\\\\\\"'`;]+|[\\\\\\\\\"'`]+\\\\\\\\\\\\\\\\s*$)\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf\"] [line \"550\"] [id \"942110\"] [msg \"SQL Injection Attack: Common Injection Testing Detected\"] [data \"Matched Data: \\\\\\\\x22 found within ARGS:q: \\\\\\\\x22>\"] [severity \"WARNING\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-sqli\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/SQL_INJECTION\"] [tag \"WASCTC/WASC-19\"] [tag \"OWASP_TOP_10/A1\"] [tag \"OWASP_AppSensor/CIE1\"] [tag \"PCI/6.5.2\"] [tag \"paranoia-level/2\"] [hostname \"localhost\"] [uri \"/\"] [unique_id \"XhWg7dIVjbnaIo0jT3v1-wAAAIA\"]", "[file \"apache2_util.c\"] [line 273] [level 3] [client 172.17.0.1] ModSecurity: Warning. Pattern match \"(?i:[\\\\\\\\\\\\\\\\s'\\\\\\\\\"`()]*?([\\\\\\\\\\\\\\\\d\\\\\\\\\\\\\\\\w]++)[\\\\\\\\\\\\\\\\s'\\\\\\\\\"`()]*?(?:<(?:=(?:[\\\\\\\\\\\\\\\\s'\\\\\\\\\"`()]*?(?!\\\\\\\\\\\\\\\\1)[\\\\\\\\\\\\\\\\d\\\\\\\\\\\\\\\\w]+|>[\\\\\\\\\\\\\\\\s'\\\\\\\\\"`()]*?(?:\\\\\\\\\\\\\\\\1))|>?[\\\\\\\\\\\\\\\\s'\\\\\\\\\"`()]*?(?!\\\\\\\\\\\\\\\\1)[\\\\\\\\\\\\\\\\d\\\\\\\\\\\\\\\\w]+)|(?:not\\\\\\\\\\\\\\\\s+(?:regexp|like)|is\\\\\\\\\\\\\\\\s+not|>=?|!=|\\\\\\\\\\\\\\\\^)[\\\\\\\\\\\\\\\\s'\\\\\\\\\"`()]*?(?!\\\\\\\\\\\\\\\\1)[\\\\\\\\\\\\\\\\d\\\\\\\\\\\\\\\\w]+|(?:(?:sounds\\\\\\\\\\\\\\\\s+)?like|r(?:egexp|lik ...\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf\"] [line \"628\"] [id \"942130\"] [msg \"SQL Injection Attack: SQL Tautology Detected.\"] [data \"Matched Data: script>alert found within ARGS:q: \\\\\\\\x22>\"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-sqli\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/SQL_INJECTION\"] [tag \"WASCTC/WASC-19\"] [tag \"OWASP_TOP_10/A1\"] [tag \"OWASP_AppSensor/CIE1\"] [tag \"PCI/6.5.2\"] [tag \"paranoia-level/2\"] [hostname \"localhost\"] [uri \"/\"] [unique_id \"XhWg7dIVjbnaIo0jT3v1-wAAAIA\"]", "[file \"apache2_util.c\"] [line 273] [level 3] [client 172.17.0.1] ModSecurity: Warning. Pattern match \"(?i:[\\\\\\\\\"'`]\\\\\\\\\\\\\\\\s*?(?:(?:n(?:and|ot)|(?:x?x)?or|between|\\\\\\\\\\\\\\\\|\\\\\\\\\\\\\\\\||and|div|&&)\\\\\\\\\\\\\\\\s+[\\\\\\\\\\\\\\\\s\\\\\\\\\\\\\\\\w]+=\\\\\\\\\\\\\\\\s*?\\\\\\\\\\\\\\\\w+\\\\\\\\\\\\\\\\s*?having\\\\\\\\\\\\\\\\s+|like(?:\\\\\\\\\\\\\\\\s+[\\\\\\\\\\\\\\\\s\\\\\\\\\\\\\\\\w]+=\\\\\\\\\\\\\\\\s*?\\\\\\\\\\\\\\\\w+\\\\\\\\\\\\\\\\s*?having\\\\\\\\\\\\\\\\s+|\\\\\\\\\\\\\\\\W*?[\\\\\\\\\"'`\\\\\\\\\\\\\\\\d])|[^?\\\\\\\\\\\\\\\\w\\\\\\\\\\\\\\\\s=.,;)(]++\\\\\\\\\\\\\\\\s*?[(@\\\\\\\\\"'`]*?\\\\\\\\\\\\\\\\s*?\\\\\\\\\\\\\\\\w+\\\\\\\\\\\\\\\\W+\\\\\\\\\\\\\\\\w|\\\\\\\\\\\\\\\\*\\\\\\\\\\\\\\\\s*?\\\\\\\\\\\\\\\\w+\\\\\\\\\\\\\\\\W+[\\\\\\\\\"'`])|(?:unio ...\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf\"] [line \"803\"] [id \"942260\"] [msg \"Detects basic SQL authentication bypass attempts 2/3\"] [data \"Matched Data: \\\\\\\\x22>\"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-sqli\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/SQL_INJECTION\"] [tag \"WASCTC/WASC-19\"] [tag \"OWASP_TOP_10/A1\"] [tag \"OWASP_AppSensor/CIE1\"] [tag \"PCI/6.5.2\"] [tag \"paranoia-level/2\"] [hostname \"localhost\"] [uri \"/\"] [unique_id \"XhWg7dIVjbnaIo0jT3v1-wAAAIA\"]", "[file \"apache2_util.c\"] [line 273] [level 3] [client 172.17.0.1] ModSecurity: Warning. Pattern match \"((?:[~!@#\\\\\\\\\\\\\\\\$%\\\\\\\\\\\\\\\\^&\\\\\\\\\\\\\\\\*\\\\\\\\\\\\\\\\(\\\\\\\\\\\\\\\\)\\\\\\\\\\\\\\\\-\\\\\\\\\\\\\\\\+=\\\\\\\\\\\\\\\\{\\\\\\\\\\\\\\\\}\\\\\\\\\\\\\\\\[\\\\\\\\\\\\\\\\]\\\\\\\\\\\\\\\\|:;\\\\\\\\\"'\\\\\\\\xc2\\\\\\\\xb4\\\\\\\\xe2\\\\\\\\x80\\\\\\\\x99\\\\\\\\xe2\\\\\\\\x80\\\\\\\\x98`<>][^~!@#\\\\\\\\\\\\\\\\$%\\\\\\\\\\\\\\\\^&\\\\\\\\\\\\\\\\*\\\\\\\\\\\\\\\\(\\\\\\\\\\\\\\\\)\\\\\\\\\\\\\\\\-\\\\\\\\\\\\\\\\+=\\\\\\\\\\\\\\\\{\\\\\\\\\\\\\\\\}\\\\\\\\\\\\\\\\[\\\\\\\\\\\\\\\\]\\\\\\\\\\\\\\\\|:;\\\\\\\\\"'\\\\\\\\xc2\\\\\\\\xb4\\\\\\\\xe2\\\\\\\\x80\\\\\\\\x99\\\\\\\\xe2\\\\\\\\x80\\\\\\\\x98`<>]*?){6})\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf\"] [line \"1526\"] [id \"942431\"] [msg \"Restricted SQL Character Anomaly Detection (args): # of special characters exceeded (6)\"] [data \"Matched Data: \\\\\\\\x22>\"] [severity \"WARNING\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-sqli\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/SQL_INJECTION\"] [tag \"WASCTC/WASC-19\"] [tag \"OWASP_TOP_10/A1\"] [tag \"OWASP_AppSensor/CIE1\"] [tag \"PCI/6.5.2\"] [tag \"paranoia-level/3\"] [hostname \"localhost\"] [uri \"/\"] [unique_id \"XhWg7dIVjbnaIo0jT3v1-wAAAIA\"]", "[file \"apache2_util.c\"] [line 273] [level 3] [client 172.17.0.1] ModSecurity: Warning. Pattern match \"((?:[~!@#\\\\\\\\\\\\\\\\$%\\\\\\\\\\\\\\\\^&\\\\\\\\\\\\\\\\*\\\\\\\\\\\\\\\\(\\\\\\\\\\\\\\\\)\\\\\\\\\\\\\\\\-\\\\\\\\\\\\\\\\+=\\\\\\\\\\\\\\\\{\\\\\\\\\\\\\\\\}\\\\\\\\\\\\\\\\[\\\\\\\\\\\\\\\\]\\\\\\\\\\\\\\\\|:;\\\\\\\\\"'\\\\\\\\xc2\\\\\\\\xb4\\\\\\\\xe2\\\\\\\\x80\\\\\\\\x99\\\\\\\\xe2\\\\\\\\x80\\\\\\\\x98`<>][^~!@#\\\\\\\\\\\\\\\\$%\\\\\\\\\\\\\\\\^&\\\\\\\\\\\\\\\\*\\\\\\\\\\\\\\\\(\\\\\\\\\\\\\\\\)\\\\\\\\\\\\\\\\-\\\\\\\\\\\\\\\\+=\\\\\\\\\\\\\\\\{\\\\\\\\\\\\\\\\}\\\\\\\\\\\\\\\\[\\\\\\\\\\\\\\\\]\\\\\\\\\\\\\\\\|:;\\\\\\\\\"'\\\\\\\\xc2\\\\\\\\xb4\\\\\\\\xe2\\\\\\\\x80\\\\\\\\x99\\\\\\\\xe2\\\\\\\\x80\\\\\\\\x98`<>]*?){2})\" at ARGS:q. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf\"] [line \"1717\"] [id \"942432\"] [msg \"Restricted SQL Character Anomaly Detection (args): # of special characters exceeded (2)\"] [data \"Matched Data: \\\\\\\\x22> found within ARGS:q: \\\\\\\\x22>\"] [severity \"WARNING\"] [ver \"OWASP_CRS/3.2.0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-sqli\"] [tag \"OWASP_CRS\"] [tag \"OWASP_CRS/WEB_ATTACK/SQL_INJECTION\"] [tag \"WASCTC/WASC-19\"] [tag \"OWASP_TOP_10/A1\"] [tag \"OWASP_AppSensor/CIE1\"] [tag \"PCI/6.5.2\"] [tag \"paranoia-level/4\"] [hostname \"localhost\"] [uri \"/\"] [unique_id \"XhWg7dIVjbnaIo0jT3v1-wAAAIA\"]", "[file \"apache2_util.c\"] [line 273] [level 3] [client 172.17.0.1] ModSecurity: Access denied with code 403 (phase 2). Operator GE matched 5 at TX:anomaly_score. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf\"] [line \"91\"] [id \"949110\"] [msg \"Inbound Anomaly Score Exceeded (Total Score: 44)\"] [severity \"CRITICAL\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-generic\"] [hostname \"localhost\"] [uri \"/\"] [unique_id \"XhWg7dIVjbnaIo0jT3v1-wAAAIA\"]", "[file \"apache2_util.c\"] [line 273] [level 3] [client 172.17.0.1] ModSecurity: Warning. Operator GE matched 5 at TX:inbound_anomaly_score. [file \"/etc/modsecurity.d/owasp-crs/rules/RESPONSE-980-CORRELATION.conf\"] [line \"86\"] [id \"980130\"] [msg \"Inbound Anomaly Score Exceeded (Total Inbound Score: 44 - SQLI=19,XSS=20,RFI=0,LFI=0,RCE=0,PHPI=0,HTTP=0,SESS=0): individual paranoia level scores: 15, 18, 3, 8\"] [tag \"event-correlation\"] [hostname \"localhost\"] [uri \"/\"] [unique_id \"XhWg7dIVjbnaIo0jT3v1-wAAAIA\"]"],
31 | "action": {
32 | "intercepted": true,
33 | "phase": 2,
34 | "message": "Operator GE matched 5 at TX:anomaly_score."
35 | },
36 | "stopwatch": {
37 | "p1": 413,
38 | "p2": 996,
39 | "p3": 0,
40 | "p4": 0,
41 | "p5": 94,
42 | "sr": 97,
43 | "sw": 0,
44 | "l": 0,
45 | "gc": 0
46 | },
47 | "response_body_dechunked": true,
48 | "producer": ["ModSecurity for Apache/2.9.3 (http://www.modsecurity.org/)", "OWASP_CRS/3.2.0"],
49 | "server": "Apache",
50 | "engine_mode": "ENABLED"
51 | }
52 | }
--------------------------------------------------------------------------------
/honeytraps/waf_modsec/filebeat.yml:
--------------------------------------------------------------------------------
1 | output:
2 | logstash:
3 | enabled: true
4 | hosts: '${LOGSTASH_HOST:?must set LOGSTASH_HOST env variable}'
5 | timeout: 15
6 |
7 |
8 | filebeat:
9 | inputs:
10 | -
11 | paths:
12 | - /var/log/modsec_audit_processed.log
13 | type: log
14 | json.keys_under_root: true
15 | json.add_error_key: true
16 |
--------------------------------------------------------------------------------
/honeytraps/waf_modsec/form.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Login
4 |
5 | Add entry
6 | Add another Article
7 |
12 |
13 |
--------------------------------------------------------------------------------
/honeytraps/waf_modsec/httpd.conf:
--------------------------------------------------------------------------------
1 | #
2 | # This is the main Apache HTTP server configuration file. It contains the
3 | # configuration directives that give the server its instructions.
4 | # See for detailed information.
5 | # In particular, see
6 | #
7 | # for a discussion of each configuration directive.
8 | #
9 | # Do NOT simply read the instructions in here without understanding
10 | # what they do. They're here only as hints or reminders. If you are unsure
11 | # consult the online docs. You have been warned.
12 | #
13 | # Configuration and logfile names: If the filenames you specify for many
14 | # of the server's control files begin with "/" (or "drive:/" for Win32), the
15 | # server will use that explicit path. If the filenames do *not* begin
16 | # with "/", the value of ServerRoot is prepended -- so "logs/access_log"
17 | # with ServerRoot set to "/usr/local/apache2" will be interpreted by the
18 | # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log"
19 | # will be interpreted as '/logs/access_log'.
20 |
21 | #
22 | # ServerRoot: The top of the directory tree under which the server's
23 | # configuration, error, and log files are kept.
24 | #
25 | # Do not add a slash at the end of the directory path. If you point
26 | # ServerRoot at a non-local disk, be sure to specify a local disk on the
27 | # Mutex directive, if file-based mutexes are used. If you wish to share the
28 | # same ServerRoot for multiple httpd daemons, you will need to change at
29 | # least PidFile.
30 | #
31 | ServerRoot "/usr/local/apache2"
32 |
33 | #
34 | # Mutex: Allows you to set the mutex mechanism and mutex file directory
35 | # for individual mutexes, or change the global defaults
36 | #
37 | # Uncomment and change the directory if mutexes are file-based and the default
38 | # mutex file directory is not on a local disk or is not appropriate for some
39 | # other reason.
40 | #
41 | # Mutex default:logs
42 |
43 | #
44 | # Listen: Allows you to bind Apache to specific IP addresses and/or
45 | # ports, instead of the default. See also the
46 | # directive.
47 | #
48 | # Change this to Listen on specific IP addresses as shown below to
49 | # prevent Apache from glomming onto all bound IP addresses.
50 | #
51 | #Listen 12.34.56.78:80
52 | Listen 80
53 |
54 | #
55 | # Dynamic Shared Object (DSO) Support
56 | #
57 | # To be able to use the functionality of a module which was built as a DSO you
58 | # have to place corresponding `LoadModule' lines at this location so the
59 | # directives contained in it are actually available _before_ they are used.
60 | # Statically compiled modules (those listed by `httpd -l') do not need
61 | # to be loaded here.
62 | #
63 | # Example:
64 | # LoadModule foo_module modules/mod_foo.so
65 | #
66 | LoadModule mpm_event_module modules/mod_mpm_event.so
67 | #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
68 | #LoadModule mpm_worker_module modules/mod_mpm_worker.so
69 | LoadModule authn_file_module modules/mod_authn_file.so
70 | #LoadModule authn_dbm_module modules/mod_authn_dbm.so
71 | #LoadModule authn_anon_module modules/mod_authn_anon.so
72 | #LoadModule authn_dbd_module modules/mod_authn_dbd.so
73 | #LoadModule authn_socache_module modules/mod_authn_socache.so
74 | LoadModule authn_core_module modules/mod_authn_core.so
75 | LoadModule authz_host_module modules/mod_authz_host.so
76 | LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
77 | LoadModule authz_user_module modules/mod_authz_user.so
78 | #LoadModule authz_dbm_module modules/mod_authz_dbm.so
79 | #LoadModule authz_owner_module modules/mod_authz_owner.so
80 | #LoadModule authz_dbd_module modules/mod_authz_dbd.so
81 | LoadModule authz_core_module modules/mod_authz_core.so
82 | #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
83 | #LoadModule authnz_fcgi_module modules/mod_authnz_fcgi.so
84 | LoadModule access_compat_module modules/mod_access_compat.so
85 | LoadModule auth_basic_module modules/mod_auth_basic.so
86 | #LoadModule auth_form_module modules/mod_auth_form.so
87 | #LoadModule auth_digest_module modules/mod_auth_digest.so
88 | #LoadModule allowmethods_module modules/mod_allowmethods.so
89 | #LoadModule isapi_module modules/mod_isapi.so
90 | #LoadModule file_cache_module modules/mod_file_cache.so
91 | #LoadModule cache_module modules/mod_cache.so
92 | #LoadModule cache_disk_module modules/mod_cache_disk.so
93 | #LoadModule cache_socache_module modules/mod_cache_socache.so
94 | #LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
95 | #LoadModule socache_dbm_module modules/mod_socache_dbm.so
96 | #LoadModule socache_memcache_module modules/mod_socache_memcache.so
97 | #LoadModule socache_redis_module modules/mod_socache_redis.so
98 | #LoadModule watchdog_module modules/mod_watchdog.so
99 | #LoadModule macro_module modules/mod_macro.so
100 | #LoadModule dbd_module modules/mod_dbd.so
101 | #LoadModule bucketeer_module modules/mod_bucketeer.so
102 | #LoadModule dumpio_module modules/mod_dumpio.so
103 | #LoadModule echo_module modules/mod_echo.so
104 | #LoadModule example_hooks_module modules/mod_example_hooks.so
105 | #LoadModule case_filter_module modules/mod_case_filter.so
106 | #LoadModule case_filter_in_module modules/mod_case_filter_in.so
107 | #LoadModule example_ipc_module modules/mod_example_ipc.so
108 | #LoadModule buffer_module modules/mod_buffer.so
109 | #LoadModule data_module modules/mod_data.so
110 | #LoadModule ratelimit_module modules/mod_ratelimit.so
111 | LoadModule reqtimeout_module modules/mod_reqtimeout.so
112 | #LoadModule ext_filter_module modules/mod_ext_filter.so
113 | #LoadModule request_module modules/mod_request.so
114 | #LoadModule include_module modules/mod_include.so
115 | LoadModule filter_module modules/mod_filter.so
116 | #LoadModule reflector_module modules/mod_reflector.so
117 | #LoadModule substitute_module modules/mod_substitute.so
118 | #LoadModule sed_module modules/mod_sed.so
119 | #LoadModule charset_lite_module modules/mod_charset_lite.so
120 | #LoadModule deflate_module modules/mod_deflate.so
121 | #LoadModule xml2enc_module modules/mod_xml2enc.so
122 | #LoadModule proxy_html_module modules/mod_proxy_html.so
123 | LoadModule mime_module modules/mod_mime.so
124 | #LoadModule ldap_module modules/mod_ldap.so
125 | LoadModule log_config_module modules/mod_log_config.so
126 | #LoadModule log_debug_module modules/mod_log_debug.so
127 | #LoadModule log_forensic_module modules/mod_log_forensic.so
128 | #LoadModule logio_module modules/mod_logio.so
129 | #LoadModule lua_module modules/mod_lua.so
130 | LoadModule env_module modules/mod_env.so
131 | #LoadModule mime_magic_module modules/mod_mime_magic.so
132 | #LoadModule cern_meta_module modules/mod_cern_meta.so
133 | #LoadModule expires_module modules/mod_expires.so
134 | LoadModule headers_module modules/mod_headers.so
135 | #LoadModule ident_module modules/mod_ident.so
136 | #LoadModule usertrack_module modules/mod_usertrack.so
137 | LoadModule unique_id_module modules/mod_unique_id.so
138 | LoadModule setenvif_module modules/mod_setenvif.so
139 | LoadModule version_module modules/mod_version.so
140 | #LoadModule remoteip_module modules/mod_remoteip.so
141 | #LoadModule proxy_module modules/mod_proxy.so
142 | #LoadModule proxy_connect_module modules/mod_proxy_connect.so
143 | #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
144 | #LoadModule proxy_http_module modules/mod_proxy_http.so
145 | #LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
146 | #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
147 | #LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so
148 | #LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
149 | #LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
150 | #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
151 | #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
152 | #LoadModule proxy_express_module modules/mod_proxy_express.so
153 | #LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so
154 | #LoadModule session_module modules/mod_session.so
155 | #LoadModule session_cookie_module modules/mod_session_cookie.so
156 | #LoadModule session_crypto_module modules/mod_session_crypto.so
157 | #LoadModule session_dbd_module modules/mod_session_dbd.so
158 | #LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
159 | #LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
160 | #LoadModule ssl_module modules/mod_ssl.so
161 | #LoadModule optional_hook_export_module modules/mod_optional_hook_export.so
162 | #LoadModule optional_hook_import_module modules/mod_optional_hook_import.so
163 | #LoadModule optional_fn_import_module modules/mod_optional_fn_import.so
164 | #LoadModule optional_fn_export_module modules/mod_optional_fn_export.so
165 | #LoadModule dialup_module modules/mod_dialup.so
166 | #LoadModule http2_module modules/mod_http2.so
167 | #LoadModule proxy_http2_module modules/mod_proxy_http2.so
168 | #LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
169 | #LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
170 | #LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
171 | #LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
172 | LoadModule unixd_module modules/mod_unixd.so
173 | #LoadModule heartbeat_module modules/mod_heartbeat.so
174 | #LoadModule heartmonitor_module modules/mod_heartmonitor.so
175 | #LoadModule dav_module modules/mod_dav.so
176 | LoadModule status_module modules/mod_status.so
177 | LoadModule autoindex_module modules/mod_autoindex.so
178 | #LoadModule asis_module modules/mod_asis.so
179 | #LoadModule info_module modules/mod_info.so
180 | #LoadModule suexec_module modules/mod_suexec.so
181 |
182 | #LoadModule cgid_module modules/mod_cgid.so
183 |
184 |
185 | #LoadModule cgi_module modules/mod_cgi.so
186 |
187 | #LoadModule dav_fs_module modules/mod_dav_fs.so
188 | #LoadModule dav_lock_module modules/mod_dav_lock.so
189 | #LoadModule vhost_alias_module modules/mod_vhost_alias.so
190 | #LoadModule negotiation_module modules/mod_negotiation.so
191 | LoadModule dir_module modules/mod_dir.so
192 | #LoadModule imagemap_module modules/mod_imagemap.so
193 | #LoadModule actions_module modules/mod_actions.so
194 | #LoadModule speling_module modules/mod_speling.so
195 | #LoadModule userdir_module modules/mod_userdir.so
196 | LoadModule alias_module modules/mod_alias.so
197 | #LoadModule rewrite_module modules/mod_rewrite.so
198 |
199 |
200 | #
201 | # If you wish httpd to run as a different user or group, you must run
202 | # httpd as root initially and it will switch.
203 | #
204 | # User/Group: The name (or #number) of the user/group to run httpd as.
205 | # It is usually good practice to create a dedicated user and group for
206 | # running httpd, as with most system services.
207 | #
208 | User daemon
209 | Group daemon
210 |
211 |
212 |
213 | # 'Main' server configuration
214 | #
215 | # The directives in this section set up the values used by the 'main'
216 | # server, which responds to any requests that aren't handled by a
217 | # definition. These values also provide defaults for
218 | # any containers you may define later in the file.
219 | #
220 | # All of these directives may appear inside containers,
221 | # in which case these default settings will be overridden for the
222 | # virtual host being defined.
223 | #
224 |
225 | #
226 | # ServerAdmin: Your address, where problems with the server should be
227 | # e-mailed. This address appears on some server-generated pages, such
228 | # as error documents. e.g. admin@your-domain.com
229 | #
230 | ServerAdmin you@example.com
231 |
232 | #
233 | # ServerName gives the name and port that the server uses to identify itself.
234 | # This can often be determined automatically, but we recommend you specify
235 | # it explicitly to prevent problems during startup.
236 | #
237 | # If your host doesn't have a registered DNS name, enter its IP address here.
238 | #
239 | #ServerName www.example.com:80
240 |
241 | #
242 | # Deny access to the entirety of your server's filesystem. You must
243 | # explicitly permit access to web content directories in other
244 | # blocks below.
245 | #
246 |
247 | AllowOverride none
248 | Require all denied
249 |
250 |
251 | #
252 | # Note that from this point forward you must specifically allow
253 | # particular features to be enabled - so if something's not working as
254 | # you might expect, make sure that you have specifically enabled it
255 | # below.
256 | #
257 |
258 | #
259 | # DocumentRoot: The directory out of which you will serve your
260 | # documents. By default, all requests are taken from this directory, but
261 | # symbolic links and aliases may be used to point to other locations.
262 | #
263 | DocumentRoot "/usr/local/apache2/htdocs"
264 |
265 | #
266 | # Possible values for the Options directive are "None", "All",
267 | # or any combination of:
268 | # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
269 | #
270 | # Note that "MultiViews" must be named *explicitly* --- "Options All"
271 | # doesn't give it to you.
272 | #
273 | # The Options directive is both complicated and important. Please see
274 | # http://httpd.apache.org/docs/2.4/mod/core.html#options
275 | # for more information.
276 | #
277 | Options Indexes FollowSymLinks
278 |
279 | #
280 | # AllowOverride controls what directives may be placed in .htaccess files.
281 | # It can be "All", "None", or any combination of the keywords:
282 | # AllowOverride FileInfo AuthConfig Limit
283 | #
284 | AllowOverride None
285 |
286 | #
287 | # Controls who can get stuff from this server.
288 | #
289 | Require all granted
290 |
291 |
292 | #
293 | # DirectoryIndex: sets the file that Apache will serve if a directory
294 | # is requested.
295 | #
296 |
297 | DirectoryIndex index.html
298 |
299 |
300 | #
301 | # The following lines prevent .htaccess and .htpasswd files from being
302 | # viewed by Web clients.
303 | #
304 |
305 | Require all denied
306 |
307 |
308 | #
309 | # ErrorLog: The location of the error log file.
310 | # If you do not specify an ErrorLog directive within a
311 | # container, error messages relating to that virtual host will be
312 | # logged here. If you *do* define an error logfile for a
313 | # container, that host's errors will be logged there and not here.
314 | #
315 | ErrorLog /proc/self/fd/2
316 |
317 | #
318 | # LogLevel: Control the number of messages logged to the error_log.
319 | # Possible values include: debug, info, notice, warn, error, crit,
320 | # alert, emerg.
321 | #
322 | LogLevel warn
323 |
324 |
325 | #
326 | # The following directives define some format nicknames for use with
327 | # a CustomLog directive (see below).
328 | #
329 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
330 | LogFormat "%h %l %u %t \"%r\" %>s %b" common
331 |
332 |
333 | # You need to enable mod_logio.c to use %I and %O
334 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
335 |
336 |
337 | #
338 | # The location and format of the access logfile (Common Logfile Format).
339 | # If you do not define any access logfiles within a
340 | # container, they will be logged here. Contrariwise, if you *do*
341 | # define per- access logfiles, transactions will be
342 | # logged therein and *not* in this file.
343 | #
344 | CustomLog /proc/self/fd/1 common
345 |
346 | #
347 | # If you prefer a logfile with access, agent, and referer information
348 | # (Combined Logfile Format) you can use the following directive.
349 | #
350 | #CustomLog "logs/access_log" combined
351 |
352 |
353 |
354 | #
355 | # Redirect: Allows you to tell clients about documents that used to
356 | # exist in your server's namespace, but do not anymore. The client
357 | # will make a new request for the document at its new location.
358 | # Example:
359 | # Redirect permanent /foo http://www.example.com/bar
360 |
361 | #
362 | # Alias: Maps web paths into filesystem paths and is used to
363 | # access content that does not live under the DocumentRoot.
364 | # Example:
365 | # Alias /webpath /full/filesystem/path
366 | #
367 | # If you include a trailing / on /webpath then the server will
368 | # require it to be present in the URL. You will also likely
369 | # need to provide a section to allow access to
370 | # the filesystem path.
371 |
372 | #
373 | # ScriptAlias: This controls which directories contain server scripts.
374 | # ScriptAliases are essentially the same as Aliases, except that
375 | # documents in the target directory are treated as applications and
376 | # run by the server when requested rather than as documents sent to the
377 | # client. The same rules about trailing "/" apply to ScriptAlias
378 | # directives as to Alias.
379 | #
380 | ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
381 |
382 |
383 |
384 |
385 | #
386 | # ScriptSock: On threaded servers, designate the path to the UNIX
387 | # socket used to communicate with the CGI daemon of mod_cgid.
388 | #
389 | #Scriptsock cgisock
390 |
391 |
392 | #
393 | # "/usr/local/apache2/cgi-bin" should be changed to whatever your ScriptAliased
394 | # CGI directory exists, if you have that configured.
395 | #
396 |
397 | AllowOverride None
398 | Options None
399 | Require all granted
400 |
401 |
402 |
403 | #
404 | # Avoid passing HTTP_PROXY environment to CGI's on this or any proxied
405 | # backend servers which have lingering "httpoxy" defects.
406 | # 'Proxy' request header is undefined by the IETF, not listed by IANA
407 | #
408 | RequestHeader unset Proxy early
409 |
410 |
411 |
412 | #
413 | # TypesConfig points to the file containing the list of mappings from
414 | # filename extension to MIME-type.
415 | #
416 | TypesConfig conf/mime.types
417 |
418 | #
419 | # AddType allows you to add to or override the MIME configuration
420 | # file specified in TypesConfig for specific file types.
421 | #
422 | #AddType application/x-gzip .tgz
423 | #
424 | # AddEncoding allows you to have certain browsers uncompress
425 | # information on the fly. Note: Not all browsers support this.
426 | #
427 | #AddEncoding x-compress .Z
428 | #AddEncoding x-gzip .gz .tgz
429 | #
430 | # If the AddEncoding directives above are commented-out, then you
431 | # probably should define those extensions to indicate media types:
432 | #
433 | AddType application/x-compress .Z
434 | AddType application/x-gzip .gz .tgz
435 |
436 | #
437 | # AddHandler allows you to map certain file extensions to "handlers":
438 | # actions unrelated to filetype. These can be either built into the server
439 | # or added with the Action directive (see below)
440 | #
441 | # To use CGI scripts outside of ScriptAliased directories:
442 | # (You will also need to add "ExecCGI" to the "Options" directive.)
443 | #
444 | #AddHandler cgi-script .cgi
445 |
446 | # For type maps (negotiated resources):
447 | #AddHandler type-map var
448 |
449 | #
450 | # Filters allow you to process content before it is sent to the client.
451 | #
452 | # To parse .shtml files for server-side includes (SSI):
453 | # (You will also need to add "Includes" to the "Options" directive.)
454 | #
455 | #AddType text/html .shtml
456 | #AddOutputFilter INCLUDES .shtml
457 |
458 |
459 | #
460 | # The mod_mime_magic module allows the server to use various hints from the
461 | # contents of the file itself to determine its type. The MIMEMagicFile
462 | # directive tells the module where the hint definitions are located.
463 | #
464 | #MIMEMagicFile conf/magic
465 |
466 | #
467 | # Customizable error responses come in three flavors:
468 | # 1) plain text 2) local redirects 3) external redirects
469 | #
470 | # Some examples:
471 | #ErrorDocument 500 "The server made a boo boo."
472 | #ErrorDocument 404 /missing.html
473 | #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
474 | #ErrorDocument 402 http://www.example.com/subscription_info.html
475 | #
476 |
477 | #
478 | # MaxRanges: Maximum number of Ranges in a request before
479 | # returning the entire resource, or one of the special
480 | # values 'default', 'none' or 'unlimited'.
481 | # Default setting is to accept 200 Ranges.
482 | #MaxRanges unlimited
483 |
484 | #
485 | # EnableMMAP and EnableSendfile: On systems that support it,
486 | # memory-mapping or the sendfile syscall may be used to deliver
487 | # files. This usually improves server performance, but must
488 | # be turned off when serving from networked-mounted
489 | # filesystems or if support for these functions is otherwise
490 | # broken on your system.
491 | # Defaults: EnableMMAP On, EnableSendfile Off
492 | #
493 | #EnableMMAP off
494 | #EnableSendfile on
495 |
496 | # Supplemental configuration
497 | #
498 | # The configuration files in the conf/extra/ directory can be
499 | # included to add extra features or to modify the default configuration of
500 | # the server, or you may simply copy their contents here and change as
501 | # necessary.
502 |
503 | # Server-pool management (MPM specific)
504 | #Include conf/extra/httpd-mpm.conf
505 |
506 | # Multi-language error messages
507 | #Include conf/extra/httpd-multilang-errordoc.conf
508 |
509 | # Fancy directory listings
510 | #Include conf/extra/httpd-autoindex.conf
511 |
512 | # Language settings
513 | #Include conf/extra/httpd-languages.conf
514 |
515 | # User home directories
516 | #Include conf/extra/httpd-userdir.conf
517 |
518 | # Real-time info on requests and configuration
519 | #Include conf/extra/httpd-info.conf
520 |
521 | # Virtual hosts
522 | #Include conf/extra/httpd-vhosts.conf
523 |
524 | # Local access to the Apache HTTP Server Manual
525 | #Include conf/extra/httpd-manual.conf
526 |
527 | # Distributed authoring and versioning (WebDAV)
528 | #Include conf/extra/httpd-dav.conf
529 |
530 | # Various default settings
531 | #Include conf/extra/httpd-default.conf
532 |
533 | # Configure mod_proxy_html to understand HTML4/XHTML1
534 |
535 | Include conf/extra/proxy-html.conf
536 |
537 |
538 | # Secure (SSL/TLS) connections
539 | #Include conf/extra/httpd-ssl.conf
540 | #
541 | # Note: The following must must be present to support
542 | # starting without SSL on platforms with no /dev/random equivalent
543 | # but a statically compiled-in mod_ssl.
544 | #
545 |
546 | SSLRandomSeed startup builtin
547 | SSLRandomSeed connect builtin
548 |
549 |
550 | ErrorLog /var/log/apache2/error.log
551 | LoadModule security2_module /usr/local/apache2/modules/mod_security2.so
552 | Include conf/extra/httpd-default.conf
553 |
554 | Include /etc/modsecurity.d/include.conf
555 |
556 | Include conf/extra/httpd-logging-after-modsec.conf
557 | ServerName ${SERVERNAME}
558 |
559 | Include conf/extra/httpd-proxy.conf
560 |
561 |
562 | # ------------------------------
563 | # HoneyTrap Changes
564 | # ------------------------------
565 | Listen 8000
566 | Listen 8080
567 | Listen 8888
568 |
569 | #Adding Support for robots.txt
570 |
571 | SetHandler None
572 | Require all granted
573 |
574 | #Alias /robots.txt /home/robots.txt
--------------------------------------------------------------------------------
/honeytraps/waf_modsec/include.conf:
--------------------------------------------------------------------------------
1 | include "/etc/modsecurity.d/modsecurity.conf"
2 | include /etc/modsecurity.d/owasp-crs/crs-setup.conf
3 | include /etc/modsecurity.d/owasp-crs/rules/*.conf
--------------------------------------------------------------------------------
/honeytraps/waf_modsec/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Login
5 |
6 |
7 | Add entry
8 | Add another Article
9 |
14 |
15 |
--------------------------------------------------------------------------------
/honeytraps/waf_modsec/login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Login
5 |
6 |
7 | Add entry
8 | Add another Article
9 |
10 |
15 |
16 |
--------------------------------------------------------------------------------
/honeytraps/waf_modsec/login.php:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 | Login
19 |
20 |
21 |
27 |
28 |
--------------------------------------------------------------------------------
/honeytraps/waf_modsec/modsec_entry.sh:
--------------------------------------------------------------------------------
1 | # ~/bin/sh
2 | apachectl
3 | python3 /app/preprocess-modsec-log.py &
4 | filebeat -e -c filebeat.yml -d "publish"
5 |
--------------------------------------------------------------------------------
/honeytraps/waf_modsec/modsecurity-extension.conf:
--------------------------------------------------------------------------------
1 | ## APPENDED TO THE END OF
2 | # /etc/modsecurity.d/modsecurity.conf
3 |
4 |
5 | SecAuditLogFormat JSON
6 | SecContentInjection On
7 | SecStreamOutBodyInspection On
8 |
9 | ##HONEYTRAP-1
10 |
11 | # # Generate Alerts for all requests that we receive and # set a variable in the IP Collection to mark the client # as malicious. #
12 | SecRule SERVER_PORT "^(8000|8080|8888)$" \
13 | "id:'999004',phase:2,t:none,log,block,msg:'HoneyTrap Alert: Traffic Received on Fake Port.',setvar:ip.malicious_client=1"
14 | ##HONEYTRAP-2
15 | #Fake robots.txt file
16 |
17 | SecRule REQUEST_FILENAME "@streq /robots.txt" \
18 | "id:'999005',phase:4,t:none,nolog,pass,append:'Disallow: /db_backup.%{time_epoch}/'"
19 |
20 | #Identifying the malicious client
21 |
22 | SecRule REQUEST_FILENAME "^/db_backup.\d{10}" "id:'999006',phase:1,t:none,log,block,msg:'HoneyTrap Alert: Disallowed robots.txt Entry Accessed.',logdata:'%{matched_var}',setvar:ip.malicious_client=1"
23 |
24 | #Setting the Fake Authentication
25 | SecRule REQUEST_FILENAME "^/db_backup.\d{10}" "id:'999011',phase:3,t:none,log,deny,status:401,msg:'HoneyTrapAlert:Disallowed robots.txt Entry Accessed.',logdata:'%{matched_var}',setvar:ip.malicious_client=1, setenv:basic_auth=1"
26 | Header always set WWW-Authenticate "Basic realm=\"Admin\"" env=basic_auth
27 |
28 | #For Decoding the Password given by the Hacker
29 | #we use following ruleset to extract and decode thecredentials.
30 |
31 | SecRule REQUEST_FILENAME "^/db_backup.\d{10}" "chain,id:'999012',phase:1,t:none,log,msg:'HoneyTrap Alert: Authentication Attempt to Fake Resource.',logdata:'Credentials used: %{matched_var}'"
32 |
33 | SecRule REQUEST_HEADERS:Authorization "^Basic (.*)" "chain,capture"
34 |
35 | SecRule TX:1 ".*" "t:base64Decode"
36 |
37 | ##HONEYTRAP-3
38 |
39 | ##We will add some fake HTML comments
40 | ##With this data, an attacker may be able to better plan and execute attacks against your web application
41 |
42 | SecRule REQUEST_FILENAME "@streq /login.html" "chain,id:'999007',phase:4,t:none,nolog,pass,setvar:'tx.form_comment_honeytrap=