TCPDUMP

capture network traffic on two different ports simultaneously

对着背影说爱祢 提交于 2020-01-02 07:13:09
问题 I wish to capture tcpdump traffic on two different ports simultaneouly . I tried this .. $ tcpdump port 21 ; tcpdump port 22 Althoug it worked but problem is first it will wait for traffic on port 21 and when interrupted then it will wait for port 22. Also another problem is it will not capture the traffic on port 22 untill traffic on port 21 will be captured. I want an order free solution means in whatever order packet arrives if they are for port 21 or 22 they should be captured . Please

Plot RTT histogram using wireshark or other tool

不问归期 提交于 2020-01-01 03:20:55
问题 I have a little office network and I'm experiencing a huge internet link latency. We have a simple network topology: a computer configured as router running ubuntu server 10.10, 2 network cards (one to internet link, other to office network) and a switch connecting 20 computers. I have a huge tcpdump log collected at the router and I would like to plot a histogram with the RTT time of all TCP streams to try to find out the best solution to this latency problem. So, could somebody tell me how

Sniffing and displaying TCP packets in UTF-8

柔情痞子 提交于 2020-01-01 03:17:07
问题 I am trying to use tcpdump to display the content of tcp packets flowing on my network. I have something like: tcpdump -i wlan0 -l -A The -A option displays the content as ASCII text, but my text seems to be UTF-8. Is there a way to display UTF-8 properly using tcpdump? Do you know any other tools which could help? Many thanks 回答1: Make sure your terminal supports outputting UTF-8 and pipe the output to something which replaces non printable characters: tcpdump -lnpi lo tcp port 80 -s 16000

Understanding Tcpdump filter & bit-masking

↘锁芯ラ 提交于 2020-01-01 03:03:20
问题 I am trying to sniff the http headers by using tcpdump. This filter works well but I can't understand it - (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0) I've googled it but I can't find any useful info Here is the whole tcpdump command sudo tcpdump -A 'dst [dest host] or src [src host] and tcp and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i eth0 回答1: It's not the BPF filter that gets http headers but the "-A" switch on your tcpdump command. Your tcpdump

用Python开发MySQL增强半同步BinlogServer(T3实战篇)

别来无恙 提交于 2019-12-30 11:57:20
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 导读 : 作者:曾永伟,知数堂10期学员,多年JAVA物流行业开发管理经验和PHP/Python跨境电商开发管理经验,对数据库系统情有独钟,善于运用SQL编程简化业务逻辑,去年开始正式从业MySQL DBA, 专注于DB系统自动化运维、MySQL云上实践。 一、概述 通过前两篇的基础,我们已经能够深入理解二进制与MySQL的协议关系了,并且能够结合自己的需求,从官方文档找出相应的文档来实现自己的功能,希望大家鱼渔双收。 需要特别强调的是,通过文中的例子和思路,要学会把一个复杂的问题进行以拆分,细化成一个一个的小任务后再逐个去实现,特别是对接触编码不久的同学特别重要,从Hello World模式开始编码在任何阶段都适用(它是一个最小无依赖的可执行单元),因为它能排除众多干扰项,让你可以专注自己的小目标进行编码和测试。 目前我们已经能够用Socket和MySQL进行基本通信了,也能够处理Binlog文件的Event了,离我们的BinlogServer仅有一步之遥了,这一步就是通过Socket读取Binlog Event并保存到本地。 这一篇之所以叫实战篇,就是希望你不要停在只看不练的阶段,这里再重提一下基础篇的要点: 只有会认真看文档的DBA才是好DBA,只会认真看代码的Engineer,一定不是好Engineer

Linux 中延时/丢包模拟

♀尐吖头ヾ 提交于 2019-12-29 21:23:08
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Linux 中延时模拟 设置延时 3s : tc qdisc add dev eth0 root netem delay 3000ms 可以在 3000ms 后面在加上一个延时,比如 ’3000ms 200ms‘表示 3000ms ± 200ms ,延时范围 2800 – 3200 之间. Linux 中丢包模拟 设置丢包 50% ,iptables 也可以模拟这个,但一下不记的命令了,下次放上来: tc qdisc change dev eth0 root netem loss 50% 上面的设丢包,如果给后面的 50% 的丢包比率修改成 ’50% 80%’ 时,这时和上面的延时不一样,这是指丢包比率为 50-80% 之间。 来源: oschina 链接: https://my.oschina.net/u/1437015/blog/643673

网络抓包工具

烂漫一生 提交于 2019-12-26 19:08:00
一 tcpdump抓包命令 tcpdump 选项 过滤条件 选项 作用 -i 指定监控的网络接口 -A 转换为ACSII码,以方便阅读 -w 将数据包信息保存到指定文件 -r 从指定文件读取数据包信息 -c 定义抓包个数 tcpdump的过滤条件 类型: host net port portrange 方向: src dst 协议: tcp udp ip wlan arp 多个条件组合: and or not 二 wireshark协议分析器 一款与tcpdump类似的抓包工具,需要图形环境 官网是http://www.wireshark.org/ 1 安装软件包 yum -y install wireshark yum -y install wireshark-gnome 命令行键入wireshark进入软件 来源: CSDN 作者: 你的男孩TT 链接: https://blog.csdn.net/wangteng19931203/article/details/103716176

网站安全测试对流量嗅探讲解

ε祈祈猫儿з 提交于 2019-12-26 10:40:38
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在浩瀚的网络中安全问题是最普遍的需求,很多想要对网站进行渗透测试服务的,来想要保障网站的安全性防止被入侵被攻击等问题,在此我们Sine安全整理了下在渗透安全测试中抓包分析以及嗅探主机服务类型,以及端口扫描等识别应用服务,来综合评估网站安全。 8.2.1. TCPDump TCPDump是一款数据包的抓取分析工具,可以将网络中传送的数据包的完全截获下来提供分析。它支持针对网络层、协议、主机、网络或端口的过滤,并提供逻辑语句来过滤包。 8.2.1.1. 命令行常用选项 -B <buffer_size> 抓取流量的缓冲区大小,若过小则可能丢包,单位为KB -c <count> 抓取n个包后退出 -C <file_size> 当前记录的包超过一定大小后,另起一个文件记录,单位为MB -i <interface> 指定抓取网卡经过的流量 -n 不转换地址 -r <file> 读取保存的pcap文件 -s <snaplen> 从每个报文中截取snaplen字节的数据,0为所有数据 -q 输出简略的协议相关信息,输出行都比较简短。 -W <cnt> 写满cnt个文件后就不再写入 -w <file> 保存流量至文件 按时间分包时,可使用strftime的格式命名,例如 %Y_%m_%d_%H_%M_%S.pcap -G

安全牛-工具

微笑、不失礼 提交于 2019-12-25 13:45:16
常用用工工具 经常使用用且功能强大大 安全从业者必不可少的帮手手 Nc / ncat Wireshark Tcpdump NETCAT ——NC 网络工具中的瑞士军刀——小身身材、大大智慧 侦听模式 / 传输模式 telnet / 获取banner信息 传输文本信息 传输文件/目录 加密传输文件 远程控制/木⻢ 加密所有流量 流媒体服务器 远程克隆硬盘 NC——TELNET / BANNER(作为客户端) nc –nv 1.1.1.1 110 nc –nv 1.1.1.1 25 nc –nv 1.1.1.1 80 举例 1.连接邮件服务器端口 nc -vn 123.125.50.134 110 2.连接http nc –nv ip 80 NC——传输文本信息 A: nc -l -p 4444(服务端开启端口) netstat -pantu | grep 4444 B: nc –nv ip 4444(客户端连接) NC——远程电子取证信息收集 a: nc -l -p 4444 b: ls -l | nc -nv ip 4444 a: nc -l -p 4444 > ps.txt b: ps aux | nc -nv ip 4444 -q 1(q执行完成之后延迟1s自动退出) NC——传输文件/目录 1.传输文文件(注意文件的帧听端口与文件的传输方向) A:nc -lp 333 > 1

Rebuilding a packet to inject via pcap

送分小仙女□ 提交于 2019-12-24 11:04:28
问题 Here is the situation: in my scenario I have, 3 computers, A, B and C. Computer A sends data to computer B. Computer B captures these packets with pcap, appends the headers, redoes the checksums, and injects it out another ethernet interface to computer C. So basically A sends to C, though through C's point of view, the data is coming from computer B. My problem is this: following TCPDUMP's tutorial on dissecting a captured packet, I've learned to calculate offsets and using typecasting to