SIP对话框检查实用程序(以前称为SIPCAParseye)

sipzamine的Python项目详细描述


命令行SIP对话框匹配和通过脱机PCAP搜索。

pypi_version

安装

$ sudo apt-get install python-libpcap  # or yum install..
$ sudo pip install sipzamine

示例

一个基本示例,查找所有持续时间短于1.5秒的对话框:

$ sipzamine -m ^BYE -H ^BYE --maxdur 1.5 --pcap 'host 22.22.22.22' stored.pcap
[ 179978155f707e3622c0886752336210@22.22.22.22 ]
2011-11-23 22:27:20.746782 22.22.22.22:5060 > 123.123.123.123:5060 102 INVITE
2011-11-23 22:27:20.747508 123.123.123.123:5060 > 22.22.22.22:5060 102 INVITE(100)
2011-11-23 22:27:20.783424 123.123.123.123:5060 > 22.22.22.22:5060 102 INVITE(200)
2011-11-23 22:27:20.783956 22.22.22.22:5060 > 123.123.123.123:5060 102 ACK
2011-11-23 22:27:21.665581 22.22.22.22:5060 > 123.123.123.123:5060 103 BYE <--
2011-11-23 22:27:21.665721 123.123.123.123:5060 > 22.22.22.22:5060 103 BYE(200)

命令选项

通常使用-m通过正则表达式匹配对话框。和-p 按IP过滤。

要突出显示简明输出中的特定文本字符串,请使用-H

基本匹配选项:

--pcap filter, -p filter
    pcap filter expression
--pmatch regex, -m regex
    any packet in dialog must match regex (can be used
    multiple times), e.g. ^INVITE to match calls
--amatch regex, -M regex
    all packets in dialog must match regex (can be used
    multiple times), e.g. ^(SIP/2.0|INVITE|BYE) to match
    calls without an ACK

输出选项:

--contents
    show complete packet contents
--dateskew seconds
    offset added to all dates, can be negative (use when
    pcap clock was off)
--highlight regex, -H regex
    highlight first matchgroup in packets (multiple
    highlights are identified by letters a..z)

特殊对话/数据包匹配选项:

--mindate date
    packets must be younger than specified date
--maxdate date
    packets must be older than specified date
--mindur seconds
    dialogs/transactions must be shorter than duration
--maxdur seconds
    dialogs/transactions must be longer than duration
--retransmits count
    at least count retransmits must be involved

待办事项

  • 添加测试:从一个小的pcap开始。
  • 添加从筛选器写入PCAP的功能。联合收割机能力 用小吸盘?
  • 将此与sipgrep(和其他工具)进行比较?那荷马呢?

问答

如何获取pcap文件?

You’re encouraged to always write SIP pcaps on your VoIP machine. tcpdump allows you easy rotation of pcaps so you won’t run out of disk space. You can use the tcpdump247 init script if you like.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在JScrollPane标题中禁用鼠标滚轮滚动?   java如何为篮球计分器应用程序存储包括球队名称在内的比赛分数?   java如何使用ADT接口实例化列表   JavaCV抓取帧方法延迟并返回旧帧   java在上传文件时处理网络问题   java如何创建2d阵列的克隆?   关于XMLGregorianCalendar的java信息   java XmlUnit在比较XML文件时忽略元素的顺序   java如何最好地检测无意义的文本?   克隆如何制作java扫描仪的副本?   验证Java中空值的BigDecimal数据类型   java字符串数组中的字数   java JavaFX:如何选择平铺并添加数字和边框线?   java更改jtable中从jar文件获取的特定行的颜色   正则表达式Java字符串。拆分:将\\W用作非单词分隔符时出现问题   当内存损坏时,Java中的同一引用/实例变量会发生什么变化?   java无法在Javadoc注释中链接到JDK10