利用tcpdump抓取mysql sql语句
来源:互联网 发布:矩阵奇艺是什么意思 编辑:程序博客网 时间:2024/05/17 04:25
这个脚本是我之前在网上无意间找个一个利用tcpdump 抓包工具获取mysql流量,并通过过滤把sql 语句输入。
脚本不是很长,但是效果很好。
#!/bin/bash#this script used montor mysql network traffic.echo sqltcpdump -i eth0 -s 0 -l -w - dst port 3306 | 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.=" $_"; }}'
下面是执行脚本的输出:
SELECT b.id FROM module as a,rights as b where a.id=b.module_id and b.sid='179' and a.pname like 'vip/member_order_manage.php%'SELECT count(id) as cc,sum(cash) as total from morder_stat_all where (ymd BETWEEN '1312214400' and '1312336486') and depart_id=5 and order_class=2select id,name from media where symd='0000-00-00'select id,name from depart where s_flag=' ' and onoff=1 order by snoselect id,name from plank where depart_id=5 and onoff=1 order by noselect id,name from grp where plank_id=0 and onoff=1 order by noselect id,CONCAT(pname,'-',name) as name from pvc order by pnameselect id,CONCAT(no,'-',name) as name from local where pvc_id=0 order by noselect id,name from product_breedselect color_name from product_color where id=5select id,name from product where id = '0'select * from morder_stat_all where (ymd BETWEEN '1312214400' and '1312336486') and depart_id=5 and order_class=2 order by ymd DESC LIMIT 0,50select urlkey from sys_config where id=1select name from morder where id=7195793select no,name from staff where id=5061select product_id,amt,price0 from order_product where order_id = 7195793select concat_ws('/',name,NULLIF((select color_name as cn from product_color where id=color_id),''),NULLIF((select style_name from product_style where id=style_id),'')) as name,spec,weight,price from product where id = 16938select concat_ws('/',name,NULLIF((select color_name as cn from product_color where id=color_id),''),NULLIF((select style_name from product_style where id=style_id),'')) as name,spec,weight,price from product where id = 19005select name from morder where id=7195768select no,name from staff where id=221select product_id,amt,price0 from order_product where order_id = 7195768select concat_ws('/',name,NULLIF((select color_name as cn from product_color where id=color_id),''),NULLIF((select style_name from product_style where id=style_id),'')) as name,spec,weight,price from product where id = 18978select concat_ws('/',name,NULLIF((select color_name as cn from product_color where id=color_id),''),NULLIF((select style_name from product_style where id=style_id),'')) as name,spec,weight,price from product where id = 18282select concat_ws('/',name,NULLIF((select color_name as cn from product_color where id=color_id),''),NULLIF((select style_name from product_style where id=style_id),'')) as name,spec,weight,price from product where id = 19740
从上面的日志可以看出,脚本的功能还是很强大吧 。
0 0
- 利用tcpdump抓取mysql sql语句
- 利用tcpdump抓取mysql sql语句
- 用Tcpdump抓取MySQL执行的SQL
- 用Tcpdump抓取MySQL执行的SQL
- 利用tcpdump抓取ios的tcp数据包
- 利用mysql客户端批量执行sql语句
- Android利用tcpdump和wireshark抓取网络数据包
- Android利用tcpdump和wireshark抓取网络数据包
- Android利用tcpdump和wireshark抓取网络数据包
- Android利用tcpdump和wireshark抓取网络数据包
- Android利用tcpdump和wireshark抓取网络数据包
- Android利用tcpdump和wireshark抓取网络数据包
- Android利用tcpdump和wireshark抓取网络数据包
- Android利用tcpdump和wireshark抓取网络数据包
- Android利用tcpdump和wireshark抓取网络数据包
- mysql perl 抓取update语句
- 利用MySQL命令执行文本文件中的所有SQL语句
- 如何利用Mysql命令行执行记事本中的SQL语句
- 小米的营销手段
- 用Jersey构建RESTful服务1--HelloWorld
- python爬虫
- ie9 提示'console' 未定义
- 直接拿来用!最火的Android开源项目(完结篇)
- 利用tcpdump抓取mysql sql语句
- 一步步学习SPD2010--第十章节--SP网站品牌化(10)--使用智能提示来增加CSS
- android IPC及原理简介
- 用Android-X86和VirtualBox打造高性能Android开发环境
- Binder基本概念流程学习
- 设计模式之Chain ofResponsibility -职责链
- 安装iTunes时出现安装回滚无法安装…
- 不能读取文件itunes library.…
- windows操作系统下不影响正常引导…