Skip to content

sys1ph0s/Bin-Validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

BIN Validator

A fast, reliable Python command-line utility designed to filter large datasets of credit card numbers against a verified list of Bank Identification Numbers (BINs).

This tool is particularly useful for Fraud and Threat Intelligence teams who need to rapidly triage and cross-reference leaked BIN numbers on a daily basis. It is ideal for data cleaning, allowing you to easily extract specific credit cards from bulk datasets while automatically handling duplicate entries and formatting artifacts.


Usage

You can run the script via the command line. To see the available commands at any time, use the help flag:

py BIN_Validator.py -h

Output:

usage: py BIN_Validator.py [-h] -b BINS -n NEW_CARDS [-o OUTPUT] [-e {txt,csv}]

Filter credit card numbers based on a list of Bank Identification Numbers (BINs).

options:
  -h, --help            show this help message and exit
  -b, --bins BINS       Path to the input file containing BINS (Source of Truth). Supports .txt and .csv
  -n, --new_cards NEW_CARDS
                        Path to the input file containing new cards to check. Supports .txt and .csv
  -o, --output OUTPUT   Path to the output file. Defaults to cards_DD_MM_YYYY.[txt/csv]
  -e, --export_format {txt,csv}
                        Format for the output file (txt or csv). Default is txt.

Examples

Basic Usage (Default TXT Output)

To filter a list of new cards against your known BINs, provide the paths to both files.

Note: After the -b flag, you must add the path of the file containing all our BINs. After the -n flag, add the path to the file containing the cards you want to check.

py BIN_Validator.py -b all_BINs.txt -n new_cards.txt

This will process the cards and automatically generate a file named cards_DD_MM_YYYY.txt in your current directory.

Exporting to CSV

If you prefer your results in a spreadsheet format, use the -e flag:

py BIN_Validator.py -b data/all_BINs.csv -n data/new_cards.txt -e csv

This outputs the matched cards to a .csv file.

Custom Output Filename

You can specify exactly what you want the output file to be named using the -o flag:

py BIN_Validator.py -b all_BINs.txt -n new_cards.txt -o my_filtered_cards.csv -e csv

Terminal Report

Every time you run the script, it will print a detailed report to your terminal so you can verify the results at a glance:

==================================================
                BIN FILTER REPORT                 
==================================================
 All BINs in our Inventory:          450
   Where:
   > 6 Digit BINs:                   400
   > 8 Digit BINs:                    45
   > 9 Digit BINs:                     5
--------------------------------------------------
 Total new cards scanned:          50000
 Success! Found matching cards:     1250
==================================================
 Results saved to: cards_21_11_2025.txt

About

A Python CLI tool to efficiently filter and deduplicate credit card numbers against a source-of-truth BIN list.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages