NullSec CertScan
February 27, 2026 Β· View on GitHub
TLS Certificate Scanner
A comprehensive TLS certificate analysis tool written in D, demonstrating systems programming with high-level features for security-focused certificate inspection.
π― Overview
NullSec CertScan analyzes TLS certificates for security weaknesses, expired certs, weak cryptography, and configuration issues. It provides actionable findings with MITRE ATT&CK technique mapping.
β¨ Features
- Expiration Detection - Identify expired and soon-to-expire certificates
- Key Strength Analysis - Detect weak RSA/EC key sizes
- Signature Algorithm Check - Flag MD5/SHA1 signatures
- Self-Signed Detection - Identify untrusted certificates
- Wildcard Analysis - Review wildcard certificate usage
- Security Scoring - 0-100 score per certificate
π Security Checks
| Check | Severity | MITRE |
|---|---|---|
| Expired Certificate | Critical | T1588.004 |
| MD5 Signature | Critical | T1557 |
| RSA < 2048 bits | Critical | T1557 |
| SHA-1 Signature | High | T1557 |
| Expiring < 30 days | High | - |
| Self-Signed | Medium | T1587.003 |
| Wildcard Certificate | Low | - |
π¦ Installation
# Clone the repository
git clone https://github.com/bad-antics/nullsec-certscan
cd nullsec-certscan
# Compile with DMD
dmd -O -release certscan.d -of=certscan
# Or with LDC
ldc2 -O2 certscan.d -of=certscan
# Run directly
rdmd certscan.d
π Usage
# Scan a host
./certscan example.com:443
# Show certificate chain
./certscan -c google.com
# Analyze certificate file
./certscan cert.pem
# JSON output
./certscan -j host.com
# Run demo mode
./certscan
π» Example Output
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NullSec CertScan - TLS Certificate Scanner β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[Demo Mode]
Analyzing sample certificates...
Certificate: CN=expired.example.com
Issuer: CN=Demo CA
Serial: ABC123
Valid: 2023-Jan-01 to 2024-Jan-01
Key: RSA 2048-bit
Signature: sha256WithRSA
SANs: expired.example.com, www.expired.example.com
Score: 60/100
Findings:
[CRITICAL] Expired Certificate
Certificate expired 180 days ago
β Replace with valid certificate immediately
MITRE: T1588.004
Certificate: CN=weak.example.com
Issuer: CN=Demo CA
Serial: DEF456
Valid: 2024-Jan-01 to 2026-Jan-01
Key: RSA 1024-bit
Signature: sha1WithRSA
SANs: weak.example.com
Score: 35/100
Findings:
[CRITICAL] Weak Key Size
RSA key is only 1024 bits (minimum 2048 recommended)
β Generate new certificate with 2048+ bit RSA key
MITRE: T1557
[HIGH] Weak Signature
Certificate uses SHA-1 signature (deprecated)
β Replace certificate with SHA-256 signed certificate
MITRE: T1557
βββββββββββββββββββββββββββββββββββββββββββ
Summary:
Certificates Analyzed: 5
Critical: 3
High: 1
Medium: 1
Low: 2
Average Score: 66/100
ποΈ Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Certificate Input β
β TLS Connection | PEM File | DER File β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Certificate Parser β
β Subject | Issuer | Validity | Key | Signature | SANs β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββ ββββββββββββ ββββββββββββ
βExpirationβ βKey Check β βSignature β
β Check β βRSA/EC β β Check β
ββββββββββββ ββββββββββββ ββββββββββββ
β β β
βββββββββββββββββΌββββββββββββββββ
βΌ
ββββββββββββββββ
βCertAnalysis β
βScore + Finds β
ββββββββββββββββ
π§ D Language Features
- Enums with Methods -
Severity,KeyType,SignatureAlgo - Structs -
Certificate,Finding,CertAnalysis - Ranges & Algorithms -
map,filter,sum - String Mixins - Compile-time code generation
- Final Switch - Exhaustive enum matching
- UFCS - Uniform Function Call Syntax
- Built-in Unit Tests -
unittestblocks
π Certificate Structure
struct Certificate {
string subject;
string issuer;
string serialNumber;
Date notBefore;
Date notAfter;
KeyType keyType;
int keySize;
SignatureAlgo signatureAlgo;
string[] subjectAltNames;
bool isSelfSigned;
bool isCA;
int chainPosition;
}
π‘οΈ Security Use Cases
- Certificate Audit - Scan all certificates in environment
- Compliance Check - Verify crypto standards compliance
- Vulnerability Assessment - Find weak certificate configs
- Monitoring - Alert on expiring certificates
- Incident Response - Identify rogue certificates
β οΈ Legal Disclaimer
This tool is intended for:
- β Authorized security assessments
- β Certificate management
- β Compliance auditing
- β Educational purposes
Only scan systems you're authorized to test.
π Links
- Portal: bad-antics.github.io
- Twitter: x.com/AnonAntics
- GitHub: github.com/bad-antics
π License
MIT License - See LICENSE file for details.
π·οΈ Version History
- v1.0.0 - Initial release with certificate analysis and scoring
Part of the NullSec Security Toolkit