PcapSniffer - Empire Module
This page contains detailed information about how to use the python/collection/linux/sniffer Empire module. For list of all Empire modules, visit the Empire Module Library.
Module Overview
Name: PcapSniffer
Module: python/collection/linux/sniffer
Source code:
empire/server/modules/python/collection/linux/sniffer.yaml
MITRE ATT&CK:
T1040
Language: Python
Needs admin: Yes
OPSEC safe: No
Background: No
The sniffer module will sniff all interfaces on the target, and write in pcap format.
This module runs in a foreground and is OPSEC unsafe as it writes on the disk and therefore could be detected by AV/EDR running on the target system.
Note that the sniffer module does not need administrative privileges to work properly which means that a normal user can run this module.
Required Module Options
This is a list of options that are required by the sniffer module:
Agent
Agent to run sniffer on.
MaxPackets
Set max packets to capture.
Default value: 100
.
MaxSize
Set max file size to save to disk/memory (MB).
SavePath
Path of the file to save (Not used if InMemory is True.
Default value: /tmp/debug.pcap
.
Additional Module Options
This is a list of additional options that are supported by the sniffer module:
InMemory
Store binary data in memory, never drop to disk (WARNING: set MaxSize).
Default value: True
.
IpFilter
Set IP to filter on (dst & src).
PortFilter
Set port to filter on (dst & src).
Sniffer Example Usage
Here's an example of how to use the sniffer module in the Empire client console:
[+] New agent Y4LHEV83 checked in
[*] Sending agent (stage 2) to Y4LHEV83 at 192.168.204.135
(empire usestager/multi/bash) > usemodule python/collection/linux/sniffer
Author @Killswitch_GUI
Background False
Comments For full comments and code: https://gist.github.com/killswitch-
GUI/314e79581f2619a18d94c81d53e5466f
Description This module will sniff all interfaces on the target, and write in pcap
format.
Language python
Name python/collection/linux/sniffer
NeedsAdmin True
OpsecSafe False
Techniques http://attack.mitre.org/techniques/T1040
,Record Options----------------,----------,-------------------------------------,
| Name | Value | Required | Description |
|------------|-----------------|----------|-------------------------------------|
| Agent | | True | Agent to run sniffer on. |
|------------|-----------------|----------|-------------------------------------|
| InMemory | True | False | Store binary data in memory, never |
| | | | drop to disk (WARNING: set |
| | | | MaxSize). |
|------------|-----------------|----------|-------------------------------------|
| IpFilter | 0 | False | Set IP to filter on (dst & src). |
|------------|-----------------|----------|-------------------------------------|
| MaxPackets | 100 | True | Set max packets to capture. |
|------------|-----------------|----------|-------------------------------------|
| MaxSize | 1 | True | Set max file size to save to |
| | | | disk/memory (MB). |
|------------|-----------------|----------|-------------------------------------|
| PortFilter | 0 | False | Set port to filter on (dst & src). |
|------------|-----------------|----------|-------------------------------------|
| SavePath | /tmp/debug.pcap | True | Path of the file to save (Not used |
| | | | if InMemory is True. |
'------------'-----------------'----------'-------------------------------------'
(Empire: usemodule/python/collection/linux/sniffer) > set Agent Y4LHEV83
[*] Set Agent to Y4LHEV83
(Empire: usemodule/python/collection/linux/sniffer) > set MaxPackets 100
[*] Set MaxPackets to 100
(Empire: usemodule/python/collection/linux/sniffer) > set MaxSize value
[*] Set MaxSize to value
(Empire: usemodule/python/collection/linux/sniffer) > set SavePath /tmp/debug.pcap
[*] Set SavePath to /tmp/debug.pcap
(Empire: usemodule/python/collection/linux/sniffer) > execute
[*] Tasked Y4LHEV83 to run Task 1
...
Now wait for the results to come.
Author
References
- https://github.com/BC-SECURITY/Empire/tree/master/empire/server/modules/python/collection/linux/sniffer.yaml
- https://gist.github.com/killswitch-GUI/314e79581f2619a18d94c81d53e5466f
- http://attack.mitre.org/techniques/T1040
See Also
Check also the following modules related to this module:
- python/collection/linux/hashdump
- python/collection/linux/xkeylogger
- python/collection/linux/pillage_user
- python/collection/linux/mimipenguin
- python/collection/linux/keylogger
- python/collection/osx/sniffer
- python/privesc/linux/linux_priv_checker
- python/privesc/linux/unix_privesc_check
Version
This page has been created based on Empire version 4.1.3 (BC Security Fork).
Visit Empire Module Library for more modules.