Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- intf=$1
- port=$2
- if [ -z "${intf}" ]; then
- intf="eth0"
- fi
- if [ -z "${port}" ]; then
- port="3306"
- fi
- tcpdump -i ${intf} -s 0 -l -w - dst port ${port} | strings | perl -e '
- while(<>) { chomp; next if /^[^ ]+[ ]*$/;
- if(/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER|CALL)/i)
- {
- if (defined $q) { print "$q\n"; }
- $q=$_;
- } else {
- $_ =~ s/^[ \t]+//; $q.=" $_";
- }
- }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement