Closed RMerl closed 12 years ago
I already wrote a shell-based proof-of-concept script (interfaced through var_dump("","../path/this_script") ):
echo -e "proto \t Source \t Port \t Destination \t Port \t bytes"
echo "===================================================="
cat /proc/net/nf_conntrack | grep "tcp" | awk '{print $3 "\t" substr($7,5) "\t" substr($9,7) "\t" substr($8,5) "\t" substr($10,7) "\t" substr($12,7)}' | sort
cat /proc/net/nf_conntrack | grep "udp" | awk '{print $3 "\t" substr($6,5) "\t" substr($8,7) "\t" substr($7,5) "\t" substr($9,7) "\t" substr($11,7)}' | sort
This works, but is a bit too hackish to be released like this. A new ej_dump_conntrack() function should be added to httpd/web.c, along with a new ej event. And rewrite those awk commands in C (or add this awk-based script to the firmware, and call it)
Implemented, commit fb3c7716685453cb6e79c0929391e34bb4f046e1. A script-based method was used to reduce the amount of binary-level changes to Asus's code.
Add a web page that displays currently established connections. Something similar to what is accomplished with this simple script: