Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
234 commits
Select commit Hold shift + click to select a range
7eded96
improved config sanitization
TheTechromancer Jul 9, 2025
1c07feb
unsafe regex tweak
TheTechromancer Jul 9, 2025
37ad1b9
Add pytest-benchmark infrastructure with bloom filter benchmarks
liquidsec Aug 14, 2025
0688e06
Complete GitHub Actions workflow integration with branch-based benchm…
liquidsec Aug 14, 2025
717b365
removing ai slop
liquidsec Aug 14, 2025
756d3c1
cleanup
liquidsec Aug 14, 2025
527f018
handle first run
liquidsec Aug 14, 2025
61a4e9f
escaping
liquidsec Aug 14, 2025
28bb950
refinements
liquidsec Aug 14, 2025
31b96cf
visual tweaks
liquidsec Aug 14, 2025
1b0b3a5
run on every branch
liquidsec Aug 14, 2025
37ad392
fixing AI slop
liquidsec Aug 14, 2025
706a049
report tweak
liquidsec Aug 14, 2025
26bc1b4
event validation benchmark
liquidsec Aug 15, 2025
f7dd83d
Fix GitHub Actions benchmark comment update logic
liquidsec Aug 15, 2025
059266e
collapsible when theres no comparison
liquidsec Aug 15, 2025
b50d099
better report structure
liquidsec Aug 15, 2025
d2d0152
more report formatting
liquidsec Aug 15, 2025
10d3386
more tests
liquidsec Aug 15, 2025
f29f40c
remove stupid tests
liquidsec Aug 15, 2025
bffdb8d
use 429_sleep_interval for subdomaincenter
indeed404 Aug 18, 2025
4bcc0e1
helperify git sanitization
TheTechromancer Aug 18, 2025
38bdc18
tests were not even running?
liquidsec Aug 18, 2025
86e4039
instead of sanitizing git config, just get rid of it
TheTechromancer Aug 18, 2025
db573a9
move the index file instead of deleting it
TheTechromancer Aug 18, 2025
5d89abc
update dnsbimi regex
liquidsec Aug 18, 2025
428d438
better regex
liquidsec Aug 18, 2025
91600cf
better regex again
liquidsec Aug 18, 2025
bbce296
wtf codeql
liquidsec Aug 18, 2025
ba6053f
ruff format
liquidsec Aug 18, 2025
0a8ceac
Bump h11 from 0.14.0 to 0.16.0
dependabot[bot] Aug 18, 2025
664b7b3
Merge pull request #2608 from blacklanternsecurity/dnsbimi-regex
liquidsec Aug 19, 2025
0b17151
Merge pull request #2609 from blacklanternsecurity/dependabot/pip/h11…
liquidsec Aug 19, 2025
3486cf2
bump version 2.7.0
liquidsec Aug 19, 2025
1424a51
[create-pull-request] automated change
TheTechromancer Aug 19, 2025
aa2eb4e
Merge branch 'dev' into stable
indeed404 Aug 19, 2025
c6d4fee
better error handling with lightfuzz + interactsh
liquidsec Aug 19, 2025
9b01860
Merge pull request #2612 from blacklanternsecurity/update-docs
liquidsec Aug 19, 2025
710bc49
retire.js initiial
liquidsec Aug 19, 2025
a49dc43
fix metadata
liquidsec Aug 19, 2025
aad6b2e
Merge branch 'dev' into stable
indeed404 Aug 20, 2025
ce09765
Merge pull request #2611 from blacklanternsecurity/version-bump-2-7-0
TheTechromancer Aug 20, 2025
5f7895d
Merge pull request #2616 from blacklanternsecurity/lightfuzz-interact…
liquidsec Aug 20, 2025
fd2158a
refactor subdomaincenter to use newer api_request function
indeed404 Aug 20, 2025
62b8813
remove passing default value as parameter
indeed404 Aug 20, 2025
b8c8a39
add module test retirejs
liquidsec Aug 20, 2025
f11af68
ruff format
liquidsec Aug 20, 2025
c221e5d
Merge pull request #2605 from indeed404/stable
liquidsec Aug 20, 2025
6a681f4
ruff check fixes
liquidsec Aug 20, 2025
64a2ca4
lint
liquidsec Aug 21, 2025
8d4f872
poetry.lock
liquidsec Aug 21, 2025
15b92cb
Merge branch 'dev' into retire-js
liquidsec Aug 21, 2025
fb12261
hopefully better ansible script
liquidsec Aug 21, 2025
0097f7b
removing more httpx_only references
liquidsec Aug 21, 2025
c1f218d
adding timeouts to multiprocessing test
liquidsec Aug 21, 2025
c586fda
adding proxy passthru to rau_crypto
liquidsec Aug 21, 2025
1767bc3
THE SPELLCHECKER BROKE THIS 😡😡😡!
liquidsec Aug 21, 2025
9ff59af
ruff format
liquidsec Aug 21, 2025
710d0f9
this test was testing for the continued existence of a bug 💀
liquidsec Aug 21, 2025
675d38e
the spellchecker strikes again 😒
liquidsec Aug 21, 2025
6150b40
fixing test
liquidsec Aug 21, 2025
eddf81f
add excavate benchmarks
liquidsec Aug 22, 2025
1012841
fix tests
liquidsec Aug 22, 2025
effa071
increase benchmark
liquidsec Aug 22, 2025
7c31bcf
a much better excavate benchmark
liquidsec Aug 22, 2025
0a4f078
Merge pull request #2622 from blacklanternsecurity/telerik-proxy
liquidsec Aug 22, 2025
c7261d5
pin node version, only install in local bbot folder (not systemwide)
liquidsec Aug 22, 2025
117e147
tweaking benchmark report
liquidsec Aug 22, 2025
505e361
fixing excavate test
liquidsec Aug 22, 2025
a9540ce
make node and npm executable
liquidsec Aug 22, 2025
71e78f0
lint
liquidsec Aug 22, 2025
800b847
add regex report initial
liquidsec Aug 22, 2025
9eb343e
avoid output dir collisions
TheTechromancer Aug 22, 2025
e6d8a3c
hopefully final ansible adjustment
liquidsec Aug 22, 2025
37e5f57
lint again
liquidsec Aug 22, 2025
436cce2
improved report format
liquidsec Aug 22, 2025
3e5f8c2
skip more folders
liquidsec Aug 22, 2025
e7134c8
dont test untestable regex
liquidsec Aug 22, 2025
50b6dee
emoji
liquidsec Aug 22, 2025
dd88dfe
hopefully last deps fix
liquidsec Aug 22, 2025
c9ae154
Fix regex benchmarks being mixed with regular benchmarks in comparison
liquidsec Aug 22, 2025
2b50b54
Fix comment detection to handle emoji in report title
liquidsec Aug 22, 2025
eeba1b1
Fix regex analysis lookup path in generate_report function
liquidsec Aug 22, 2025
be541e0
Move regex analysis outside benchmark success check
liquidsec Aug 22, 2025
cf3e386
Initialize data structures with machine_info for regex analysis
liquidsec Aug 22, 2025
c1f3a8e
Fix report variable scope issue in generate_report function
liquidsec Aug 22, 2025
e2db947
lint
liquidsec Aug 22, 2025
59d8bec
new benchmarks
liquidsec Aug 22, 2025
a549f54
Merge branch 'dev' into benchmark-tests
liquidsec Aug 22, 2025
15c503c
lint
liquidsec Aug 22, 2025
37a6ff7
Merge remote-tracking branch 'refs/remotes/origin/benchmark-tests' in…
liquidsec Aug 22, 2025
43e9da5
better commenting behavior, show results even without target branch data
liquidsec Aug 22, 2025
50f9191
maybe finally fixing comment behavior
liquidsec Aug 22, 2025
d6bb185
Fix: Fix with GIT_ASKPASS for .git/config token
noob6t5 Aug 23, 2025
2ec59a0
Update nuclei
blsaccess Aug 23, 2025
99e15b1
Fix: With Inline & no temp file
noob6t5 Aug 24, 2025
d47bf93
Merge pull request #2626 from blacklanternsecurity/update-nuclei
liquidsec Aug 24, 2025
eb2b089
[create-pull-request] automated change
TheTechromancer Aug 25, 2025
1105934
Bump cloudcheck from 7.2.29 to 7.2.114
dependabot[bot] Aug 25, 2025
a58f3e2
Bump beautifulsoup4 from 4.13.4 to 4.13.5
dependabot[bot] Aug 25, 2025
faab783
Bump orjson from 3.11.1 to 3.11.2
dependabot[bot] Aug 25, 2025
5d06b86
Bump mmh3 from 5.1.0 to 5.2.0
dependabot[bot] Aug 25, 2025
7d0a37c
Bump ruff from 0.12.9 to 0.12.10
dependabot[bot] Aug 25, 2025
3b28ca2
Bump lxml from 6.0.0 to 6.0.1
dependabot[bot] Aug 25, 2025
ff885e2
Bump mkdocstrings-python from 1.16.11 to 1.17.0
dependabot[bot] Aug 25, 2025
1bd8d59
increase retire js concurrency
liquidsec Aug 25, 2025
6325f2f
abort unarchival if dest dir already exists
TheTechromancer Aug 25, 2025
9eaeaeb
fixing ansible
liquidsec Aug 25, 2025
cdadf77
error handling
TheTechromancer Aug 25, 2025
0ee74c4
ignore ssl warnings
liquidsec Aug 25, 2025
0ac8687
move validation to extract_file()
TheTechromancer Aug 25, 2025
14d0630
download repo file ourselves and cache
liquidsec Aug 25, 2025
9bdcef3
add severity filter
liquidsec Aug 25, 2025
df53b0b
Merge pull request #2634 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Aug 25, 2025
7058def
Merge pull request #2636 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Aug 25, 2025
cd519ab
Merge pull request #2627 from blacklanternsecurity/update-docs
liquidsec Aug 25, 2025
7e28f2e
Merge pull request #2628 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Aug 25, 2025
d58178c
Merge pull request #2630 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Aug 25, 2025
5ed736a
Merge pull request #2632 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Aug 25, 2025
1e7fca9
Merge pull request #2631 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Aug 25, 2025
74efb03
Merge pull request #2637 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Aug 25, 2025
a1092d9
Merge branch 'dev' into benchmark-tests
liquidsec Aug 25, 2025
669ae9a
deps stuff
liquidsec Aug 25, 2025
ddef37c
Merge pull request #2625 from noob6t5/solve-gitconfig
liquidsec Aug 25, 2025
c9f8df1
linting
TheTechromancer Aug 25, 2025
3708135
remove comment
TheTechromancer Aug 25, 2025
254d5d9
reorg
TheTechromancer Aug 25, 2025
5d70c1a
missing ok=true
TheTechromancer Aug 25, 2025
b2b02f4
error handling
TheTechromancer Aug 25, 2025
108e038
reverted unnecessary changes
liquidsec Aug 25, 2025
786760b
Bump deepdiff from 8.5.0 to 8.6.0
dependabot[bot] Aug 25, 2025
5ed03af
Bump pyzmq from 26.4.0 to 27.0.2
dependabot[bot] Aug 25, 2025
e0b70fb
Bump mkdocs-material from 9.6.17 to 9.6.18
dependabot[bot] Aug 25, 2025
c6ec535
github domain check
liquidsec Aug 25, 2025
bb80db2
consistent variable naming
liquidsec Aug 25, 2025
da6370b
fixing non http use case, variable name consistency
liquidsec Aug 25, 2025
2271c53
Merge pull request #2629 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Aug 25, 2025
28d7b86
Merge pull request #2635 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Aug 25, 2025
c890c95
Merge pull request #2638 from blacklanternsecurity/github-own-token-d…
TheTechromancer Aug 25, 2025
0821617
Merge pull request #2633 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Aug 25, 2025
e7b254d
Fix: Empty Folder
noob6t5 Aug 26, 2025
d20a654
Use self.helpers.mkdir instead of raw mkdir & ruff formatting
noob6t5 Aug 26, 2025
d716e7f
Merge branch 'dev' into solve-empty-folder
noob6t5 Aug 26, 2025
df0a0f5
Merge pull request #2642 from noob6t5/solve-empty-folder
liquidsec Aug 26, 2025
1d5f387
small tweaks
TheTechromancer Aug 26, 2025
2bad2b4
Update defaults.yml
TheTechromancer Aug 26, 2025
8a6bdba
Merge pull request #2617 from blacklanternsecurity/retire-js
liquidsec Aug 27, 2025
c919c6a
added new excavate test for in-scope js files
liquidsec Aug 27, 2025
bd20701
additional assertion
liquidsec Aug 27, 2025
68864e0
improve excavate benchmark, remove regex testing for now
liquidsec Aug 27, 2025
b8d08bd
lint
liquidsec Aug 27, 2025
dc6b739
Merge branch 'dev' into benchmark-tests
liquidsec Aug 27, 2025
a7d8c3c
poetry.lock
liquidsec Aug 27, 2025
b7624b1
lint
liquidsec Aug 27, 2025
2034792
remove dead code
liquidsec Aug 27, 2025
0d90f7c
bug fix
liquidsec Aug 27, 2025
f13e641
restore cookie functionality
liquidsec Aug 27, 2025
fc65d5f
revert logging removal
liquidsec Aug 27, 2025
a7fd650
undo removal
liquidsec Aug 27, 2025
c94ca17
remove dead code
liquidsec Aug 27, 2025
a55c16d
Merge remote-tracking branch 'refs/remotes/origin/deadcode-cleanup' i…
liquidsec Aug 27, 2025
a8cb5be
revert
liquidsec Aug 27, 2025
66f3ad3
lint
liquidsec Aug 27, 2025
785d9f9
Fix benchmark ops/sec calculation: use correct operation counts for m…
liquidsec Aug 27, 2025
c302cab
Fix event validation benchmark tests ConfigTypeError
liquidsec Aug 27, 2025
e2d7dcb
lint
liquidsec Aug 27, 2025
270f833
fix install
liquidsec Aug 27, 2025
bced885
cosmetic
liquidsec Aug 27, 2025
1f16f9a
fix permissions issue
liquidsec Aug 27, 2025
109e673
trying again
liquidsec Aug 27, 2025
2e367a4
[create-pull-request] automated change
TheTechromancer Aug 28, 2025
dc1d413
Merge pull request #2645 from blacklanternsecurity/excavate-js-test
liquidsec Aug 28, 2025
0c8e929
Merge pull request #2649 from blacklanternsecurity/update-docs
liquidsec Aug 28, 2025
2111075
improve retirejs anisible playboook
liquidsec Aug 28, 2025
9e25ea2
simply retirejs installation
liquidsec Aug 28, 2025
a0cf04b
further improvements
liquidsec Aug 28, 2025
63eb668
just some minor adjustments
liquidsec Aug 28, 2025
672db3e
Merge pull request #2648 from blacklanternsecurity/retire-js-install-fix
TheTechromancer Aug 28, 2025
06a127b
more iterations
liquidsec Aug 28, 2025
fd28cf7
Bump h11 from 0.14.0 to 0.16.0
dependabot[bot] Aug 28, 2025
3edc16a
Bump tornado from 6.4.2 to 6.5
dependabot[bot] Aug 28, 2025
585ea5c
Bump requests from 2.32.3 to 2.32.4
dependabot[bot] Aug 28, 2025
0387b7f
Bump starlette from 0.46.2 to 0.47.2
dependabot[bot] Aug 28, 2025
0a30780
Merge pull request #2653 from blacklanternsecurity/dependabot/pip/h11…
liquidsec Aug 28, 2025
417abb7
Merge pull request #2654 from blacklanternsecurity/dependabot/pip/tor…
liquidsec Aug 28, 2025
19aa423
Merge pull request #2655 from blacklanternsecurity/dependabot/pip/req…
liquidsec Aug 28, 2025
e53c788
Merge pull request #2656 from blacklanternsecurity/dependabot/pip/sta…
liquidsec Aug 28, 2025
9773cbc
Bump cachetools from 6.1.0 to 6.2.0
dependabot[bot] Sep 1, 2025
7cba17c
Bump ruff from 0.12.10 to 0.12.11
dependabot[bot] Sep 1, 2025
2da697b
Bump orjson from 3.11.2 to 3.11.3
dependabot[bot] Sep 1, 2025
663cda1
Merge pull request #2661 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Sep 2, 2025
1100152
Merge pull request #2660 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Sep 2, 2025
a736348
Merge pull request #2647 from blacklanternsecurity/deadcode-cleanup
TheTechromancer Sep 2, 2025
eabdd69
[create-pull-request] automated change
TheTechromancer Sep 3, 2025
9c50bd5
renaming test names
liquidsec Sep 3, 2025
da2e9dd
Merge pull request #2668 from blacklanternsecurity/update-docs
liquidsec Sep 3, 2025
848266c
Merge pull request #2662 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Sep 3, 2025
111dc1e
Merge branch 'dev' into benchmark-tests
liquidsec Sep 3, 2025
e76e1b8
poetry.lock update
liquidsec Sep 3, 2025
697884f
update comment
TheTechromancer Sep 3, 2025
61b6c61
cat walked on keyboard
TheTechromancer Sep 3, 2025
e03356b
Merge pull request #2591 from blacklanternsecurity/benchmark-tests
liquidsec Sep 4, 2025
f207c2f
Bump pytest-rerunfailures from 15.1 to 16.0
dependabot[bot] Sep 4, 2025
bd56db8
Merge pull request #2659 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Sep 4, 2025
b8dfd69
Bump mkdocstrings-python from 1.17.0 to 1.18.2
dependabot[bot] Sep 4, 2025
6e7ea13
bloomfilter-optimize
liquidsec Sep 4, 2025
f88b974
Merge pull request #2663 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Sep 4, 2025
7c8594c
Merge pull request #2674 from blacklanternsecurity/bloom-performance
TheTechromancer Sep 4, 2025
7def948
Update trufflehog
blsaccess Sep 5, 2025
aa6667d
Merge pull request #2675 from blacklanternsecurity/update-trufflehog
liquidsec Sep 5, 2025
3d83ecc
fix: docs module ref of nmap replaced with portscan
GangGreenTemperTatum Sep 6, 2025
bd9a0ca
Merge pull request #2678 from GangGreenTemperTatum/ads/docs-fix-examp…
TheTechromancer Sep 6, 2025
3100910
Bump mkdocs-material from 9.6.18 to 9.6.19
dependabot[bot] Sep 8, 2025
564dd25
Bump pytest from 8.4.1 to 8.4.2
dependabot[bot] Sep 8, 2025
1e4527b
Bump deepdiff from 8.6.0 to 8.6.1
dependabot[bot] Sep 8, 2025
7c62b6b
Bump pytest-benchmark from 4.0.0 to 5.1.0
dependabot[bot] Sep 8, 2025
0771a8c
Bump setproctitle from 1.3.6 to 1.3.7
dependabot[bot] Sep 8, 2025
3cf7079
Bump the github-actions group with 4 updates
dependabot[bot] Sep 8, 2025
f95eca1
Merge pull request #2686 from blacklanternsecurity/dependabot/github_…
TheTechromancer Sep 8, 2025
9ae9dd9
Merge pull request #2681 from blacklanternsecurity/dependabot/pip/dev…
TheTechromancer Sep 8, 2025
688b7ec
Merge pull request #2680 from blacklanternsecurity/dependabot/pip/dev…
TheTechromancer Sep 8, 2025
58ecbb6
Merge pull request #2679 from blacklanternsecurity/dependabot/pip/dev…
TheTechromancer Sep 8, 2025
107fb2c
Merge pull request #2683 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Sep 8, 2025
212be84
Merge pull request #2685 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Sep 8, 2025
6790598
Bump pytest-cov from 6.2.1 to 6.3.0
dependabot[bot] Sep 8, 2025
b86568c
[create-pull-request] automated change
TheTechromancer Sep 9, 2025
1f103ea
Merge pull request #2684 from blacklanternsecurity/dependabot/pip/dev…
liquidsec Sep 9, 2025
4ce929a
Merge pull request #2677 from blacklanternsecurity/update-docs
liquidsec Sep 9, 2025
0ede97f
Merge commit from fork
TheTechromancer Sep 11, 2025
27253fe
Merge commit from fork
TheTechromancer Sep 11, 2025
93f0731
fix tests
TheTechromancer Sep 11, 2025
61894ad
Merge pull request #2690 from blacklanternsecurity/fix-tests
TheTechromancer Sep 11, 2025
c3b8d66
In the case it short-circuits `not response`, adjust the self.debug.
ausmaster Sep 11, 2025
d7885f8
Merge pull request #2691 from blacklanternsecurity/fix-graphql-module
TheTechromancer Sep 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
name: Performance Benchmarks

on:
pull_request:
paths:
- 'bbot/**/*.py'
- 'pyproject.toml'
- '.github/workflows/benchmark.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write

jobs:
benchmark:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Need full history for branch comparison

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"

- name: Install dependencies
run: |
pip install poetry
poetry install --with dev

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libmagic1

# Generate benchmark comparison report using our branch-based script
- name: Generate benchmark comparison report
run: |
poetry run python bbot/scripts/benchmark_report.py \
--base ${{ github.base_ref }} \
--current ${{ github.head_ref }} \
--output benchmark_report.md \
--keep-results
continue-on-error: true

# Upload benchmark results as artifacts
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: |
benchmark_report.md
base_benchmark_results.json
current_benchmark_results.json
retention-days: 30

# Comment on PR with benchmark results
- name: Comment benchmark results on PR
uses: actions/github-script@v8
with:
script: |
const fs = require('fs');

try {
const report = fs.readFileSync('benchmark_report.md', 'utf8');

// Find existing benchmark comment (with pagination)
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
per_page: 100, // Get more comments per page
});

// Debug: log all comments to see what we're working with
console.log(`Found ${comments.data.length} comments on this PR`);
comments.data.forEach((comment, index) => {
console.log(`Comment ${index}: user=${comment.user.login}, body preview="${comment.body.substring(0, 100)}..."`);
});

const existingComments = comments.data.filter(comment =>
comment.body.toLowerCase().includes('performance benchmark') &&
comment.user.login === 'github-actions[bot]'
);

console.log(`Found ${existingComments.length} existing benchmark comments`);

if (existingComments.length > 0) {
// Sort comments by creation date to find the most recent
const sortedComments = existingComments.sort((a, b) =>
new Date(b.created_at) - new Date(a.created_at)
);

const mostRecentComment = sortedComments[0];
console.log(`Updating most recent benchmark comment: ${mostRecentComment.id} (created: ${mostRecentComment.created_at})`);

await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: mostRecentComment.id,
body: report
});
console.log('Updated existing benchmark comment');

// Delete any older duplicate comments
if (existingComments.length > 1) {
console.log(`Deleting ${existingComments.length - 1} older duplicate comments`);
for (let i = 1; i < sortedComments.length; i++) {
const commentToDelete = sortedComments[i];
console.log(`Attempting to delete comment ${commentToDelete.id} (created: ${commentToDelete.created_at})`);

try {
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: commentToDelete.id
});
console.log(`Successfully deleted duplicate comment: ${commentToDelete.id}`);
} catch (error) {
console.error(`Failed to delete comment ${commentToDelete.id}: ${error.message}`);
console.error(`Error details:`, error);
}
}
}
} else {
// Create new comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: report
});
console.log('Created new benchmark comment');
}
} catch (error) {
console.error('Failed to post benchmark results:', error);

// Post a fallback comment
const fallbackMessage = [
'## Performance Benchmark Report',
'',
'> ⚠️ **Failed to generate detailed benchmark comparison**',
'> ',
'> The benchmark comparison failed to run. This might be because:',
'> - Benchmark tests don\'t exist on the base branch yet',
'> - Dependencies are missing',
'> - Test execution failed',
'> ',
'> Please check the [workflow logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.',
'> ',
'> 📁 Benchmark artifacts may be available for download from the workflow run.'
].join('\\n');

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: fallbackMessage
});
}
2 changes: 1 addition & 1 deletion .github/workflows/docs_updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
token: ${{ secrets.BBOT_DOCS_UPDATER_PAT }}
ref: dev # Checkout the dev branch
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Set Python Version Environment Variable
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install dependencies
Expand All @@ -72,7 +72,7 @@ jobs:
run: python -m build
- name: Publish Pypi package
if: github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/dev'
uses: pypa/gh-action-pypi-publish@release/v1.12
uses: pypa/gh-action-pypi-publish@release/v1.13
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Get BBOT version
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
- uses: actions/checkout@v5
with:
token: ${{ secrets.BBOT_DOCS_UPDATER_PAT }}
- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/version_updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fetch-depth: 0
token: ${{ secrets.BBOT_DOCS_UPDATER_PAT }}
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install dependencies
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
fetch-depth: 0
token: ${{ secrets.BBOT_DOCS_UPDATER_PAT }}
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion bbot/core/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ async def finished_tasks(self, tasks, timeout=None):
"""
if tasks:
try:
done, pending = await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED, timeout=timeout)
done, _ = await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED, timeout=timeout)
return done
except BaseException as e:
if isinstance(e, (TimeoutError, asyncio.exceptions.TimeoutError)):
Expand Down
13 changes: 6 additions & 7 deletions bbot/core/helpers/bloom.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import mmh3
import mmap
import xxhash


class BloomFilter:
Expand Down Expand Up @@ -55,14 +56,12 @@ def _hashes(self, item):
if not isinstance(item, str):
item = str(item)
item = item.encode("utf-8")
return [abs(hash(item)) % self.size, abs(mmh3.hash(item)) % self.size, abs(self._fnv1a_hash(item)) % self.size]

def _fnv1a_hash(self, data):
hash = 0x811C9DC5 # 2166136261
for byte in data:
hash ^= byte
hash = (hash * 0x01000193) % 2**32 # 16777619
return hash
return [
abs(hash(item)) % self.size,
abs(mmh3.hash(item)) % self.size,
abs(xxhash.xxh32(item).intdigest()) % self.size,
]

def close(self):
"""Explicitly close the memory-mapped file."""
Expand Down
1 change: 0 additions & 1 deletion bbot/core/helpers/dns/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class DNSHelper(EngineClient):
_wildcard_cache (dict): Cache for wildcard detection results.
_dns_cache (LRUCache): Cache for DNS resolution results, limited in size.
resolver_file (Path): File containing system's current resolver nameservers.
filter_bad_ptrs (bool): Whether to filter out DNS names that appear to be auto-generated PTR records. Defaults to True.

Args:
parent_helper: The parent helper object with configuration details and utilities.
Expand Down
2 changes: 0 additions & 2 deletions bbot/core/helpers/dns/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ def __init__(self, socket_path, config={}, debug=False):
self._debug = self.dns_config.get("debug", False)
self._dns_cache = LRUCache(maxsize=10000)

self.filter_bad_ptrs = self.dns_config.get("filter_ptrs", True)

async def resolve(self, query, **kwargs):
"""Resolve DNS names and IP addresses to their corresponding results.

Expand Down
4 changes: 2 additions & 2 deletions bbot/core/helpers/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
log = logging.getLogger("bbot.core.helpers.files")


def tempfile(self, content, pipe=True):
def tempfile(self, content, pipe=True, extension=None):
"""
Creates a temporary file or named pipe and populates it with content.

Expand All @@ -29,7 +29,7 @@ def tempfile(self, content, pipe=True):
>>> tempfile(["Another", "temp", "file"], pipe=False)
'/home/user/.bbot/temp/someotherfile'
"""
filename = self.temp_filename()
filename = self.temp_filename(extension)
rm_at_exit(filename)
try:
if type(content) not in (set, list, tuple):
Expand Down
17 changes: 17 additions & 0 deletions bbot/core/helpers/git.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from pathlib import Path


def sanitize_git_repo(repo_folder: Path):
# sanitizing the git config is infeasible since there are too many different ways to do evil things
# instead, we move it out of .git and into the repo folder, so we don't miss any secrets etc. inside
config_file = repo_folder / ".git" / "config"
if config_file.exists():
config_file.rename(repo_folder / "git_config_original")
# move the index file
index_file = repo_folder / ".git" / "index"
if index_file.exists():
index_file.rename(repo_folder / "git_index_original")
# move the hooks folder
hooks_folder = repo_folder / ".git" / "hooks"
if hooks_folder.exists():
hooks_folder.rename(repo_folder / "git_hooks_original")
1 change: 1 addition & 0 deletions bbot/core/helpers/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from asyncio import create_task, gather, sleep, wait_for # noqa
from urllib.parse import urlparse, quote, unquote, urlunparse, urljoin # noqa F401

from .git import * # noqa F401
from .url import * # noqa F401
from ... import errors
from . import regexes as bbot_regexes
Expand Down
2 changes: 0 additions & 2 deletions bbot/core/helpers/ntlm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ def __init__(self, pos_tup, raw):
self.alloc = alloc
self.offset = offset
self.raw = raw[offset : offset + length]
self.utf16 = False

if len(self.raw) >= 2 and self.raw[1] == "\0":
self.string = self.raw.decode("utf-16")
self.utf16 = True
else:
self.string = self.raw

Expand Down
2 changes: 1 addition & 1 deletion bbot/core/helpers/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def new_task(regex_name, r):

while tasks: # While there are tasks pending
# Wait for the first task to complete
done, pending = await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)
done, _ = await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)

for task in done:
result = task.result()
Expand Down
Loading
Loading