<?php
/**
* Credit Card Checker Script
*
* DISCLAIMER: This script is for EDUCATIONAL PURPOSES ONLY.
* Use only on cards you own or have explicit permission to test.
* Unauthorized credit card checking is ILLEGAL in most jurisdictions.
*
* Features:
* - Luhn algorithm validation
* - Card type detection (Visa, MC, Amex, Discover, etc.)
* - BIN lookup (first 6 digits)
* - Expiry date validation
* - CVV length checking
*/
class CreditCardChecker
/**
* Validate credit card number using Luhn algorithm
*/
public function luhnCheck($cardNumber)
$cardNumber = preg_replace('/\D/', '', $cardNumber);
$sum = 0;
$alternate = false;
for ($i = strlen($cardNumber) - 1; $i >= 0; $i--)
$n = (int)$cardNumber[$i];
if ($alternate)
$n *= 2;
if ($n > 9)
$n = ($n % 10) + 1;
$sum += $n;
$alternate = !$alternate;
return ($sum % 10 == 0);
/**
* Detect card type based on BIN (first 6 digits)
*/
public function getCardType($cardNumber)
preg_match('/^622[1-9]/', $cardNumber))
return 'Discover';
// JCB: starts with 35
if (preg_match('/^35/', $cardNumber))
return 'JCB';
// Diners Club: starts with 300-305, 36, 38, 39
if (preg_match('/^30[0-5]/', $cardNumber)
/**
* Get expected card length for type
*/
public function getExpectedLength($cardType)
$lengths = [
'Visa' => [13, 16],
'MasterCard' => [16],
'American Express' => [15],
'Discover' => [16],
'JCB' => [16],
'Diners Club' => [14, 16]
];
return isset($lengths[$cardType]) ? $lengths[$cardType] : [];
/**
* Validate expiry date (MM/YY or MM/YYYY)
*/
public function validateExpiry($expiryMonth, $expiryYear)
// Normalize year to 4 digits
if (strlen($expiryYear) == 2)
$expiryYear = 2000 + (int)$expiryYear;
else
$expiryYear = (int)$expiryYear;
$expiryMonth = (int)$expiryMonth;
// Basic range checks
if ($expiryMonth < 1
/**
* Validate CVV based on card type
*/
public function validateCVV($cvv, $cardType)
$cvv = preg_replace('/\D/', '', $cvv);
$expectedLength = ($cardType == 'American Express') ? 4 : 3;
if (strlen($cvv) != $expectedLength)
return ['valid' => false, 'message' => "CVV must be $expectedLength digits for $cardType"];
return ['valid' => true, 'message' => 'CVV format valid'];
/**
* Perform BIN lookup (simulated - real implementation would use API)
*/
public function binLookup($cardNumber)
$bin = substr(preg_replace('/\D/', '', $cardNumber), 0, 6);
// This is a SIMULATED response
// In production, you'd call an API like binlist.net
$simulatedData = [
'bin' => $bin,
'scheme' => $this->getCardType($cardNumber),
'country' => 'US',
'bank' => 'Example Bank',
'type' => 'CREDIT',
'level' => 'STANDARD'
];
return $simulatedData;
/**
* Main checking function
*/
public function checkCard($cardNumber, $expiryMonth = null, $expiryYear = null, $cvv = null)
$cleanedCard = preg_replace('/\D/', '', $cardNumber);
// Basic validation
if (empty($cleanedCard)
/**
* Mask card number for display
*/
private function maskCardNumber($cardNumber)
$length = strlen($cardNumber);
if ($length <= 8)
return str_repeat('*', $length);
$first4 = substr($cardNumber, 0, 4);
$last4 = substr($cardNumber, -4);
$masked = str_repeat('*', $length - 8);
return $first4 . $masked . $last4;
// ============ USAGE EXAMPLES ============
$checker = new CreditCardChecker();
// Example 1: Validate single card
$testCard = "4111111111111111"; // Valid Visa test number
$result = $checker->checkCard($testCard, '12', '25', '123');
echo "=== CREDIT CARD CHECKER RESULT ===\n";
echo "Card: " . $result['card_number'] . "\n";
echo "Type: " . $result['card_type'] . "\n";
echo "Luhn Check: " . ($result['luhn_check'] ? 'PASS' : 'FAIL') . "\n";
echo "Length Valid: " . ($result['length_valid'] ? 'PASS' : 'FAIL') . "\n";
echo "Overall Valid: " . ($result['valid'] ? 'YES' : 'NO') . "\n";
if (isset($result['expiry_valid']))
echo "Expiry: " . ($result['expiry_valid'] ? 'Valid' : 'Invalid - ' . $result['expiry_message']) . "\n";
if (isset($result['cvv_valid']))
echo "CVV: " . ($result['cvv_valid'] ? 'Valid format' : 'Invalid - ' . $result['cvv_message']) . "\n";
echo "\nBIN Info:\n";
print_r($result['bin_info']);
// Example 2: Bulk check from file
function bulkCheckFromFile($filename, $checker)
if (!file_exists($filename))
echo "File not found: $filename\n";
return;
$lines = file($filename, FILE_IGNORE_NEW_LINES
// Uncomment to use bulk check
// $bulkResults = bulkCheckFromFile('cards.txt', $checker);
// foreach ($bulkResults as $res)
// echo ($res['valid'] ? 'VALID' : 'INVALID') . ' - ' . $res['card_number'] . ' (' . $res['card_type'] . ")\n";
//
?>
In the shadows of the internet, terms like "CC checker script PHP" are searched thousands of times per month. To the uninitiated, it might sound like a harmless technical tool—perhaps a script to validate color codes or gift card balances. However, within cybersecurity circles and black-hat forums, "CC" stands for Credit Card.
A CC checker script is a piece of PHP code designed to validate stolen credit card data en masse. It acts as a quality assurance tool for cybercriminals, allowing them to determine which stolen cards are still active, have funds available, or can be used for fraudulent transactions. cc checker script php
This article will dissect how such a script works programmatically, the logic behind its design, the severe legal and ethical implications, and why understanding this code is crucial for defensive cybersecurity. Deep Report: CC Checker Scripts in PHP The
🚨 Disclaimer: This article is for educational purposes only. Writing, distributing, or using a CC checker script to validate unauthorized credit card data is a federal crime in most jurisdictions (18 U.S.C. § 1029 in the US, Computer Misuse Act in the UK). The author does not condone any illegal activity. Validating stolen credit card numbers Testing card details
For e-commerce developers and system administrators, understanding CC checkers helps you block them.
The script analyzes the HTTP response code and body to determine "live" status:
| Gateway Response | Script Interpretation | Color Code |
|----------------|----------------------|-------------|
| 200 OK + "status":"succeeded" | LIVE ✅ (AVS/CVV match) | Green |
| 402 Payment Required | Insufficient funds 🟡 | Yellow |
| 400 - "invalid_cvc" | Dead ❌ (CVV mismatch) | Red |
| 401 Unauthorized | Dead (Card blocked) | Red |
| Timeout / 403 | Proxy dead or rate limited | Grey |
<?php
/**
* Credit Card Checker Script
*
* DISCLAIMER: This script is for EDUCATIONAL PURPOSES ONLY.
* Use only on cards you own or have explicit permission to test.
* Unauthorized credit card checking is ILLEGAL in most jurisdictions.
*
* Features:
* - Luhn algorithm validation
* - Card type detection (Visa, MC, Amex, Discover, etc.)
* - BIN lookup (first 6 digits)
* - Expiry date validation
* - CVV length checking
*/
class CreditCardChecker
/**
* Validate credit card number using Luhn algorithm
*/
public function luhnCheck($cardNumber)
$cardNumber = preg_replace('/\D/', '', $cardNumber);
$sum = 0;
$alternate = false;
for ($i = strlen($cardNumber) - 1; $i >= 0; $i--)
$n = (int)$cardNumber[$i];
if ($alternate)
$n *= 2;
if ($n > 9)
$n = ($n % 10) + 1;
$sum += $n;
$alternate = !$alternate;
return ($sum % 10 == 0);
/**
* Detect card type based on BIN (first 6 digits)
*/
public function getCardType($cardNumber)
preg_match('/^622[1-9]/', $cardNumber))
return 'Discover';
// JCB: starts with 35
if (preg_match('/^35/', $cardNumber))
return 'JCB';
// Diners Club: starts with 300-305, 36, 38, 39
if (preg_match('/^30[0-5]/', $cardNumber)
/**
* Get expected card length for type
*/
public function getExpectedLength($cardType)
$lengths = [
'Visa' => [13, 16],
'MasterCard' => [16],
'American Express' => [15],
'Discover' => [16],
'JCB' => [16],
'Diners Club' => [14, 16]
];
return isset($lengths[$cardType]) ? $lengths[$cardType] : [];
/**
* Validate expiry date (MM/YY or MM/YYYY)
*/
public function validateExpiry($expiryMonth, $expiryYear)
// Normalize year to 4 digits
if (strlen($expiryYear) == 2)
$expiryYear = 2000 + (int)$expiryYear;
else
$expiryYear = (int)$expiryYear;
$expiryMonth = (int)$expiryMonth;
// Basic range checks
if ($expiryMonth < 1
/**
* Validate CVV based on card type
*/
public function validateCVV($cvv, $cardType)
$cvv = preg_replace('/\D/', '', $cvv);
$expectedLength = ($cardType == 'American Express') ? 4 : 3;
if (strlen($cvv) != $expectedLength)
return ['valid' => false, 'message' => "CVV must be $expectedLength digits for $cardType"];
return ['valid' => true, 'message' => 'CVV format valid'];
/**
* Perform BIN lookup (simulated - real implementation would use API)
*/
public function binLookup($cardNumber)
$bin = substr(preg_replace('/\D/', '', $cardNumber), 0, 6);
// This is a SIMULATED response
// In production, you'd call an API like binlist.net
$simulatedData = [
'bin' => $bin,
'scheme' => $this->getCardType($cardNumber),
'country' => 'US',
'bank' => 'Example Bank',
'type' => 'CREDIT',
'level' => 'STANDARD'
];
return $simulatedData;
/**
* Main checking function
*/
public function checkCard($cardNumber, $expiryMonth = null, $expiryYear = null, $cvv = null)
$cleanedCard = preg_replace('/\D/', '', $cardNumber);
// Basic validation
if (empty($cleanedCard)
/**
* Mask card number for display
*/
private function maskCardNumber($cardNumber)
$length = strlen($cardNumber);
if ($length <= 8)
return str_repeat('*', $length);
$first4 = substr($cardNumber, 0, 4);
$last4 = substr($cardNumber, -4);
$masked = str_repeat('*', $length - 8);
return $first4 . $masked . $last4;
// ============ USAGE EXAMPLES ============
$checker = new CreditCardChecker();
// Example 1: Validate single card
$testCard = "4111111111111111"; // Valid Visa test number
$result = $checker->checkCard($testCard, '12', '25', '123');
echo "=== CREDIT CARD CHECKER RESULT ===\n";
echo "Card: " . $result['card_number'] . "\n";
echo "Type: " . $result['card_type'] . "\n";
echo "Luhn Check: " . ($result['luhn_check'] ? 'PASS' : 'FAIL') . "\n";
echo "Length Valid: " . ($result['length_valid'] ? 'PASS' : 'FAIL') . "\n";
echo "Overall Valid: " . ($result['valid'] ? 'YES' : 'NO') . "\n";
if (isset($result['expiry_valid']))
echo "Expiry: " . ($result['expiry_valid'] ? 'Valid' : 'Invalid - ' . $result['expiry_message']) . "\n";
if (isset($result['cvv_valid']))
echo "CVV: " . ($result['cvv_valid'] ? 'Valid format' : 'Invalid - ' . $result['cvv_message']) . "\n";
echo "\nBIN Info:\n";
print_r($result['bin_info']);
// Example 2: Bulk check from file
function bulkCheckFromFile($filename, $checker)
if (!file_exists($filename))
echo "File not found: $filename\n";
return;
$lines = file($filename, FILE_IGNORE_NEW_LINES
// Uncomment to use bulk check
// $bulkResults = bulkCheckFromFile('cards.txt', $checker);
// foreach ($bulkResults as $res)
// echo ($res['valid'] ? 'VALID' : 'INVALID') . ' - ' . $res['card_number'] . ' (' . $res['card_type'] . ")\n";
//
?>
In the shadows of the internet, terms like "CC checker script PHP" are searched thousands of times per month. To the uninitiated, it might sound like a harmless technical tool—perhaps a script to validate color codes or gift card balances. However, within cybersecurity circles and black-hat forums, "CC" stands for Credit Card.
A CC checker script is a piece of PHP code designed to validate stolen credit card data en masse. It acts as a quality assurance tool for cybercriminals, allowing them to determine which stolen cards are still active, have funds available, or can be used for fraudulent transactions.
This article will dissect how such a script works programmatically, the logic behind its design, the severe legal and ethical implications, and why understanding this code is crucial for defensive cybersecurity.
🚨 Disclaimer: This article is for educational purposes only. Writing, distributing, or using a CC checker script to validate unauthorized credit card data is a federal crime in most jurisdictions (18 U.S.C. § 1029 in the US, Computer Misuse Act in the UK). The author does not condone any illegal activity.
For e-commerce developers and system administrators, understanding CC checkers helps you block them.
The script analyzes the HTTP response code and body to determine "live" status:
| Gateway Response | Script Interpretation | Color Code |
|----------------|----------------------|-------------|
| 200 OK + "status":"succeeded" | LIVE ✅ (AVS/CVV match) | Green |
| 402 Payment Required | Insufficient funds 🟡 | Yellow |
| 400 - "invalid_cvc" | Dead ❌ (CVV mismatch) | Red |
| 401 Unauthorized | Dead (Card blocked) | Red |
| Timeout / 403 | Proxy dead or rate limited | Grey |