免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: 懒狒狒
打印 上一主题 下一主题

求教,刚接触perl 要做一个抓包分析 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2012-11-27 11:18 |只看该作者
{:3_186:} 公司就我一个perl哦回复 10# sjdy521


   

论坛徽章:
0
12 [报告]
发表于 2012-11-27 11:24 |只看该作者
二进制转文本 这个和perl有啥关系

论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
13 [报告]
发表于 2012-11-27 11:31 |只看该作者
回复 8# 懒狒狒

用 tcpdump的命令转呀. 那个需要 wincap的库的.
   

论坛徽章:
0
14 [报告]
发表于 2012-11-27 11:40 |只看该作者
嗯呐,谢谢了,我在查查文档看看怎么用的哈回复 13# q1208c


   

论坛徽章:
0
15 [报告]
发表于 2012-11-27 11:46 |只看该作者
回复 1# 懒狒狒


    tshark -r input
  1. -r <infile>              set the filename to read from (no pipes or stdin!)
复制代码

论坛徽章:
0
16 [报告]
发表于 2012-11-27 12:18 |只看该作者
嗯,也不算是吧,我们部门主要是分析当我们的服务器受到攻击的时候能快速的查询出自己想要的参数
回复 16# defendre


   

论坛徽章:
0
17 [报告]
发表于 2012-11-28 00:43 |只看该作者
本帖最后由 dsadjkasd 于 2012-11-28 00:45 编辑

你可以下个010editor帮助你进行16进制或者2进制数据的分析,但数据位数字符型之类都需要自己不断猜测揣摩出规律来,才能进行有效的解码数据成可读的东西。。。比如02FAF080表示50000000,当然你看16进制的时候这个数应该是“80 F0 FA 02”, 抓的包应该分析下报文,报头,需要参考下TCP 和UDP如何封装的。。。

论坛徽章:
42
19周年集字徽章-周
日期:2019-10-14 14:35:31平安夜徽章
日期:2015-12-26 00:06:30数据库技术版块每日发帖之星
日期:2015-12-01 06:20:002015亚冠之首尔
日期:2015-11-04 22:25:43IT运维版块每日发帖之星
日期:2015-08-17 06:20:00寅虎
日期:2014-06-04 16:25:27狮子座
日期:2014-05-12 11:00:00辰龙
日期:2013-12-20 17:07:19射手座
日期:2013-10-24 21:01:23CU十二周年纪念徽章
日期:2013-10-24 15:41:34IT运维版块每日发帖之星
日期:2016-01-27 06:20:0015-16赛季CBA联赛之新疆
日期:2016-06-07 14:10:01
18 [报告]
发表于 2012-11-28 08:23 |只看该作者
本帖最后由 laputa73 于 2012-11-29 10:08 编辑

那些二进制包是有协议的,不是简单的16进制转转就能识别的
所以tshark是必须的
http://www.wireshark.org/docs/ws ... AppToolstshark.html
  1. TShark 1.7.0 (SVN Rev 39165 from /trunk)
  2. Dump and analyze network traffic.
  3. See http://www.wireshark.org for more information.

  4. Copyright 1998-2011 Gerald Combs <gerald@wireshark.org> and contributors.
  5. This is free software; see the source for copying conditions. There is NO
  6. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  7. Usage: tshark [options] ...

  8. Capture interface:
  9.   -i <interface>           name or idx of interface (def: first non-loopback)
  10.   -f <capture filter>      packet filter in libpcap filter syntax
  11.   -s <snaplen>             packet snapshot length (def: 65535)
  12.   -p                       don't capture in promiscuous mode
  13.   -B <buffer size>         size of kernel buffer (def: 1MB)
  14.   -y <link type>           link layer type (def: first appropriate)
  15.   -D                       print list of interfaces and exit
  16.   -L                       print list of link-layer types of iface and exit

  17. Capture stop conditions:
  18.   -c <packet count>        stop after n packets (def: infinite)
  19.   -a <autostop cond.> ...  duration:NUM - stop after NUM seconds
  20.                            filesize:NUM - stop this file after NUM KB
  21.                               files:NUM - stop after NUM files
  22. Capture output:
  23.   -b <ringbuffer opt.> ... duration:NUM - switch to next file after NUM secs
  24.                            filesize:NUM - switch to next file after NUM KB
  25.                               files:NUM - ringbuffer: replace after NUM files
  26. Input file:
  27.   -r <infile>              set the filename to read from (no pipes or stdin!)

  28. Processing:
  29.   -2                       perform a two-pass analysis
  30.   -R <read filter>         packet filter in Wireshark display filter syntax
  31.   -n                       disable all name resolutions (def: all enabled)
  32.   -N <name resolve flags>  enable specific name resolution(s): "mntC"
  33.   -d <layer_type>==<selector>,<decode_as_protocol> ...
  34.                            "Decode As", see the man page for details
  35.                            Example: tcp.port==8888,http
  36. Output:
  37.   -w <outfile|->           write packets to a pcap-format file named "outfile"
  38.                            (or to the standard output for "-")
  39.   -C <config profile>      start with specified configuration profile
  40.   -F <output file type>    set the output file type, default is libpcap
  41.                            an empty "-F" option will list the file types
  42.   -V                       add output of packet tree        (Packet Details)
  43.   -O <protocols>           Only show packet details of these protocols, comma
  44.                            separated
  45.   -P                       print packets even when writing to a file
  46.   -S <separator>           the line separator to print between packets
  47.   -x                       add output of hex and ASCII dump (Packet Bytes)
  48.   -T pdml|ps|psml|text|fields
  49.                            format of text output (def: text)
  50.   -e <field>               field to print if -Tfields selected (e.g. tcp.port);
  51.                            this option can be repeated to print multiple fields
  52.   -E<fieldsoption>=<value> set options for output when -Tfields selected:
  53.      header=y|n            switch headers on and off
  54.      separator=/t|/s|<char> select tab, space, printable character as separator
  55.      occurrence=f|l|a      print first, last or all occurrences of each field
  56.      aggregator=,|/s|<char> select comma, space, printable character as
  57.                            aggregator
  58.      quote=d|s|n           select double, single, no quotes for values
  59.   -t ad|a|r|d|dd|e         output format of time stamps (def: r: rel. to first)
  60.   -u s|hms                 output format of seconds (def: s: seconds)
  61.   -l                       flush standard output after each packet
  62.   -q                       be more quiet on stdout (e.g. when using statistics)
  63.   -X <key>:<value>         eXtension options, see the man page for details
  64.   -z <statistics>          various statistics, see the man page for details

  65. Miscellaneous:
  66.   -h                       display this help and exit
  67.   -v                       display version info and exit
  68.   -o <name>:<value> ...    override preference setting
  69.   -K <keytab>              keytab file to use for kerberos decryption
  70.   -G [report]              dump one of several available reports and exit
  71.                            default report="fields"
  72.                            use "-G ?" for more help
复制代码

论坛徽章:
0
19 [报告]
发表于 2012-11-28 12:56 |只看该作者
LZ这个工作做好了吗?我也想做类似的事情,一起交流哈

论坛徽章:
0
20 [报告]
发表于 2012-11-29 15:24 |只看该作者
这个工作鄙人早年做过分析cap的包话先用wireshark转成xls,在转成txt,然后在分析。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP