Keep published counts synchronized

This commit is contained in:
0xMarcio committed 2026-09-02 00:54:09 +02:00
1 parent 55279dcfe5
commit aad1789a71
13 files changed
+163 -30

No files matched your search

+57 -9
View File
@@ -481,6 +481,54 @@ def live_pill(path: str, label: str, colour: str, link: str, stamp: str) -> str:
f"&labelColor=161b22&_={stamp})]({link})")
def count_stamp(counts: dict) -> str:
keys = ("total_cves", "with_pocs", "kev")
if any(not counts.get(key) for key in keys):
raise RuntimeError("docs/stats.json does not contain usable corpus counts")
return "-".join(str(int(counts[key])) for key in keys)
def refresh_count_header() -> int:
"""Update only the README figures after a corpus-changing sync."""
counts = figures()
stamp = count_stamp(counts)
with open(README, encoding="utf-8") as handle:
content = handle.read()
content, hero_replacements = re.subn(
rf"({re.escape(HERO_URL)}\?v=)[^\"]+",
rf"\g<1>{stamp}",
content,
count=1,
)
badges = {
"CVEs with PoCs": pill(
"CVEs with PoCs", f"{counts['with_pocs']:,}", "2f81f7",
"https://cve.codepwn.win/",
),
"known exploited": pill(
"known exploited", f"{counts['kev']:,}", "f85149",
"https://cve.codepwn.win/",
),
}
badge_replacements = 0
for label, badge in badges.items():
content, replaced = re.subn(
rf"\[!\[{re.escape(label)}\]\([^)]+\)\]\([^)]+\)",
lambda _: badge,
content,
count=1,
)
badge_replacements += replaced
if hero_replacements != 1 or badge_replacements != len(badges):
raise RuntimeError("README count header is missing an expected field")
with open(README, "w", encoding="utf-8") as handle:
handle.write(content)
print(f"Updated README counts to {stamp}")
return 0
def header(stamp: str, synced: str) -> list[str]:
"""Everything above the tables. The banner carries a cache-busting stamp
because GitHub proxies README images and would otherwise serve a stale copy
@@ -501,10 +549,12 @@ def header(stamp: str, synced: str) -> list[str]:
return [
'<div align="center">',
"",
f'<a href="{home}"><img src="{HERO_URL}?v={stamp}" alt="CVE Radar" width="100%"></a>',
f'<a href="{home}"><img src="{HERO_URL}?v={count_stamp(counts)}" alt="CVE Radar" width="100%"></a>',
"",
"&nbsp;".join(badges),
"",
f'<a href="{home}">cve.codepwn.win</a>',
"",
"</div>",
"",
]
@@ -665,15 +715,8 @@ def main() -> int:
# No hyphens: they are the field separator in a shields badge path.
synced = now.strftime("%d %b %Y %H:%M UTC")
lines = header(stamp, synced)
lines.append(f"Exploit repositories with a commit in the last {WINDOW_DAYS} days, "
f"newest first. {KEV_MARK.strip()} marks a CVE CISA lists as "
f"exploited in the wild.")
lines.append("")
if landed:
lines.append(f"## Just landed &middot; last {LANDED_DAYS} days")
lines.append("")
lines.append("No star floor here, so a PoC published this morning shows up "
"the same day rather than once it has been noticed.")
lines.append("## Just landed")
lines.append("")
lines.append("| Stars | Updated | Repository | Description |")
lines.append("| --- | --- | --- | --- |")
@@ -727,4 +770,9 @@ def main() -> int:
if __name__ == "__main__":
if sys.argv[1:] == ["--counts-only"]:
raise SystemExit(refresh_count_header())
if sys.argv[1:]:
print("usage: getTrending.py [--counts-only]", file=sys.stderr)
raise SystemExit(2)
raise SystemExit(main())
+9
View File
@@ -32,6 +32,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python3 scripts/audit_poc_links.py --limit 12000 --references 12000
- name: Refresh published counts
run: |
python3 .github/hero.py
python3 .github/getTrending.py --counts-only
- name: Check for changes and commit
run: |
git config user.name 'CVE-BOT'
@@ -43,6 +48,10 @@ jobs:
index/repo_meta.json \
index/kev.json \
index/references.txt \
README.md \
docs/hero.svg \
docs/social-card.svg \
docs/stats.json \
cves/
if git diff --cached --quiet; then
+10
View File
@@ -32,6 +32,16 @@ jobs:
- name: Build site data
run: python3 scripts/build_site.py
- name: Verify published counts
run: |
python3 .github/hero.py
python3 .github/getTrending.py --counts-only
git diff --exit-code -- \
README.md \
docs/hero.svg \
docs/social-card.svg \
docs/stats.json
- name: Configure Pages
uses: actions/configure-pages@v6
+13 -1
View File
@@ -32,11 +32,23 @@ jobs:
python3 -m unittest discover -s tests
python3 scripts/build_site.py
- name: Refresh published counts
run: |
python3 .github/hero.py
python3 .github/getTrending.py --counts-only
- name: Check for changes and commit
run: |
git config user.name 'CVE-BOT'
git config user.email '[email protected]'
git add --all -- index/cve_dates.json index/cve_record_state.json cves/
git add --all -- \
README.md \
docs/hero.svg \
docs/social-card.svg \
docs/stats.json \
index/cve_dates.json \
index/cve_record_state.json \
cves/
if git diff --cached --quiet; then
echo "No changes to commit"
+9
View File
@@ -34,6 +34,11 @@ jobs:
python3 -m unittest discover -s tests
python3 scripts/build_site.py
- name: Refresh published counts
run: |
python3 .github/hero.py
python3 .github/getTrending.py --counts-only
- name: Check for changes and commit
run: |
git config user.name 'CVE-BOT'
@@ -46,6 +51,10 @@ jobs:
index/reference_pocs.txt \
index/cve_dates.json \
index/cve_record_state.json \
README.md \
docs/hero.svg \
docs/social-card.svg \
docs/stats.json \
cves/
if git diff --cached --quiet; then
+13 -1
View File
@@ -32,11 +32,23 @@ jobs:
python3 -m unittest discover -s tests
python3 scripts/build_site.py
- name: Refresh published counts
run: |
python3 .github/hero.py
python3 .github/getTrending.py --counts-only
- name: Check for changes and commit
run: |
git config user.name 'CVE-BOT'
git config user.email '[email protected]'
git add --all -- index/cve_dates.json index/cve_record_state.json cves/
git add --all -- \
README.md \
docs/hero.svg \
docs/social-card.svg \
docs/stats.json \
index/cve_dates.json \
index/cve_record_state.json \
cves/
if git diff --cached --quiet; then
echo "No changes to commit"
+9
View File
@@ -49,12 +49,21 @@ jobs:
python3 -m unittest discover -s tests
python3 scripts/build_site.py
- name: Refresh published counts
run: |
python3 .github/hero.py
python3 .github/getTrending.py --counts-only
- name: Check for changes and commit
run: |
git config user.name 'CVE-BOT'
git config user.email '[email protected]'
git add -- \
README.md \
cves/ \
docs/hero.svg \
docs/social-card.svg \
docs/stats.json \
index/cve_dates.json \
index/cve_record_state.json \
index/github_advisories.json \
+14 -1
View File
@@ -32,11 +32,24 @@ jobs:
python3 -m unittest discover -s tests
python3 scripts/build_site.py
- name: Refresh published counts
run: |
python3 .github/hero.py
python3 .github/getTrending.py --counts-only
- name: Check for changes and commit
run: |
git config user.name 'CVE-BOT'
git config user.email '[email protected]'
git add --all -- index/cve_dates.json index/cve_record_state.json index/nuclei.json cves/
git add --all -- \
README.md \
docs/hero.svg \
docs/social-card.svg \
docs/stats.json \
index/cve_dates.json \
index/cve_record_state.json \
index/nuclei.json \
cves/
if git diff --cached --quiet; then
echo "No changes to commit"
exit 0
+14 -1
View File
@@ -38,11 +38,24 @@ jobs:
python3 -m unittest discover -s tests
python3 scripts/build_site.py
- name: Refresh published counts
run: |
python3 .github/hero.py
python3 .github/getTrending.py --counts-only
- name: Check for changes and commit
run: |
git config user.name 'CVE-BOT'
git config user.email '[email protected]'
git add --all -- index/github.txt index/cve_dates.json index/cve_record_state.json cves/
git add --all -- \
README.md \
docs/hero.svg \
docs/social-card.svg \
docs/stats.json \
index/github.txt \
index/cve_dates.json \
index/cve_record_state.json \
cves/
if git diff --cached --quiet; then
echo "No changes to commit"
+5 -7
View File
@@ -1,16 +1,14 @@
<div align="center">
<a href="https://cve.codepwn.win/"><img src="https://raw.githubusercontent.com/0xMarcio/cve/main/docs/hero.svg?v=202609012240" alt="CVE Radar" width="100%"></a>
<a href="https://cve.codepwn.win/"><img src="https://raw.githubusercontent.com/0xMarcio/cve/main/docs/hero.svg?v=170946-82409-1181" alt="CVE Radar" width="100%"></a>
[![last sync](https://img.shields.io/badge/last%20sync-01%20Sep%202026%2022%3A40%20UTC-2f81f7?style=flat-square&labelColor=161b22)](https://github.com/0xMarcio/cve/commits/main)&nbsp;[![CI](https://img.shields.io/github/actions/workflow/status/0xMarcio/cve/hot_cves.yml?style=flat-square&label=CI&color=2f81f7&labelColor=161b22&_=202609012240)](https://github.com/0xMarcio/cve/actions/workflows/hot_cves.yml)&nbsp;[![CVEs with PoCs](https://img.shields.io/badge/CVEs%20with%20PoCs-91%2C895-2f81f7?style=flat-square&labelColor=161b22)](https://cve.codepwn.win/)&nbsp;[![known exploited](https://img.shields.io/badge/known%20exploited-1%2C190-f85149?style=flat-square&labelColor=161b22)](https://cve.codepwn.win/)&nbsp;[![stars](https://img.shields.io/github/stars/0xMarcio/cve?style=flat-square&label=stars&color=e3b341&labelColor=161b22&_=202609012240)](https://github.com/0xMarcio/cve/stargazers)
[![last sync](https://img.shields.io/badge/last%20sync-01%20Sep%202026%2022%3A40%20UTC-2f81f7?style=flat-square&labelColor=161b22)](https://github.com/0xMarcio/cve/commits/main)&nbsp;[![CI](https://img.shields.io/github/actions/workflow/status/0xMarcio/cve/hot_cves.yml?style=flat-square&label=CI&color=2f81f7&labelColor=161b22&_=202609012240)](https://github.com/0xMarcio/cve/actions/workflows/hot_cves.yml)&nbsp;[![CVEs with PoCs](https://img.shields.io/badge/CVEs%20with%20PoCs-82%2C409-2f81f7?style=flat-square&labelColor=161b22)](https://cve.codepwn.win/)&nbsp;[![known exploited](https://img.shields.io/badge/known%20exploited-1%2C181-f85149?style=flat-square&labelColor=161b22)](https://cve.codepwn.win/)&nbsp;[![stars](https://img.shields.io/github/stars/0xMarcio/cve?style=flat-square&label=stars&color=e3b341&labelColor=161b22&_=202609012240)](https://github.com/0xMarcio/cve/stargazers)
<a href="https://cve.codepwn.win/">cve.codepwn.win</a>
</div>
Exploit repositories with a commit in the last 90 days, newest first. <img src="https://raw.githubusercontent.com/0xMarcio/cve/main/docs/kev.svg" alt="KEV" title="CISA known exploited" height="14"> marks a CVE CISA lists as exploited in the wild.
## Just landed &middot; last 10 days
No star floor here, so a PoC published this morning shows up the same day rather than once it has been noticed.
## Just landed
| Stars | Updated | Repository | Description |
| --- | --- | --- | --- |
+4 -4
View File
@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="180" viewBox="0 0 1200 180"
role="img" aria-label="CVE Radar, 91,895 CVEs with public proof-of-concept exploits">
role="img" aria-label="CVE Radar, 82,409 CVEs with public proof-of-concept exploits">
<clipPath id="card"><rect x="1" y="1" width="1198" height="178" rx="12"/></clipPath>
<rect x="0.5" y="0.5" width="1199" height="179" rx="12" fill="#0d1117" stroke="#30363d"/>
<g clip-path="url(#card)" opacity="0.6"><g>
@@ -19,13 +19,13 @@
<text x="56" y="132" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="15" fill="#2f81f7">cve.codepwn.win</text>
<text x="620" y="96" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="34" font-weight="700"
fill="#e6edf3" letter-spacing="-0.5">168,780</text>
fill="#e6edf3" letter-spacing="-0.5">170,946</text>
<text x="620" y="117" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="12"
fill="#6e7681" letter-spacing="1.6">CVES INDEXED</text><text x="840" y="96" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="34" font-weight="700"
fill="#2f81f7" letter-spacing="-0.5">91,895</text>
fill="#2f81f7" letter-spacing="-0.5">82,409</text>
<text x="840" y="117" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="12"
fill="#6e7681" letter-spacing="1.6">WITH POCS</text><text x="1010" y="96" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="34" font-weight="700"
fill="#f85149" letter-spacing="-0.5">1,190</text>
fill="#f85149" letter-spacing="-0.5">1,181</text>
<text x="1010" y="117" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="12"
fill="#6e7681" letter-spacing="1.6">KNOWN EXPLOITED</text>
</svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

+3 -3
View File
@@ -20,13 +20,13 @@
<rect x="96" y="344" width="1088" height="1" fill="#30363d"/>
<text x="96" y="430" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="46" font-weight="700"
fill="#e6edf3" letter-spacing="-0.5">168,780</text>
fill="#e6edf3" letter-spacing="-0.5">170,946</text>
<text x="96" y="459" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="16"
fill="#6e7681" letter-spacing="1.6">CVES INDEXED</text><text x="500" y="430" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="46" font-weight="700"
fill="#2f81f7" letter-spacing="-0.5">91,895</text>
fill="#2f81f7" letter-spacing="-0.5">82,409</text>
<text x="500" y="459" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="16"
fill="#6e7681" letter-spacing="1.6">WITH POCS</text><text x="880" y="430" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="46" font-weight="700"
fill="#f85149" letter-spacing="-0.5">1,190</text>
fill="#f85149" letter-spacing="-0.5">1,181</text>
<text x="880" y="459" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="16"
fill="#6e7681" letter-spacing="1.6">KNOWN EXPLOITED</text>

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

+3 -3
View File
@@ -1,5 +1,5 @@
{
"kev": 1190,
"total_cves": 168780,
"with_pocs": 91895
"kev": 1181,
"total_cves": 170946,
"with_pocs": 82409
}