流量取证-流量中提取文件

摘要:
适当的最大值)-pdon’captureinpromiscousmode-kstartcapturingimmediate(def:-ctopafterpackets(def:infinite)-a。。。持续时间:NUM停止NUMfiles捕获输出:-b。。。持续时间:

以前整理的一些东西,拿出来做备忘

PCAP 报文就是抓取实际在网络中传输的图片,视频等数据,然后以PCAP 格式存储形成的文件。工作中对离线的数据包进行回溯分析,有时会遇到将 PCAP 中的码流还原成相应的图片、视频、邮件等原有格式的需求。

从流量中取证文件大部分情况下是为了提取流量中的可执行程序。

1、 tcpxtract
安装:
apt-get install tcpxtract
http://www.rpmfind.net/linux/rpm2html/search.php?query=tcpxtract # 下载对应版本

查看帮助:
root@kali:~# tcpxtract -h
Usage: tcpxtract [OPTIONS] [[-d ] [-f ]]
Valid options include:
--file, -f to specify an input capture file instead of a device 指定输入捕获文件
--device, -d to specify an input device (i.e. eth0) 指定输入设备(即eth0)
--config, -c use FILE as the config file 使用FILE作为配置文件
--output, -o dump files to DIRECTORY instead of current directory 将文件转储
--version, -v display the version number of this program
--help, -h display this lovely screen

下载 pcap 流量包:
wget http://forensicscontest.com/contest01/evidence01.pcap
流量取证-流量中提取文件第1张

查看要恢复的文件:
tcpxtract -f evidence01.pcap
流量取证-流量中提取文件第2张

查看恢复后的文件
流量取证-流量中提取文件第3张

打开文件:
leafpad 00000042.html
流量取证-流量中提取文件第4张
流量取证-流量中提取文件第5张

2、 NetworkMiner
安装 NetworkMiner:
http://sourceforge.net/projects/networkminer/files/latest/download 下载
或者
https://nchc.dl.sourceforge.net/project/networkminer/networkminer/NetworkMiner-1.6.1/NetworkMiner_1-6-1.zip

打开 PCAP 文件
流量取证-流量中提取文件第6张

查看提取出来的文件
流量取证-流量中提取文件第7张

3、wireshark 还原文件
查看帮助
root@kali:~# wireshark -h
Wireshark 2.6.6 (Git v2.6.6 packaged as 2.6.6-1)
Interactively dump and analyze network traffic.
See https://www.wireshark.org for more information.

Usage: wireshark [options] ... [ ]

Capture interface:
-i name or idx of interface (def: first non-loopback)
-f packet filter in libpcap filter syntax
-s packet snapshot length (def: appropriate maximum)
-p don't capture in promiscuous mode
-k start capturing immediately (def: do nothing)
-S update packet display when new packets are captured
-l turn on automatic scrolling while -S is in use
-I capture in monitor mode, if available
-B size of kernel buffer (def: 2MB)
-y link layer type (def: first appropriate)
--time-stamp-type timestamp method for interface
-D print list of interfaces and exit
-L print list of link-layer types of iface and exit
--list-time-stamp-types print list of timestamp types for iface and exit

Capture stop conditions:
-c stop after n packets (def: infinite)
-a ... duration:NUM - stop after NUM seconds
filesize:NUM - stop this file after NUM KB
files:NUM - stop after NUM files
Capture output:
-b ... duration:NUM - switch to next file after NUM secs
filesize:NUM - switch to next file after NUM KB
files:NUM - ringbuffer: replace after NUM files
Input file:
-r set the filename to read from (no pipes or stdin!)

Processing:
-R packet filter in Wireshark display filter syntax
-n disable all name resolutions (def: all enabled)
-N enable specific name resolution(s): "mnNtdv"
-d <layer_type>,<decode_as_protocol> ...
"Decode As", see the man page for details
Example: tcp.port
8888,http
--enable-protocol <proto_name>
enable dissection of proto_name
--disable-protocol <proto_name>
disable dissection of proto_name
--enable-heuristic <short_name>
enable dissection of heuristic protocol
--disable-heuristic <short_name>
disable dissection of heuristic protocol

User interface:
-C start with specified configuration profile
-Y start with the given display filter
-g go to specified packet number after "-r"
-J jump to the first packet matching the (display)
filter
-j search backwards for a matching packet after "-J"
-m set the font name used for most text
-t a|ad|d|dd|e|r|u|ud output format of time stamps (def: r: rel. to first)
-u s|hms output format of seconds (def: s: seconds)
-X : eXtension options, see man page for details
-z show various statistics, see man page for details

Output:
-w <outfile|-> set the output filename (or '-' for stdout)

Miscellaneous:
-h display this help and exit
-v display version info and exit
-P : persconf:path - personal configuration files
persdata:path - personal data files
-o : ... override preference or recent setting
-K keytab file to use for kerberos decryption
--display=DISPLAY X display to use
--fullscreen start Wireshark in full screen

打开pcap文件:
wireshark evidence01.pcap
流量取证-流量中提取文件第8张

查看还原文件:
文件--》导出对象--》HTTP
流量取证-流量中提取文件第9张

查看PE文件
file * | grep PE
流量取证-流量中提取文件第10张

  1. foremost
    kali 2.0 默认安装

查看帮助
root@kali:~# foremost -h
foremost version 1.5.7 by Jesse Kornblum, Kris Kendall, and Nick Mikus.
$ foremost [-v|-V|-h|-T|-Q|-q|-a|-w-d] [-t ] [-s ] [-k ]
[-b ] [-c ] [-o

] [-i <file]

-V - display copyright information and exit
-t - specify file type. (-t jpeg,pdf ...)
-d - turn on indirect block detection (for UNIX file-systems)
-i - specify input file (default is stdin)
-a - Write all headers, perform no error detection (corrupted files)
-w - Only write the audit file, do not write any detected files to the disk
-o - set output directory (defaults to output)
-c - set configuration file to use (defaults to foremost.conf)
-q - enables quick mode. Search are performed on 512 byte boundaries.
-Q - enables quiet mode. Suppress output messages.
-v - verbose mode. Logs all messages to screen

还原文件

foremost -v -i evidence01.pcap
流量取证-流量中提取文件第11张
流量取证-流量中提取文件第12张
流量取证-流量中提取文件第13张

5、Chaosreader

下载 chaosreader

wget https://github.com/brendangregg/Chaosreader/archive/master.zip
流量取证-流量中提取文件第14张

mv master.zip chaosreader.zip
unzip chaosreader.zip
流量取证-流量中提取文件第15张

还原文件:
root@kali:~# cd Chaosreader-master
root@kali:~/Chaosreader-master# ls
chaosreader older_versions README.md
流量取证-流量中提取文件第16张
流量取证-流量中提取文件第17张

查看PE文件:
file * | grep PE

参考文档
http://blog.sina.com.cn/s/blog_e8e60bc00102vfd9.html
http://www.behindthefirewalls.com/2014/01/extracting-files-from-network-traffic-pcap.html
http://www.blackbytes.info/2012/01/four-ways-to-extract-files-from-pcaps/

免责声明:文章转载自《流量取证-流量中提取文件》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇浅析Java8新特性-Stream流操作:Stream概念、常见中间/终止操作符、创建stream的3种方式、串行流/并行流的区分、使用示例(遍历/匹配、过滤、聚合、映射、归约、归集、统计、分区分组、接合、排序、组合/提取、分页、并行、集合转Map、使用并行流注意点)DB2函数——-ROW_NUMBER() OVER()函数用法下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

微信默认表情符号的代码对照表

之前有不少朋友问我,微信公众平台如何发带有表情符号的图片,其实只需要在信息里面插入表情代码就可以使用的。 微信表情对照表如下: 表情图片 字符串代码 替换关键字 /::) 微笑 /::~ 伤心 /::B 美女 /::| 发呆 /:8-) 墨镜 /::< 哭 /::$ 羞 /::X 哑 /::...

Spring RestTemplate简介及使用

Spring RestTemplate介绍 1、springRestTemplate 简介 spring 提供的同步请求Rest服务的客户端,RestTemplate提供了多种便捷访问远程Http服务的方法,能够大大提高客户端的编写效率。 是Spring用于同步client端的核心类,简化了与http服务的通信,并满足RestFul原则,程序代码可以给它提...

Installshield 2010 中集成. Net framework4 与 vc++ 2010运行安装包

1、prq的地址,通过以下地址,下载相应的prq文件     VC 2010 redist X86: http://saturn.installshield.com/is/prerequisites/microsoft visual c++ 2010 redistributable package (x86).prq VC 2010 redist X8...

win10安装mysql5.7.29教程以及错误处理

重新配了一台电脑,装了win10系统,安装mysql是出现了一些问题以及解决的方法。记录于此,避免下次安装遇到重复问题。 首先下载mysql5.7.29安装包,本次使用的是zip。已保存在百度网盘 链接:https://pan.baidu.com/s/1y8aahxloQEJTGXqmd95xsg 提取码:e3c6 也可以自己去官网下载: 下载地址:  h...

富文本编辑器-Ueditor

    富文本编辑器,Rich Text Editor, 简称 RTE, 它提供类似于 Microsoft Word 的编辑功能,容易被不会编写 HTML 的用户并需要设置各种文本格式的用户所喜爱。它的应用也越来越广泛。最先只有 IE 浏览器支持,其它浏览器相继跟进,在功能的丰富性来说,还是 IE 强些。虽然没有一个统一的标准,但对于最基本的功能,各浏览器提...

jquery的tree table(树表)

  因项目需要,需要在表格中加入tree,使用了jquery的tree table,经美化,完美兼容各种框架的table;   请移步下载tree table 的js文件及css文件等,http://ludo.cubicphuse.nl/jquery-treetable/;      用到css文件:<link rel="stylesheet" hr...