2023-10-25 12:51:08 -04:00
|
|
|
# Iptables Log parser
|
2023-10-24 07:09:29 -04:00
|
|
|
|
2023-10-25 12:51:08 -04:00
|
|
|
## How To
|
|
|
|
|
|
|
|
### Build
|
|
|
|
|
|
|
|
```c=
|
|
|
|
mkdir lib
|
|
|
|
#Compile the library
|
|
|
|
make parse_lib.so
|
|
|
|
```
|
|
|
|
|
|
|
|
### Execute
|
|
|
|
|
|
|
|
```bash=
|
|
|
|
./wrapper.py
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
## Structure
|
2023-10-24 07:09:29 -04:00
|
|
|
|
|
|
|
### wrapper.py
|
|
|
|
|
2023-10-25 12:51:08 -04:00
|
|
|
Reads, iptables.log and calls the `lib/parser_lib.so`. Feed the parser library with lines from iptables log.
|
2023-10-24 07:09:29 -04:00
|
|
|
|
2023-10-25 12:51:08 -04:00
|
|
|
### lib/parser_lib.so
|
2023-10-24 07:09:29 -04:00
|
|
|
|
|
|
|
Process the sed like operation on the line by line feeded by `wrapper.py`.
|
2023-10-25 12:51:08 -04:00
|
|
|
|
|
|
|
Current parsed values are :
|
|
|
|
|
|
|
|
- Source IP
|
|
|
|
- Destination IP
|
|
|
|
- Packet Length
|
|
|
|
- Interface IN
|
|
|
|
- Interface OUT
|
|
|
|
- Protocol
|
|
|
|
|
|
|
|
|