-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
25 lines (18 loc) · 676 Bytes
/
main.py
File metadata and controls
25 lines (18 loc) · 676 Bytes
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
from src.logger import setup_logger
from src.sniffer import NetworkSniffer
def main() -> None:
"""
Entry point for the IDS engine.
Initializes the sniffer and starts packet capture. The interface is set
to None so Scapy automatically selects the active network adapter.
Run with administrator / root privileges — raw packet capture requires it.
"""
logger = setup_logger("IDS_MAIN")
logger.info("Custom Network IDS/IPS starting...")
sniffer = NetworkSniffer(interface=None)
try:
sniffer.start(packet_count=0)
except Exception as e:
logger.critical(f"System crash: {e}")
if __name__ == "__main__":
main()