This tool extracts Credit card numbers, NTLM(DCE-RPC, HTTP, SQL, LDAP, etc), Kerberos (AS-REQ Pre-Auth etype 23), HTTP Basic, SNMP, POP, SMTP, FTP, IMAP, etc from a pcap file or from a live interface.

Related tags

Networking PCredz
Overview

PCredz

This tool extracts Credit card numbers, NTLM(DCE-RPC, HTTP, SQL, LDAP, etc), Kerberos (AS-REQ Pre-Auth etype 23), HTTP Basic, SNMP, POP, SMTP, FTP, IMAP, etc from a pcap file or from a live interface.

Features

  • Extract from a pcap file or from a live interface IPv4 and IPv6:

    • Credit card numbers
    • POP
    • SMTP
    • IMAP
    • SNMP community string
    • FTP
    • HTTP (NTLM/Basic/HTTP Forms)
    • NTLMv1/v2 (DCE-RPC,SMBv1/2,LDAP, MSSQL, HTTP, etc)
    • Kerberos (AS-REQ Pre-Auth etype 23) hashes.
  • All hashes are displayed in a hashcat format (use -m 7500 for kerberos, -m 5500 for NTLMv1, -m 5600 for NTLMv2).

  • Log all credentials and information to a file (CredentialDump-Session.log).

  • Log credentials in the logs/ folder. MSKerb.txt, NTLMv1.txt and NTLMv2.txt can be directly fed to hashcat.

Install

Linux

On a debian based OS bash:

apt install python3-pip && pip3 install Cython && pip3 install python-libpcap

Usage

# extract credentials from a pcap file
python3 ./Pcredz -f file-to-parse.pcap

# extract credentials from all pcap files in a folder
python3 ./Pcredz -d /tmp/pcap-directory-to-parse/

# extract credentials from a live packet capture on a network interface (need root privileges)
python3 ./Pcredz -i eth0 -v

Options

  -h, --help          show this help message and exit
  -f capture.pcap     Pcap file to parse
  -d /home/pnt/pcap/  Pcap directory to parse recursivly
  -i eth0             interface for live capture
  -v                  More verbose.
Comments
  • pcredz tries to write log file in /usr/sbin

    pcredz tries to write log file in /usr/sbin

    pcredz is writing a log file in /usr/sbin. It should log it somewhere else, like /var/log, use syslog, or logging to a file should be an option, since it seems to write the same data to stdout and to the log file.

    bduncan@ltw3701:~$ pcredz -i eth0 Pcredz 0.9 Author: Laurent Gaffie Please send bugs/comments/pcaps to: [email protected] This script will extract NTLM (http,ldap,smb,sql,etc), Kerberos, FTP, HTTP Basic and credit card data from a given pcap file or from a live interface.

    Traceback (most recent call last): File "/usr/sbin/pcredz", line 81, in l.addHandler(logging.FileHandler(Filename,'a')) File "/usr/lib/python2.7/logging/init.py", line 911, in init StreamHandler.init(self, self._open()) File "/usr/lib/python2.7/logging/init.py", line 936, in _open
    stream = open(self.baseFilename, self.mode)
    IOError: [Errno 13] Permission denied: '/usr/sbin/CredentialDump-Session.log'
    :( 1 bduncan@ltw3701:~$

    Thanks, Bruce

    opened by bduncan 5
  • python-libpcap deprecated

    python-libpcap deprecated

    On the latest Kali build, apt is reporting that python-libpcap does not exist. Also attempts to install it from the sourceforge link provided by the error message when trying to run PCredz fails. Is there an alternative or can PCredz be updated to use another pcap parsing library?

    opened by tickTackHack 4
  • Enhancement: Read from sys.stdin

    Enhancement: Read from sys.stdin

    Proposed Enhancement

    It would be great if the program could read from sys.stdin. That way it would be possible to pipe tcpdump streams directly into the program.

    Example

    This way you could do for example $ tcpdump '<capture filter>' -U -w - | Pcredz | grep -i found > found_creds.log or even ssh root@remote-server "(tcpdump '<capture filter>' -U -w -)" | Pcredz | grep -i found > found_creds.log

    Benefits

    It would be possible to process a huge amount of traffic without requiring to store large amounts of pcap data.

    opened by windgmbh 3
  • AttributeError: 'module' object has no attribute 'pcapObject'

    AttributeError: 'module' object has no attribute 'pcapObject'

    Hi there, I have recently been seeing an issue I am having trouble resolving when running PCredz:

    Traceback (most recent call last): File "./Pcredz", line 757, in Run() File "./Pcredz", line 750, in Run decode_file(fname,'') File "./Pcredz", line 651, in decode_file p = pcap.pcapObject() AttributeError: 'module' object has no attribute 'pcapObject'

    I have pylibpcap installed and have removed libpcap has i understand they don't play well together?: Requirement already satisfied: pylibpcap in /usr/local/lib/python2.7/dist-packages (0.6.4)

    Any assistance is appreciated whilst I figure this one out

    opened by KeepItMeke 3
  • issue in live capture!

    issue in live capture!

    Hello, system i am using kali linux 2.0 amd64: root@kali:~/PCredz# apt-get remove python-pypcap && apt-get install python-libpcap Reading package lists... Done Building dependency tree
    Reading state information... Done Package 'python-pypcap' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Reading package lists... Done Building dependency tree
    Reading state information... Done python-libpcap is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

    When I run it root@kali:~/PCredz# ./Pcredz -i wlan0 Pcredz 1.0.0 Author: Laurent Gaffie Please send bugs/comments/pcaps to: [email protected] This script will extract NTLM (http,ldap,smb,sql,etc), Kerberos, FTP, HTTP Basic and credit card data from a given pcap file or from a live interface.

    CC number scanning activated

    Traceback (most recent call last): File "./Pcredz", line 681, in Run() File "./Pcredz", line 676, in Run decode_file(fname,'') File "./Pcredz", line 584, in decode_file p = pcap.pcapObject() AttributeError: 'module' object has no attribute 'pcapObject!!!

    Thanks

    opened by Indeserpen 3
  • python dependencies not met but are. Maybe i am tired but what?

    python dependencies not met but are. Maybe i am tired but what?

    └─$ sudo python3 ./Pcredz -i eth0 -v libpcap not installed. try : apt install python3-pip && pip3 install Cython && pip3 install python-libpcap

    └─$ sudo apt install python3-pip && pip3 install Cython && pip3 install python-libpcap Reading package lists... Done Building dependency tree... Done Reading state information... Done python3-pip is already the newest version (20.3.4-1). The following packages were automatically installed and are no longer required: libxml-dom-perl libxml-perl libxml-regexp-perl Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 1478 not upgraded. Requirement already satisfied: Cython in /usr/lib/python3/dist-packages (0.29.21) Requirement already satisfied: python-libpcap in /home/pentester/.local/lib/python3.8/site-packages (0.4.0) Requirement already satisfied: Cython>=0.29.13 in /usr/lib/python3/dist-packages (from python-libpcap) (0.29.21)

    opened by TheBlindHacker 2
  • Lack of IPv6 support

    Lack of IPv6 support

    PCredz does not support IPv6 traffic, and will silently ignore any that's present on the interface or in any imported pcap files.

    On an IPv6-only or dual stack network, modern operating systems will use IPv6 in preference to any legacy protocols, so all legitimate traffic would be using this protocol.

    This occurs because the Print_Packet_* functions explicitly check for the legacy IPv4 ether type (0x0800) and ignore anything else:

    if data[12:14]== b'\x08\x00':

    This is then passed to the function Decode_Ip_Packet which extracts the src/destination address from the packet header. It then returns the packet payload (ie starting from TCP/UDP header).

    The attached patch also checks for the IPv6 ether type (0x86dd) and passes it to a separate function Decode_Ipv6_Packet that handles an IPv6 header. The higher level TCP/UDP payloads remain the same on IPv6 so execution continues after parsing the header and returning the correct start of the payload.

    So far this only works with a standard 40 byte IPv6 header, it does not properly check the next-header field so it would fail if there are optional extension headers present (rare).

    Instead of using a separate function for IPv6, it may be preferable to use a single function and then check the version field of the header and act accordingly.

    v6.txt

    opened by bert128 2
  • Installing on Kali Linux 2020.2

    Installing on Kali Linux 2020.2

    Hi. I was trying to install on Kali Linux 2020.2 and ran the install as suggested.

    sudo apt install python3-pip && pip3 install Cython && pip3 install python-libpcap

    However, I was getting the following error I included below.

    I was able to solve by installing libpcap-dev.

    sudo apt install libpcap-dev

    FYI in case others run into the issue.

    Building wheel for python-libpcap (setup.py) ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mg382xue/python-libpcap/setup.py'"'"'; file='"'"'/tmp/pip-install-mg382xue/python-libpcap/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-l7d1cm3m
    cwd: /tmp/pip-install-mg382xue/python-libpcap/
    Complete output (34 lines):
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/pylibpcap
    copying pylibpcap/utils.py -> build/lib.linux-x86_64-3.8/pylibpcap
    copying pylibpcap/command.py -> build/lib.linux-x86_64-3.8/pylibpcap
    copying pylibpcap/pcap.py -> build/lib.linux-x86_64-3.8/pylibpcap
    copying pylibpcap/main.py -> build/lib.linux-x86_64-3.8/pylibpcap
    copying pylibpcap/open.py -> build/lib.linux-x86_64-3.8/pylibpcap
    copying pylibpcap/init.py -> build/lib.linux-x86_64-3.8/pylibpcap
    running egg_info
    writing python_libpcap.egg-info/PKG-INFO
    writing dependency_links to python_libpcap.egg-info/dependency_links.txt
    writing entry points to python_libpcap.egg-info/entry_points.txt
    writing requirements to python_libpcap.egg-info/requires.txt
    writing top-level names to python_libpcap.egg-info/top_level.txt
    reading manifest file 'python_libpcap.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '.h' under directory 'src'
    warning: no previously-included files matching '
    .pyc' found anywhere in distribution
    writing manifest file 'python_libpcap.egg-info/SOURCES.txt'
    copying pylibpcap/base.c -> build/lib.linux-x86_64-3.8/pylibpcap
    running build_ext
    building 'pylibpcap.base' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/pylibpcap
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c pylibpcap/base.c -o build/temp.linux-x86_64-3.8/pylibpcap/base.o -lpcap
    pylibpcap/base.c:622:10: fatal error: pcap.h: No such file or directory
    622 | #include "pcap.h"
    | ^~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1


    ERROR: Failed building wheel for python-libpcap

    Running setup.py install for python-libpcap ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mg382xue/python-libpcap/setup.py'"'"'; file='"'"'/tmp/pip-install-mg382xue/python-libpcap/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-ua36ifxi/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/python-libpcap
    cwd: /tmp/pip-install-mg382xue/python-libpcap/
    Complete output (34 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/pylibpcap
    copying pylibpcap/utils.py -> build/lib.linux-x86_64-3.8/pylibpcap
    copying pylibpcap/command.py -> build/lib.linux-x86_64-3.8/pylibpcap
    copying pylibpcap/pcap.py -> build/lib.linux-x86_64-3.8/pylibpcap
    copying pylibpcap/main.py -> build/lib.linux-x86_64-3.8/pylibpcap
    copying pylibpcap/open.py -> build/lib.linux-x86_64-3.8/pylibpcap
    copying pylibpcap/init.py -> build/lib.linux-x86_64-3.8/pylibpcap
    running egg_info
    writing python_libpcap.egg-info/PKG-INFO
    writing dependency_links to python_libpcap.egg-info/dependency_links.txt
    writing entry points to python_libpcap.egg-info/entry_points.txt
    writing requirements to python_libpcap.egg-info/requires.txt
    writing top-level names to python_libpcap.egg-info/top_level.txt
    reading manifest file 'python_libpcap.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '.h' under directory 'src'
    warning: no previously-included files matching '
    .pyc' found anywhere in distribution
    writing manifest file 'python_libpcap.egg-info/SOURCES.txt'
    copying pylibpcap/base.c -> build/lib.linux-x86_64-3.8/pylibpcap
    running build_ext
    building 'pylibpcap.base' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/pylibpcap
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c pylibpcap/base.c -o build/temp.linux-x86_64-3.8/pylibpcap/base.o -lpcap
    pylibpcap/base.c:622:10: fatal error: pcap.h: No such file or directory
    622 | #include "pcap.h"
    | ^~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
    ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mg382xue/python-libpcap/setup.py'"'"'; file='"'"'/tmp/pip-install-mg382xue/python-libpcap/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-ua36ifxi/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/python-libpcap Check the logs for full command output.

    opened by 192346 2
  • rerunning the script

    rerunning the script

    I ran the script once and got a nice dump of output, I then ran it again to send the output to a file, when I checked the file it only had the script headers in it, no data. I tried a few times and didn't get any output.

    I then noticed the session log file and found that contained all my data and after fiddling realised that you don't output anything that is already cached in the file. This causes a couple of problems:

    • There is no mention of this feature so I wasted some time trying to find my data again. It should be documented
    • If a cache of existing data is found, the script should mention this when it is ran, maybe something like: -- Existing X entries from cache not shown --
    • It would be good to specify where the output file is written to, I want the output in my client folder not in the script folder
    • A feature to dump the creds in the file would be good
    • A feature that says ignore the cache and dump everything would be good.

    Sorry to put these all in one ticket, I'll break them out into multiple if you want so that you can track or respond to each one separately.

    opened by digininja 2
  • Added more support to detect http auths

    Added more support to detect http auths

    Hi, This PR adds better detection for regular http auth attempts. I also changed the argument parser to argparse since the optparse library is deprecated.

    opened by byt3bl33d3r 2
  • Added dockerfile

    Added dockerfile

    Added a dockerfile to the tool.

    • Useful for managing python dependencies and versioning
    • Also used to parse large pcaps on the host instead of exfiltrating off the host
    opened by theRealFr13nd 1
  • libpcap Not Installed

    libpcap Not Installed

    I am trying to test #47 on a not Kali box, but I cannot get PCredz to even run due to it claiming libpcap is not installed. I attempted previous closed issue fixes, but couldn't get anything to work. I downloaded this Ubuntu image today and updated it.

    image

    Let me know if you have any ideas or want me to retest.

    opened by Zamanry 7
  • Live Capture Host Exclusions

    Live Capture Host Exclusions

    On my penetration tests, I often run into issues where my own systems' authentication requests are collected. Whenever I perform AD password spraying and forget to disable PCredz, my PCredz logs are filled with the password spray attempts, and I have actually missed an actual real hash in the same logs until further checks revealed the true positive. It would nice if we had a feature like Responder to exclude a list of IP addresses or FQDNs.

    opened by Zamanry 0
  • fixing a unicode decoding error I encountered.

    fixing a unicode decoding error I encountered.

    I was analyzing some traffic I captured and it kept crashing on one particular file.

    The python traceback showed me what was happening.

    I just wrapped the decode in a try block.

    The pcap in question did have mssql traffic.

    This lets me at least capture that something went wrong and shows the data in case I can tease something out of it visually.

    opened by ShyftXero 0
Owner
null
PcapConverter - A project for generating 15min frames out of a .pcap file containing network traffic

CMB Assignment 02 code + notebooks This is a project for containing code for the

Yannik S 2 Jan 24, 2022
Malcolm is a powerful, easily deployable network traffic analysis tool suite for full packet capture artifacts (PCAP files) and Zeek logs.

Malcolm is a powerful, easily deployable network traffic analysis tool suite for full packet capture artifacts (PCAP files) and Zeek logs.

Cybersecurity and Infrastructure Security Agency 1.3k Jan 8, 2023
An opensource library to use SNMP get/bulk/set/walk in Python

SNMP-UTILS An opensource library to use SNMP get/bulk/set/walk in Python Features Work with OIDS json list [Find Here](#OIDS List) GET command SET com

Alexandre Gossard 3 Aug 3, 2022
Juniper SNMP Migrations For Python

Juniper SNMP Migrations This example will show how to use the PyEZ plugin for Nornir to build a NETCONF connection to a remote device validate that SN

Calvin Remsburg 1 Jan 7, 2022
Tiny JSON RPC via HTTP library.

jrpc Simplest ever possible Asynchronous JSON RPC via HTTP library for Python, backed by httpx. Installation pip install async-jrpc Usage Import JRPC

Onigiri Team 2 Jan 31, 2022
An ftp syncing python package that I use to sync pokemon saves between my hacked 3ds running ftpd and my server

Sync file pairs over ftp and apply patches to them. Useful for using ftpd to transfer ROM save files to and from your DS if you also play on an emulator. Setup a cron job to check for your DS's ftp server periodically to setup automatic syncing. Untested on windows. It may just work out of the box, unsure though.

null 17 Jan 4, 2023
Light, simple RPC framework for Python

Agileutil是一个Python3 RPC框架。基于微服务架构,封装了rpc/http/orm/log等常用组件,提供了简洁的API,开发者可以很快上手,快速进行业务开发。

null 16 Nov 22, 2022
RabbitMQ asynchronous connector library for Python with built in RPC support

About RabbitMQ connector library for Python that is fully integrated with the aio-pika framework. Introduction BunnyStorm is here to simplify working

null 22 Sep 11, 2022
Discord RPC Generator With Python

Discord-RPC-Generator Thank you for using this Discord Custom RP Generator. This is 100% safe and open source. Download Discord for your computer here

null 1 Nov 9, 2021
Out-of-box Python RPC framework

typed-jsonrpc Out-of-box Python RPC framework. WIP. Make LSP easy for everyone. The conception of final usage: from typed_jsonrpc import * ls = Langu

Taine Zhao 4 Dec 28, 2021
Process incoming JSON-RPC requests in Python

August 16, 2021: Version 5 has been released. Read about the changes in version 5, or read the full documentation. Version 5 is for Python 3.8+ only.

Exploding Labs 156 Dec 31, 2022
Qobuz-rpc - A simple discord rich presence client for qobuz written in Python

qobuz-rpc A simple discord rich presence client for qobuz written in Python It's

Raphael O. 13 Dec 15, 2022
A simple implementation of an RPC toolkit

Simple RPC With Raw Sockets Repository for the Data network course project: Introduction In this project, you will attempt to code a simple implementa

Milad Samimifar 1 Mar 25, 2022
Serves some data over HTTP, once. Based on the built-in Python module http.server

serve-me-once Serves some data over HTTP, once. Based on the built-in Python module http.server.

Peder Bergebakken Sundt 2 Jan 6, 2022
Display ip2.network active live streams.

Display ip2.network active live streams.

Daeshon Jones 0 Oct 31, 2021
A live streaming chatroom involving multiple modalities, such as voice, gesture, and facial expression

HiLive A live streaming chatroom involving multiple modalities, such as voice, gesture, and facial expression. Introduction We focus on demonstrating

Ryan Yen 2 Dec 2, 2021
Synchronised text editor over TCP, for live editing with others.

SyncTEd Synchronised text editor over TCP, for live editing with others. Written in Python with PyGame. Run Install requirements: pip install -r requi

Marko Živić 1 May 13, 2022
A simple tool to utilize the basic functionality of the Private API From Virus Total

Welcome To VT-SCAN (viurs total api) Information This is a simple tool to utilize the basic functionality of the Private API From Virus Total. with th

0X0ŽĒR∅⁰ 1 Sep 21, 2022
This program ingests a Cisco "sh ip arp" as a text file and produces the list of vendors seen in the file

IP-ARP-Vendor_lookup This program ingests a Cisco "sh ip arp" as a text file and produces the list of vendors seen in the file Why? Answers the questi

Stew Alexander 1 Dec 24, 2022