zoukankan      html  css  js  c++  java
  • Linux环境下使用tcpdump抓包与下载

    (1)报文抓取

    tcpdump -i eno5 host 10.8.12.154 -w /test.cap

    -i:抓取的网卡

    host:目的地址

    -w:生成的文件存放路径

    Ctrl+c 结束抓包,抓取的报文存放在/的test.cap下

    (2)报文获取

    方法1:使用scp命令,将当前设备上/root下的set_fxs_port.cap文件传输到IP为10.8.12.90设备/mnt/hfs1目录下

    [root@genewDB ~]# ll
    total 20
    -rw-r--r--  1 tcpdump tcpdump   24 Sep  7 08:17 B1205F.pcap
    drwxr-xr-x  2 root    root       6 May  6 22:19 Desktop
    drwxr-xr-x  2 root    root       6 May  6 22:19 Documents
    drwxr-xr-x  2 root    root       6 May  6 22:19 Downloads
    drwxr-xr-x  2 root    root       6 May  6 22:19 Music
    drwxrwxr-x  3 root    root      19 Aug  9 11:38 Netman4000
    drwxr-xr-x. 3 root    root      17 May  4 08:50 Orgin_file
    drwxr-xr-x  2 root    root       6 May  6 22:19 Pictures
    drwxr-xr-x  2 root    root       6 May  6 22:19 Public
    -rw-r--r--  1 tcpdump tcpdump 1501 Sep 11 06:07 set_fxs_port.cap
    -rw-r--r--  1 tcpdump tcpdump  512 Sep 11 06:03 set+fxs_port.cap
    drwxr-xr-x  2 root    root       6 May  6 22:19 Templates
    -rw-r--r--  1 tcpdump tcpdump 7167 Aug 17 18:15 tongji.cap
    drwxr-xr-x  2 root    root       6 May  6 22:19 Videos
    [root@genewDB ~]# pwd
    /root
    [root@genewDB ~]# scp /root/set_fxs_port.cap root@10.8.12.90:/mnt/hfs1/set_fxs_port.cap
    root@10.8.12.90's password: 
    set_fxs_port.cap                                                                         100% 1501     1.5KB/s   00:00

    方法2:使用SSH Secure File Transfer Client下载到本地;

  • 相关阅读:
    面试笔记1
    Hello World!!
    百度地图API JavaScript显示人员分布信息
    MUI Picker选择器 自定义省市地址三级联动
    【Unity】Lua热重载
    【临时存放】变量配置
    SVN代码管理出现注册错误
    javaweb学习
    微信应用号(微信小程序)开发教程
    shell脚本时间运算
  • 原文地址:https://www.cnblogs.com/lujingxia/p/10765395.html
Copyright © 2011-2022 走看看