norstalgia/fake_alert.py

3 lines
2.2 KiB
Python

import httpx
httpx.post("http://127.0.0.1:9999", data='[{"capacity":1,"decisions":[{"duration":"24h","origin":"crowdsec","scenario":"crowdsecurity/http-bad-user-agent","scope":"Ip","type":"ban","value":"208.127.89.241"}],"events":[{"meta":[{"key":"ASNNumber","value":"19817"},{"key":"ASNOrg","value":"DSL Extreme"},{"key":"IsInEU","value":"false"},{"key":"IsoCode","value":"US"},{"key":"SourceRange","value":"208.127.0.0/16"},{"key":"datasource_path","value":"/var/log/nginx/access.log"},{"key":"datasource_type","value":"file"},{"key":"http_path","value":"/"},{"key":"http_status","value":"200"},{"key":"http_user_agent","value":"Nmap"},{"key":"http_verb","value":"GET"},{"key":"log_type","value":"http_access-log"},{"key":"service","value":"http"},{"key":"source_ip","value":"208.127.89.241"},{"key":"timestamp","value":"2022-08-07T13:33:42Z"}],"timestamp":"2022-08-07T13:33:42Z"},{"meta":[{"key":"ASNNumber","value":"19817"},{"key":"ASNOrg","value":"DSL Extreme"},{"key":"IsInEU","value":"false"},{"key":"IsoCode","value":"US"},{"key":"SourceRange","value":"208.127.0.0/16"},{"key":"datasource_path","value":"/var/log/nginx/access.log"},{"key":"datasource_type","value":"file"},{"key":"http_path","value":"/"},{"key":"http_status","value":"200"},{"key":"http_user_agent","value":"Nmap"},{"key":"http_verb","value":"GET"},{"key":"log_type","value":"http_access-log"},{"key":"service","value":"http"},{"key":"source_ip","value":"208.127.89.241"},{"key":"timestamp","value":"2022-08-07T13:33:42Z"}],"timestamp":"2022-08-07T13:33:42Z"}],"events_count":2,"labels":null,"leakspeed":"1m0s","machine_id":"cdc028b6ed9949249b893deb59b3b0acMt6eX9sLpNW0HLmG","message":"Ip 208.127.89.241 performed \'crowdsecurity/http-bad-user-agent\' (2 events over 24.646533ms) at 2022-08-07 13:33:42.761890255 +0000 UTC","remediation":true,"scenario":"crowdsecurity/http-bad-user-agent","scenario_hash":"51360ad64c9672e5d3ba9c1786e6fc380c8752871a977a5dddac0d08551aa66a","scenario_version":"0.7","simulated":false,"source":{"as_name":"DSL Extreme","as_number":"19817","cn":"US","ip":"208.127.89.241","latitude":33.9571,"longitude":-118.4041,"range":"208.127.0.0/16","scope":"Ip","value":"208.127.89.241"},"start_at":"2022-08-07T13:33:42.737244995Z","stop_at":"2022-08-07T13:33:42.761891528Z"}]')