Below you will find pages that utilize the taxonomy term “抓包”
May 28, 2016
利用tcpdump抓取MySQL执行的SQL
"http://ourmysql.com/archives/1358 编写脚本文件dumpsql.sh,内容如下:\n#!/bin/bash #this script used montor mysql network traffic.echo sql tcpdump -i eth0 -s 0 -l -w - dst port 3306 | strings | perl -e \u0026#39; while(\u0026lt;\u0026gt;) { chomp; next if /^[^ ]+[ ]*$/; if(/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER|CALL)/i) { if (defined $q) { print \u0026#34;$q\\n\u0026#34;; } $q=$_; } else { $_ =~ s/^[ \\t]+//; $q.=\u0026#34; $_\u0026#34;; } } 运行并抓去sql的执行。\n抓取后在当前目录出现out.log文件,执行strings out.log即可看到sql的运行情况"