From ed7f62312fe4124a64046859f87f7443bb18839a Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 09:52:57 +0400 Subject: [PATCH 01/13] chore: initialize PR with an empty commit skip-checks:true From 0c7e9ec601d99fcee185091f9a6adba3b046d2a4 Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 10:47:27 +0400 Subject: [PATCH 02/13] ci: temporarily disable workflows while addressing security issues skip-checks:true --- .github/workflows/ci.yml | 64 ++++++++------------- .github/workflows/codeql-analysis.yml | 37 ++++++------ .github/workflows/lint-fixer.yml | 47 +++++++-------- .github/workflows/rebase.yml | 7 ++- .github/workflows/release.yml | 9 ++- .github/workflows/update-challenges-www.yml | 52 ++++++++--------- .github/workflows/update-news-www.yml | 44 +++++++------- 7 files changed, 125 insertions(+), 135 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8ed5bfa..f09ccb66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,22 +1,25 @@ name: "CI/CD Pipeline" on: - push: - branches-ignore: - - l10n_develop - - gh-pages - paths-ignore: - - '*.md' - - 'LICENSE' - - 'monitoring/grafana-dashboard.json' - - 'screenshots/**' - tags-ignore: - - '*' - pull_request: - paths-ignore: - - '*.md' - - 'LICENSE' - - 'data/static/i18n/*.json' - - 'frontend/src/assets/i18n/*.json' + workflow_dispatch: +# on: +# push: +# branches-ignore: +# - l10n_develop +# - gh-pages +# paths-ignore: +# - '*.md' +# - 'LICENSE' +# - 'monitoring/grafana-dashboard.json' +# - 'screenshots/**' +# tags-ignore: +# - '*' +# pull_request: +# paths-ignore: +# - '*.md' +# - 'LICENSE' +# - 'data/static/i18n/*.json' +# - 'frontend/src/assets/i18n/*.json' + env: NODE_DEFAULT_VERSION: 22 NODE_OPTIONS: "--max_old_space_size=4096" @@ -40,18 +43,8 @@ jobs: run: npm run lint - name: "Lint customization configs" run: > - npm run lint:config -- -f ./config/7ms.yml && - npm run lint:config -- -f ./config/addo.yml && - npm run lint:config -- -f ./config/bodgeit.yml && - npm run lint:config -- -f ./config/ctf.yml && - npm run lint:config -- -f ./config/default.yml && - npm run lint:config -- -f ./config/fbctf.yml && - npm run lint:config -- -f ./config/juicebox.yml && - npm run lint:config -- -f ./config/mozilla.yml && - npm run lint:config -- -f ./config/oss.yml && - npm run lint:config -- -f ./config/quiet.yml && - npm run lint:config -- -f ./config/tutorial.yml && - npm run lint:config -- -f ./config/unsafe.yml + npm run lint:config -- -f ./config/7ms.yml && npm run lint:config -- -f ./config/addo.yml && npm run lint:config -- -f ./config/bodgeit.yml && npm run lint:config -- -f ./config/ctf.yml && npm run lint:config -- -f ./config/default.yml && npm run lint:config -- -f ./config/fbctf.yml && npm run lint:config -- -f ./config/juicebox.yml && npm run lint:config -- -f ./config/mozilla.yml && npm run lint:config -- -f ./config/oss.yml && npm run lint:config -- -f ./config/quiet.yml && npm run lint:config -- -f ./config/tutorial.yml && npm run lint:config -- -f ./config/unsafe.yml + coding-challenge-rsn: runs-on: windows-latest steps: @@ -184,17 +177,8 @@ jobs: timeout_minutes: 30 max_attempts: 3 command: > - NODE_ENV=7ms npm run test:server && - NODE_ENV=addo npm run test:server && - NODE_ENV=bodgeit npm run test:server && - NODE_ENV=ctf npm run test:server && - NODE_ENV=fbctf npm run test:server && - NODE_ENV=juicebox npm run test:server && - NODE_ENV=mozilla npm run test:server && - NODE_ENV=oss npm run test:server && - NODE_ENV=quiet npm run test:server && - NODE_ENV=tutorial npm run test:server && - NODE_ENV=unsafe npm run test:server + NODE_ENV=7ms npm run test:server && NODE_ENV=addo npm run test:server && NODE_ENV=bodgeit npm run test:server && NODE_ENV=ctf npm run test:server && NODE_ENV=fbctf npm run test:server && NODE_ENV=juicebox npm run test:server && NODE_ENV=mozilla npm run test:server && NODE_ENV=oss npm run test:server && NODE_ENV=quiet npm run test:server && NODE_ENV=tutorial npm run test:server && NODE_ENV=unsafe npm run test:server + e2e: runs-on: ${{ matrix.os }} strategy: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index fe353eb0..df6c22ca 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,8 +1,9 @@ name: "CodeQL Scan" - on: - push: - pull_request: + workflow_dispatch: +# on: +# push: +# pull_request: jobs: analyze: @@ -15,19 +16,19 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'javascript-typescript' ] + language: ['javascript-typescript'] steps: - - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - queries: security-extended - config: | - paths-ignore: - - 'data/static/codefixes' - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + queries: security-extended + config: | + paths-ignore: + - 'data/static/codefixes' + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/lint-fixer.yml b/.github/workflows/lint-fixer.yml index 907f841e..73a62044 100644 --- a/.github/workflows/lint-fixer.yml +++ b/.github/workflows/lint-fixer.yml @@ -1,29 +1,30 @@ name: "Let me lint:fix that for you" - -on: [push] +on: + workflow_dispatch: +# on: [push] jobs: LMLFTFY: runs-on: ubuntu-latest steps: - - name: "Check out Git repository" - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - - name: "Use Node.js 22" - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0 - with: - node-version: 22 - - name: "Install application" - run: | - npm install --ignore-scripts - cd frontend - npm install --ignore-scripts --legacy-peer-deps - - name: "Fix everything which can be fixed" - run: 'npm run lint:fix' - - uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 #v5.0.1 - with: - commit_message: "Auto-fix linting issues" - branch: ${{ github.head_ref }} - commit_options: '--signoff' - commit_user_name: JuiceShopBot - commit_user_email: 61591748+JuiceShopBot@users.noreply.github.com - commit_author: JuiceShopBot <61591748+JuiceShopBot@users.noreply.github.com> + - name: "Check out Git repository" + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 + - name: "Use Node.js 22" + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0 + with: + node-version: 22 + - name: "Install application" + run: | + npm install --ignore-scripts + cd frontend + npm install --ignore-scripts --legacy-peer-deps + - name: "Fix everything which can be fixed" + run: 'npm run lint:fix' + - uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 #v5.0.1 + with: + commit_message: "Auto-fix linting issues" + branch: ${{ github.head_ref }} + commit_options: '--signoff' + commit_user_name: JuiceShopBot + commit_user_email: 61591748+JuiceShopBot@users.noreply.github.com + commit_author: JuiceShopBot <61591748+JuiceShopBot@users.noreply.github.com> diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index f999d22e..d2dea74a 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -1,8 +1,9 @@ name: Automatic Rebase - on: - issue_comment: - types: [created] + workflow_dispatch: +# on: +# issue_comment: +# types: [created] jobs: rebase: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 27674eec..f4e8ed4b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,11 @@ name: "Release Pipeline" on: - push: - tags: - - v* + workflow_dispatch: +# on: +# push: +# tags: +# - v* + env: CYCLONEDX_NPM_VERSION: '^2.0.0||^3.0.0' jobs: diff --git a/.github/workflows/update-challenges-www.yml b/.github/workflows/update-challenges-www.yml index caaa7405..53223acf 100644 --- a/.github/workflows/update-challenges-www.yml +++ b/.github/workflows/update-challenges-www.yml @@ -1,34 +1,34 @@ name: "Update challenges on owasp-juice.shop" - on: - push: - branches: [ master ] - paths: - - 'data/static/challenges.yml' + workflow_dispatch: +# on: +# push: +# branches: [master] +# paths: +# - 'data/static/challenges.yml' jobs: UpdateChallengesOnWebsite: if: github.repository == 'juice-shop/juice-shop' runs-on: ubuntu-latest steps: - - name: Check out Git repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - with: - token: ${{ secrets.BOT_TOKEN }} - repository: OWASP/www-project-juice-shop - ref: master - - name: Update challenges.yml - run: | - cd _data/ - rm challenges.yml - wget https://raw.githubusercontent.com/juice-shop/juice-shop/master/data/static/challenges.yml - - uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 #v5.0.1 - with: - commit_message: "Auto-update challenges.yml from ${{ github.sha }}" - branch: master - commit_options: '--signoff' - - # Optional commit user and author settings - commit_user_name: JuiceShopBot - commit_user_email: 61591748+JuiceShopBot@users.noreply.github.com - commit_author: JuiceShopBot <61591748+JuiceShopBot@users.noreply.github.com> + - name: Check out Git repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 + with: + token: ${{ secrets.BOT_TOKEN }} + repository: OWASP/www-project-juice-shop + ref: master + - name: Update challenges.yml + run: | + cd _data/ + rm challenges.yml + wget https://raw.githubusercontent.com/juice-shop/juice-shop/master/data/static/challenges.yml + - uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 #v5.0.1 + with: + commit_message: "Auto-update challenges.yml from ${{ github.sha }}" + branch: master + commit_options: '--signoff' + # Optional commit user and author settings + commit_user_name: JuiceShopBot + commit_user_email: 61591748+JuiceShopBot@users.noreply.github.com + commit_author: JuiceShopBot <61591748+JuiceShopBot@users.noreply.github.com> diff --git a/.github/workflows/update-news-www.yml b/.github/workflows/update-news-www.yml index 26757465..3c04b17d 100644 --- a/.github/workflows/update-news-www.yml +++ b/.github/workflows/update-news-www.yml @@ -1,29 +1,29 @@ name: "Update news on owasp-juice.shop" - on: - release: - types: [ published ] + workflow_dispatch: +# on: +# release: +# types: [published] jobs: UpdateNewsOnWebsite: runs-on: ubuntu-latest steps: - - name: Check out Git repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - with: - token: ${{ secrets.BOT_TOKEN }} - repository: OWASP/www-project-juice-shop - branch: master - - name: Update tab_news.md - run: | - sed -i 's//\n* ${{ github.event.release.published_at }}: juice-shop [`${{ github.event.release.tag_name }}`](https:\/\/github.com\/juice-shop\/juice-shop\/releases\/tag\/${{ github.event.release.tag_name }})/' tab_news.md - - uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 #v5.0.1 - with: - commit_message: "Add juice-shop ${{ github.event.release.tag_name }} release notes to tab_news.md" - branch: master - commit_options: '--signoff' - - # Optional commit user and author settings - commit_user_name: JuiceShopBot - commit_user_email: 61591748+JuiceShopBot@users.noreply.github.com - commit_author: JuiceShopBot <61591748+JuiceShopBot@users.noreply.github.com> + - name: Check out Git repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 + with: + token: ${{ secrets.BOT_TOKEN }} + repository: OWASP/www-project-juice-shop + branch: master + - name: Update tab_news.md + run: | + sed -i 's//\n* ${{ github.event.release.published_at }}: juice-shop [`${{ github.event.release.tag_name }}`](https:\/\/github.com\/juice-shop\/juice-shop\/releases\/tag\/${{ github.event.release.tag_name }})/' tab_news.md + - uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 #v5.0.1 + with: + commit_message: "Add juice-shop ${{ github.event.release.tag_name }} release notes to tab_news.md" + branch: master + commit_options: '--signoff' + # Optional commit user and author settings + commit_user_name: JuiceShopBot + commit_user_email: 61591748+JuiceShopBot@users.noreply.github.com + commit_author: JuiceShopBot <61591748+JuiceShopBot@users.noreply.github.com> From e0eefecf6c5e9e5654217dbd27c26ae7641e52ac Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 11:37:34 +0400 Subject: [PATCH 03/13] test: add auto-generated e2e security tests skip-checks:true --- .../tests/delete-api-addresses-1.test.ts | 35 +++++++++++++ .../tests/delete-api-addresss-1.test.ts | 35 +++++++++++++ .../tests/delete-api-basket-items-1.test.ts | 35 +++++++++++++ .brightsec/tests/delete-api-cards-123.test.ts | 35 +++++++++++++ .../tests/delete-api-challenges-1.test.ts | 35 +++++++++++++ .../tests/delete-api-complaints-1.test.ts | 38 ++++++++++++++ .../delete-api-privacy-requests-1.test.ts | 35 +++++++++++++ .../tests/delete-api-products-1.test.ts | 35 +++++++++++++ .../tests/delete-api-quantitys-1.test.ts | 35 +++++++++++++ .../tests/delete-api-recycles-1.test.ts | 34 +++++++++++++ .../delete-api-security-answers-1.test.ts | 35 +++++++++++++ .../delete-api-security-questions-1.test.ts | 35 +++++++++++++ .brightsec/tests/delete-api-users-123.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-addresses-1.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-addresss-1.test.ts | 34 +++++++++++++ .brightsec/tests/get-api-addresss.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-basket-items.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-cards-1.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-cards.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-challenges-1.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-challenges.test.ts | 34 +++++++++++++ .brightsec/tests/get-api-complaints-1.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-complaints.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-deliverys-1.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-deliverys.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-docs.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-feedbacks-1.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-feedbacks.test.ts | 34 +++++++++++++ .../tests/get-api-privacy-requests-1.test.ts | 35 +++++++++++++ .../tests/get-api-privacy-requests.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-products-1.test.ts | 34 +++++++++++++ .brightsec/tests/get-api-products.test.ts | 34 +++++++++++++ .brightsec/tests/get-api-quantitys-1.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-quantitys.test.ts | 34 +++++++++++++ .brightsec/tests/get-api-recycles-1.test.ts | 34 +++++++++++++ .../tests/get-api-security-answers-1.test.ts | 34 +++++++++++++ .../tests/get-api-security-answers.test.ts | 34 +++++++++++++ .../tests/get-api-security-questions.test.ts | 35 +++++++++++++ .brightsec/tests/get-api-users-1.test.ts | 34 +++++++++++++ .brightsec/tests/get-api-users.test.ts | 35 +++++++++++++ .brightsec/tests/get-assets-i18n.test.ts | 35 +++++++++++++ .../get-assets-public-images-padding.test.ts | 34 +++++++++++++ .../get-assets-public-images-products.test.ts | 34 +++++++++++++ .../get-assets-public-images-uploads.test.ts | 34 +++++++++++++ .brightsec/tests/get-dataerasure.test.ts | 35 +++++++++++++ .../get-encryptionkeys-samplefile.test.ts | 34 +++++++++++++ .../get-ftp-quarantine-samplefile-txt.test.ts | 35 +++++++++++++ .../tests/get-ftp-sample-file-md.test.ts | 34 +++++++++++++ .brightsec/tests/get-ftp-sample-md.test.ts | 35 +++++++++++++ .brightsec/tests/get-metrics.test.ts | 34 +++++++++++++ .brightsec/tests/get-profile.test.ts | 37 ++++++++++++++ .brightsec/tests/get-promotion.test.ts | 35 +++++++++++++ .brightsec/tests/get-redirect.test.ts | 34 +++++++++++++ .brightsec/tests/get-rest-2fa-status.test.ts | 35 +++++++++++++ ...st-admin-application-configuration.test.ts | 35 +++++++++++++ ...get-rest-admin-application-version.test.ts | 35 +++++++++++++ .../tests/get-rest-basket-1-order.test.ts | 35 +++++++++++++ .brightsec/tests/get-rest-basket-1.test.ts | 35 +++++++++++++ .brightsec/tests/get-rest-captcha.test.ts | 34 +++++++++++++ .../tests/get-rest-chatbot-status.test.ts | 35 +++++++++++++ .../get-rest-continue-code-findit.test.ts | 35 +++++++++++++ .../get-rest-continue-code-fixit.test.ts | 35 +++++++++++++ .../tests/get-rest-continue-code.test.ts | 34 +++++++++++++ .../tests/get-rest-country-mapping.test.ts | 35 +++++++++++++ .../tests/get-rest-deluxe-membership.test.ts | 34 +++++++++++++ .../tests/get-rest-image-captcha.test.ts | 35 +++++++++++++ .brightsec/tests/get-rest-languages.test.ts | 34 +++++++++++++ .brightsec/tests/get-rest-memories.test.ts | 34 +++++++++++++ .../get-rest-order-history-orders.test.ts | 35 +++++++++++++ .../tests/get-rest-order-history.test.ts | 35 +++++++++++++ .../tests/get-rest-products-1-reviews.test.ts | 34 +++++++++++++ .../tests/get-rest-products-search.test.ts | 35 +++++++++++++ .../get-rest-repeat-notification.test.ts | 35 +++++++++++++ .../tests/get-rest-save-login-ip.test.ts | 35 +++++++++++++ .../tests/get-rest-track-order-12345.test.ts | 34 +++++++++++++ ...t-rest-user-authentication-details.test.ts | 35 +++++++++++++ .../get-rest-user-change-password.test.ts | 35 +++++++++++++ .../get-rest-user-security-question.test.ts | 35 +++++++++++++ .brightsec/tests/get-rest-user-whoami.test.ts | 35 +++++++++++++ .../tests/get-rest-wallet-balance.test.ts | 34 +++++++++++++ .../get-rest-web3-nft-mint-listen.test.ts | 34 +++++++++++++ .../tests/get-rest-web3-nft-unlocked.test.ts | 34 +++++++++++++ .brightsec/tests/get-security-txt.test.ts | 35 +++++++++++++ .../get-snippets-fixes-sample-key.test.ts | 34 +++++++++++++ .../get-snippets-sample-challenge.test.ts | 34 +++++++++++++ .../get-solve-challenges-server-side.test.ts | 34 +++++++++++++ .../tests/get-support-logs-sample-log.test.ts | 34 +++++++++++++ ...n-easter-egg-within-the-easter-egg.test.ts | 35 +++++++++++++ ...-be-unlocked-by-sending-1btc-to-us.test.ts | 35 +++++++++++++ .../get-video-range-bytes-0-1023.test.ts | 41 ++++++++++++++++ ...easonably-necessary-responsibility.test.ts | 34 +++++++++++++ .../tests/get-well-known-samplefile.test.ts | 35 +++++++++++++ .../tests/get-well-known-security-txt.test.ts | 35 +++++++++++++ .brightsec/tests/get-well-known.test.ts | 35 +++++++++++++ .../patch-rest-products-id-reviews.test.ts | 39 +++++++++++++++ .../tests/patch-rest-products-reviews.test.ts | 39 +++++++++++++++ .brightsec/tests/post-api-addresses.test.ts | 45 +++++++++++++++++ .brightsec/tests/post-api-addresss.test.ts | 45 +++++++++++++++++ .../tests/post-api-basket-items.test.ts | 36 ++++++++++++++ .brightsec/tests/post-api-cards.test.ts | 43 ++++++++++++++++ .brightsec/tests/post-api-challenges.test.ts | 49 +++++++++++++++++++ .brightsec/tests/post-api-complaints.test.ts | 40 +++++++++++++++ .brightsec/tests/post-api-feedbacks.test.ts | 40 +++++++++++++++ .../tests/post-api-privacy-requests.test.ts | 40 +++++++++++++++ .brightsec/tests/post-api-products.test.ts | 42 ++++++++++++++++ .brightsec/tests/post-api-quantitys.test.ts | 39 +++++++++++++++ .brightsec/tests/post-api-recycles.test.ts | 43 ++++++++++++++++ .../tests/post-api-security-questions.test.ts | 39 +++++++++++++++ .brightsec/tests/post-api-users.test.ts | 40 +++++++++++++++ .brightsec/tests/post-b2b-v2-orders.test.ts | 42 ++++++++++++++++ .brightsec/tests/post-dataerasure.test.ts | 40 +++++++++++++++ .brightsec/tests/post-file-upload.test.ts | 36 ++++++++++++++ .../tests/post-profile-image-file.test.ts | 36 ++++++++++++++ .../tests/post-profile-image-url.test.ts | 38 ++++++++++++++ .brightsec/tests/post-profile.test.ts | 38 ++++++++++++++ .../tests/post-rest-2fa-disable.test.ts | 38 ++++++++++++++ .brightsec/tests/post-rest-2fa-setup.test.ts | 43 ++++++++++++++++ .brightsec/tests/post-rest-2fa-verify.test.ts | 39 +++++++++++++++ .../tests/post-rest-basket-1-checkout.test.ts | 43 ++++++++++++++++ .../tests/post-rest-chatbot-respond.test.ts | 39 +++++++++++++++ .../tests/post-rest-deluxe-membership.test.ts | 39 +++++++++++++++ .brightsec/tests/post-rest-memories.test.ts | 35 +++++++++++++ .../post-rest-products-123-reviews.test.ts | 42 ++++++++++++++++ .../tests/post-rest-user-data-export.test.ts | 38 ++++++++++++++ .brightsec/tests/post-rest-user-login.test.ts | 39 +++++++++++++++ .../post-rest-user-reset-password.test.ts | 41 ++++++++++++++++ .../tests/post-rest-web3-submit-key.test.ts | 38 ++++++++++++++ ...t-rest-web3-wallet-exploit-address.test.ts | 38 ++++++++++++++ .../post-rest-web3-wallet-nft-verify.test.ts | 38 ++++++++++++++ .brightsec/tests/post-snippets-fixes.test.ts | 39 +++++++++++++++ .../tests/post-snippets-verdict.test.ts | 39 +++++++++++++++ .brightsec/tests/put-api-addresses-1.test.ts | 44 +++++++++++++++++ .brightsec/tests/put-api-addresss-1.test.ts | 44 +++++++++++++++++ .../tests/put-api-basket-items-1.test.ts | 40 +++++++++++++++ .brightsec/tests/put-api-cards-1.test.ts | 42 ++++++++++++++++ .brightsec/tests/put-api-challenges-1.test.ts | 49 +++++++++++++++++++ .brightsec/tests/put-api-feedbacks-1.test.ts | 43 ++++++++++++++++ .../tests/put-api-privacy-requests-1.test.ts | 42 ++++++++++++++++ .brightsec/tests/put-api-quantitys-1.test.ts | 40 +++++++++++++++ .brightsec/tests/put-api-recycles-1.test.ts | 42 ++++++++++++++++ .../tests/put-api-security-answers-1.test.ts | 38 ++++++++++++++ .../put-api-security-questions-1.test.ts | 41 ++++++++++++++++ .brightsec/tests/put-api-users-123.test.ts | 46 +++++++++++++++++ .../put-rest-basket-1-coupon-summer21.test.ts | 35 +++++++++++++ ...t-continue-code-apply-continuecode.test.ts | 38 ++++++++++++++ ...indit-apply-examplecontinuecode123.test.ts | 38 ++++++++++++++ ...it-apply-example-continue-code-123.test.ts | 38 ++++++++++++++ ...st-order-history-1-delivery-status.test.ts | 36 ++++++++++++++ .../tests/put-rest-wallet-balance.test.ts | 40 +++++++++++++++ 149 files changed, 5481 insertions(+) create mode 100644 .brightsec/tests/delete-api-addresses-1.test.ts create mode 100644 .brightsec/tests/delete-api-addresss-1.test.ts create mode 100644 .brightsec/tests/delete-api-basket-items-1.test.ts create mode 100644 .brightsec/tests/delete-api-cards-123.test.ts create mode 100644 .brightsec/tests/delete-api-challenges-1.test.ts create mode 100644 .brightsec/tests/delete-api-complaints-1.test.ts create mode 100644 .brightsec/tests/delete-api-privacy-requests-1.test.ts create mode 100644 .brightsec/tests/delete-api-products-1.test.ts create mode 100644 .brightsec/tests/delete-api-quantitys-1.test.ts create mode 100644 .brightsec/tests/delete-api-recycles-1.test.ts create mode 100644 .brightsec/tests/delete-api-security-answers-1.test.ts create mode 100644 .brightsec/tests/delete-api-security-questions-1.test.ts create mode 100644 .brightsec/tests/delete-api-users-123.test.ts create mode 100644 .brightsec/tests/get-api-addresses-1.test.ts create mode 100644 .brightsec/tests/get-api-addresss-1.test.ts create mode 100644 .brightsec/tests/get-api-addresss.test.ts create mode 100644 .brightsec/tests/get-api-basket-items.test.ts create mode 100644 .brightsec/tests/get-api-cards-1.test.ts create mode 100644 .brightsec/tests/get-api-cards.test.ts create mode 100644 .brightsec/tests/get-api-challenges-1.test.ts create mode 100644 .brightsec/tests/get-api-challenges.test.ts create mode 100644 .brightsec/tests/get-api-complaints-1.test.ts create mode 100644 .brightsec/tests/get-api-complaints.test.ts create mode 100644 .brightsec/tests/get-api-deliverys-1.test.ts create mode 100644 .brightsec/tests/get-api-deliverys.test.ts create mode 100644 .brightsec/tests/get-api-docs.test.ts create mode 100644 .brightsec/tests/get-api-feedbacks-1.test.ts create mode 100644 .brightsec/tests/get-api-feedbacks.test.ts create mode 100644 .brightsec/tests/get-api-privacy-requests-1.test.ts create mode 100644 .brightsec/tests/get-api-privacy-requests.test.ts create mode 100644 .brightsec/tests/get-api-products-1.test.ts create mode 100644 .brightsec/tests/get-api-products.test.ts create mode 100644 .brightsec/tests/get-api-quantitys-1.test.ts create mode 100644 .brightsec/tests/get-api-quantitys.test.ts create mode 100644 .brightsec/tests/get-api-recycles-1.test.ts create mode 100644 .brightsec/tests/get-api-security-answers-1.test.ts create mode 100644 .brightsec/tests/get-api-security-answers.test.ts create mode 100644 .brightsec/tests/get-api-security-questions.test.ts create mode 100644 .brightsec/tests/get-api-users-1.test.ts create mode 100644 .brightsec/tests/get-api-users.test.ts create mode 100644 .brightsec/tests/get-assets-i18n.test.ts create mode 100644 .brightsec/tests/get-assets-public-images-padding.test.ts create mode 100644 .brightsec/tests/get-assets-public-images-products.test.ts create mode 100644 .brightsec/tests/get-assets-public-images-uploads.test.ts create mode 100644 .brightsec/tests/get-dataerasure.test.ts create mode 100644 .brightsec/tests/get-encryptionkeys-samplefile.test.ts create mode 100644 .brightsec/tests/get-ftp-quarantine-samplefile-txt.test.ts create mode 100644 .brightsec/tests/get-ftp-sample-file-md.test.ts create mode 100644 .brightsec/tests/get-ftp-sample-md.test.ts create mode 100644 .brightsec/tests/get-metrics.test.ts create mode 100644 .brightsec/tests/get-profile.test.ts create mode 100644 .brightsec/tests/get-promotion.test.ts create mode 100644 .brightsec/tests/get-redirect.test.ts create mode 100644 .brightsec/tests/get-rest-2fa-status.test.ts create mode 100644 .brightsec/tests/get-rest-admin-application-configuration.test.ts create mode 100644 .brightsec/tests/get-rest-admin-application-version.test.ts create mode 100644 .brightsec/tests/get-rest-basket-1-order.test.ts create mode 100644 .brightsec/tests/get-rest-basket-1.test.ts create mode 100644 .brightsec/tests/get-rest-captcha.test.ts create mode 100644 .brightsec/tests/get-rest-chatbot-status.test.ts create mode 100644 .brightsec/tests/get-rest-continue-code-findit.test.ts create mode 100644 .brightsec/tests/get-rest-continue-code-fixit.test.ts create mode 100644 .brightsec/tests/get-rest-continue-code.test.ts create mode 100644 .brightsec/tests/get-rest-country-mapping.test.ts create mode 100644 .brightsec/tests/get-rest-deluxe-membership.test.ts create mode 100644 .brightsec/tests/get-rest-image-captcha.test.ts create mode 100644 .brightsec/tests/get-rest-languages.test.ts create mode 100644 .brightsec/tests/get-rest-memories.test.ts create mode 100644 .brightsec/tests/get-rest-order-history-orders.test.ts create mode 100644 .brightsec/tests/get-rest-order-history.test.ts create mode 100644 .brightsec/tests/get-rest-products-1-reviews.test.ts create mode 100644 .brightsec/tests/get-rest-products-search.test.ts create mode 100644 .brightsec/tests/get-rest-repeat-notification.test.ts create mode 100644 .brightsec/tests/get-rest-save-login-ip.test.ts create mode 100644 .brightsec/tests/get-rest-track-order-12345.test.ts create mode 100644 .brightsec/tests/get-rest-user-authentication-details.test.ts create mode 100644 .brightsec/tests/get-rest-user-change-password.test.ts create mode 100644 .brightsec/tests/get-rest-user-security-question.test.ts create mode 100644 .brightsec/tests/get-rest-user-whoami.test.ts create mode 100644 .brightsec/tests/get-rest-wallet-balance.test.ts create mode 100644 .brightsec/tests/get-rest-web3-nft-mint-listen.test.ts create mode 100644 .brightsec/tests/get-rest-web3-nft-unlocked.test.ts create mode 100644 .brightsec/tests/get-security-txt.test.ts create mode 100644 .brightsec/tests/get-snippets-fixes-sample-key.test.ts create mode 100644 .brightsec/tests/get-snippets-sample-challenge.test.ts create mode 100644 .brightsec/tests/get-solve-challenges-server-side.test.ts create mode 100644 .brightsec/tests/get-support-logs-sample-log.test.ts create mode 100644 .brightsec/tests/get-the-devs-are-so-funny-they-hid-an-easter-egg-within-the-easter-egg.test.ts create mode 100644 .brightsec/tests/get-this-page-is-hidden-behind-an-incredibly-high-paywall-that-could-only-be-unlocked-by-sending-1btc-to-us.test.ts create mode 100644 .brightsec/tests/get-video-range-bytes-0-1023.test.ts create mode 100644 .brightsec/tests/get-we-may-also-instruct-you-to-refuse-all-reasonably-necessary-responsibility.test.ts create mode 100644 .brightsec/tests/get-well-known-samplefile.test.ts create mode 100644 .brightsec/tests/get-well-known-security-txt.test.ts create mode 100644 .brightsec/tests/get-well-known.test.ts create mode 100644 .brightsec/tests/patch-rest-products-id-reviews.test.ts create mode 100644 .brightsec/tests/patch-rest-products-reviews.test.ts create mode 100644 .brightsec/tests/post-api-addresses.test.ts create mode 100644 .brightsec/tests/post-api-addresss.test.ts create mode 100644 .brightsec/tests/post-api-basket-items.test.ts create mode 100644 .brightsec/tests/post-api-cards.test.ts create mode 100644 .brightsec/tests/post-api-challenges.test.ts create mode 100644 .brightsec/tests/post-api-complaints.test.ts create mode 100644 .brightsec/tests/post-api-feedbacks.test.ts create mode 100644 .brightsec/tests/post-api-privacy-requests.test.ts create mode 100644 .brightsec/tests/post-api-products.test.ts create mode 100644 .brightsec/tests/post-api-quantitys.test.ts create mode 100644 .brightsec/tests/post-api-recycles.test.ts create mode 100644 .brightsec/tests/post-api-security-questions.test.ts create mode 100644 .brightsec/tests/post-api-users.test.ts create mode 100644 .brightsec/tests/post-b2b-v2-orders.test.ts create mode 100644 .brightsec/tests/post-dataerasure.test.ts create mode 100644 .brightsec/tests/post-file-upload.test.ts create mode 100644 .brightsec/tests/post-profile-image-file.test.ts create mode 100644 .brightsec/tests/post-profile-image-url.test.ts create mode 100644 .brightsec/tests/post-profile.test.ts create mode 100644 .brightsec/tests/post-rest-2fa-disable.test.ts create mode 100644 .brightsec/tests/post-rest-2fa-setup.test.ts create mode 100644 .brightsec/tests/post-rest-2fa-verify.test.ts create mode 100644 .brightsec/tests/post-rest-basket-1-checkout.test.ts create mode 100644 .brightsec/tests/post-rest-chatbot-respond.test.ts create mode 100644 .brightsec/tests/post-rest-deluxe-membership.test.ts create mode 100644 .brightsec/tests/post-rest-memories.test.ts create mode 100644 .brightsec/tests/post-rest-products-123-reviews.test.ts create mode 100644 .brightsec/tests/post-rest-user-data-export.test.ts create mode 100644 .brightsec/tests/post-rest-user-login.test.ts create mode 100644 .brightsec/tests/post-rest-user-reset-password.test.ts create mode 100644 .brightsec/tests/post-rest-web3-submit-key.test.ts create mode 100644 .brightsec/tests/post-rest-web3-wallet-exploit-address.test.ts create mode 100644 .brightsec/tests/post-rest-web3-wallet-nft-verify.test.ts create mode 100644 .brightsec/tests/post-snippets-fixes.test.ts create mode 100644 .brightsec/tests/post-snippets-verdict.test.ts create mode 100644 .brightsec/tests/put-api-addresses-1.test.ts create mode 100644 .brightsec/tests/put-api-addresss-1.test.ts create mode 100644 .brightsec/tests/put-api-basket-items-1.test.ts create mode 100644 .brightsec/tests/put-api-cards-1.test.ts create mode 100644 .brightsec/tests/put-api-challenges-1.test.ts create mode 100644 .brightsec/tests/put-api-feedbacks-1.test.ts create mode 100644 .brightsec/tests/put-api-privacy-requests-1.test.ts create mode 100644 .brightsec/tests/put-api-quantitys-1.test.ts create mode 100644 .brightsec/tests/put-api-recycles-1.test.ts create mode 100644 .brightsec/tests/put-api-security-answers-1.test.ts create mode 100644 .brightsec/tests/put-api-security-questions-1.test.ts create mode 100644 .brightsec/tests/put-api-users-123.test.ts create mode 100644 .brightsec/tests/put-rest-basket-1-coupon-summer21.test.ts create mode 100644 .brightsec/tests/put-rest-continue-code-apply-continuecode.test.ts create mode 100644 .brightsec/tests/put-rest-continue-code-findit-apply-examplecontinuecode123.test.ts create mode 100644 .brightsec/tests/put-rest-continue-code-fixit-apply-example-continue-code-123.test.ts create mode 100644 .brightsec/tests/put-rest-order-history-1-delivery-status.test.ts create mode 100644 .brightsec/tests/put-rest-wallet-balance.test.ts diff --git a/.brightsec/tests/delete-api-addresses-1.test.ts b/.brightsec/tests/delete-api-addresses-1.test.ts new file mode 100644 index 00000000..71da9a01 --- /dev/null +++ b/.brightsec/tests/delete-api-addresses-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/addresses/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'id_enumeration', 'sqli', 'osi'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/Addresses/1`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/delete-api-addresss-1.test.ts b/.brightsec/tests/delete-api-addresss-1.test.ts new file mode 100644 index 00000000..7198a83a --- /dev/null +++ b/.brightsec/tests/delete-api-addresss-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/addresss/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'id_enumeration', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/Addresss/1`, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/delete-api-basket-items-1.test.ts b/.brightsec/tests/delete-api-basket-items-1.test.ts new file mode 100644 index 00000000..c352a538 --- /dev/null +++ b/.brightsec/tests/delete-api-basket-items-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/basket-items/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'id_enumeration', 'jwt', 'sqli', 'csrf'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/BasketItems/1`, + headers: { 'Authorization': 'Bearer ' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/delete-api-cards-123.test.ts b/.brightsec/tests/delete-api-cards-123.test.ts new file mode 100644 index 00000000..40db6ec0 --- /dev/null +++ b/.brightsec/tests/delete-api-cards-123.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/cards/123', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'id_enumeration', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/Cards/123`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/delete-api-challenges-1.test.ts b/.brightsec/tests/delete-api-challenges-1.test.ts new file mode 100644 index 00000000..7ce631df --- /dev/null +++ b/.brightsec/tests/delete-api-challenges-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/challenges/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'id_enumeration', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/Challenges/1`, + headers: { 'X-Recruiting': 'https://owasp-juice.shop/security.txt' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/delete-api-complaints-1.test.ts b/.brightsec/tests/delete-api-complaints-1.test.ts new file mode 100644 index 00000000..46e45f42 --- /dev/null +++ b/.brightsec/tests/delete-api-complaints-1.test.ts @@ -0,0 +1,38 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/complaints/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'id_enumeration', 'jwt', 'sqli'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/Complaints/1`, + headers: { + 'Authorization': 'Bearer ', + 'Content-Type': 'application/json' + }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/delete-api-privacy-requests-1.test.ts b/.brightsec/tests/delete-api-privacy-requests-1.test.ts new file mode 100644 index 00000000..b1f41a77 --- /dev/null +++ b/.brightsec/tests/delete-api-privacy-requests-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/PrivacyRequests/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'id_enumeration', 'sqli'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/PrivacyRequests/1`, + headers: { 'Authorization': 'Bearer ' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/delete-api-products-1.test.ts b/.brightsec/tests/delete-api-products-1.test.ts new file mode 100644 index 00000000..55b0a3ae --- /dev/null +++ b/.brightsec/tests/delete-api-products-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/products/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'id_enumeration', 'bopla', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/Products/1`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/delete-api-quantitys-1.test.ts b/.brightsec/tests/delete-api-quantitys-1.test.ts new file mode 100644 index 00000000..909a80cd --- /dev/null +++ b/.brightsec/tests/delete-api-quantitys-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/quantitys/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'id_enumeration', 'http_method_fuzzing', 'sqli'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/Quantitys/1`, + headers: { 'X-Recruiting': 'true' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/delete-api-recycles-1.test.ts b/.brightsec/tests/delete-api-recycles-1.test.ts new file mode 100644 index 00000000..4bf5ea5b --- /dev/null +++ b/.brightsec/tests/delete-api-recycles-1.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/recycles/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'id_enumeration', 'bopla', 'sqli'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/Recycles/1`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/delete-api-security-answers-1.test.ts b/.brightsec/tests/delete-api-security-answers-1.test.ts new file mode 100644 index 00000000..0594129c --- /dev/null +++ b/.brightsec/tests/delete-api-security-answers-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/security-answers/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'id_enumeration', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/SecurityAnswers/1`, + headers: { 'X-Recruiting': 'YourCompany' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/delete-api-security-questions-1.test.ts b/.brightsec/tests/delete-api-security-questions-1.test.ts new file mode 100644 index 00000000..53f6c080 --- /dev/null +++ b/.brightsec/tests/delete-api-security-questions-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/security-questions/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'id_enumeration', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/SecurityQuestions/1`, + headers: { 'X-Recruiting': 'We are hiring! Check out our careers page.' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/delete-api-users-123.test.ts b/.brightsec/tests/delete-api-users-123.test.ts new file mode 100644 index 00000000..0036de16 --- /dev/null +++ b/.brightsec/tests/delete-api-users-123.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('DELETE /api/users/123', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'id_enumeration', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.DELETE, + url: `${baseUrl}/api/Users/123`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-addresses-1.test.ts b/.brightsec/tests/get-api-addresses-1.test.ts new file mode 100644 index 00000000..3b31232d --- /dev/null +++ b/.brightsec/tests/get-api-addresses-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/addresses/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['id_enumeration', 'bopla', 'sqli', 'xss', 'csrf'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Addresses/1`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-addresss-1.test.ts b/.brightsec/tests/get-api-addresss-1.test.ts new file mode 100644 index 00000000..19007b68 --- /dev/null +++ b/.brightsec/tests/get-api-addresss-1.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/addresss/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'id_enumeration', 'sqli', 'csrf'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Addresss/1`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-addresss.test.ts b/.brightsec/tests/get-api-addresss.test.ts new file mode 100644 index 00000000..ca7b4947 --- /dev/null +++ b/.brightsec/tests/get-api-addresss.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/addresss', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'id_enumeration', 'sqli'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Addresss`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-basket-items.test.ts b/.brightsec/tests/get-api-basket-items.test.ts new file mode 100644 index 00000000..5dfec17f --- /dev/null +++ b/.brightsec/tests/get-api-basket-items.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/basket-items', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'business_constraint_bypass', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/BasketItems`, + headers: { 'X-Recruiting': 'We are hiring! Visit our careers page for more information.' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/get-api-cards-1.test.ts b/.brightsec/tests/get-api-cards-1.test.ts new file mode 100644 index 00000000..ff907aa2 --- /dev/null +++ b/.brightsec/tests/get-api-cards-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/cards/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['id_enumeration', 'bopla', 'csrf', 'sqli', 'xss', 'full_path_disclosure'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/cards/1`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/get-api-cards.test.ts b/.brightsec/tests/get-api-cards.test.ts new file mode 100644 index 00000000..31c9e884 --- /dev/null +++ b/.brightsec/tests/get-api-cards.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/cards', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'id_enumeration', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Cards`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-challenges-1.test.ts b/.brightsec/tests/get-api-challenges-1.test.ts new file mode 100644 index 00000000..34ba8959 --- /dev/null +++ b/.brightsec/tests/get-api-challenges-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/challenges/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'id_enumeration', 'sqli', 'xss', 'csrf'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Challenges/1`, + headers: { 'X-Recruiting': 'We are hiring! Visit our careers page for more information.' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-challenges.test.ts b/.brightsec/tests/get-api-challenges.test.ts new file mode 100644 index 00000000..9674a225 --- /dev/null +++ b/.brightsec/tests/get-api-challenges.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/challenges', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'business_constraint_bypass', 'xss', 'sqli'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Challenges`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-complaints-1.test.ts b/.brightsec/tests/get-api-complaints-1.test.ts new file mode 100644 index 00000000..2e7023c0 --- /dev/null +++ b/.brightsec/tests/get-api-complaints-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/complaints/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['id_enumeration', 'bopla', 'csrf', 'xss', 'sqli', 'full_path_disclosure'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Complaints/1`, + headers: { 'X-Recruiting': 'Your Company is Hiring!' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/get-api-complaints.test.ts b/.brightsec/tests/get-api-complaints.test.ts new file mode 100644 index 00000000..39b7ff25 --- /dev/null +++ b/.brightsec/tests/get-api-complaints.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/complaints', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'id_enumeration', 'bopla', 'improper_asset_management'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Complaints`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-deliverys-1.test.ts b/.brightsec/tests/get-api-deliverys-1.test.ts new file mode 100644 index 00000000..efbf5550 --- /dev/null +++ b/.brightsec/tests/get-api-deliverys-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/deliverys/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['id_enumeration', 'bopla', 'sqli', 'xss', 'csrf'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Deliverys/1`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-deliverys.test.ts b/.brightsec/tests/get-api-deliverys.test.ts new file mode 100644 index 00000000..bd54d905 --- /dev/null +++ b/.brightsec/tests/get-api-deliverys.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/deliverys', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'id_enumeration', 'improper_asset_management', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.HEADER, AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Deliverys`, + headers: { 'X-Recruiting': 'undefined' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/get-api-docs.test.ts b/.brightsec/tests/get-api-docs.test.ts new file mode 100644 index 00000000..8ea84c16 --- /dev/null +++ b/.brightsec/tests/get-api-docs.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api-docs', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['xss', 'csrf', 'improper_asset_management', 'full_path_disclosure'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api-docs`, + headers: { 'X-Recruiting': 'Your Company is Hiring!' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-feedbacks-1.test.ts b/.brightsec/tests/get-api-feedbacks-1.test.ts new file mode 100644 index 00000000..e4139118 --- /dev/null +++ b/.brightsec/tests/get-api-feedbacks-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/Feedbacks/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['id_enumeration', 'bopla', 'xss', 'sqli', 'csrf'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Feedbacks/1`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-feedbacks.test.ts b/.brightsec/tests/get-api-feedbacks.test.ts new file mode 100644 index 00000000..f0739704 --- /dev/null +++ b/.brightsec/tests/get-api-feedbacks.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/feedbacks', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'id_enumeration', 'xss', 'sqli', 'improper_asset_management'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Feedbacks`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/get-api-privacy-requests-1.test.ts b/.brightsec/tests/get-api-privacy-requests-1.test.ts new file mode 100644 index 00000000..a143d5b3 --- /dev/null +++ b/.brightsec/tests/get-api-privacy-requests-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/privacy-requests/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['id_enumeration', 'bopla', 'csrf', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/PrivacyRequests/1`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-privacy-requests.test.ts b/.brightsec/tests/get-api-privacy-requests.test.ts new file mode 100644 index 00000000..ad25b359 --- /dev/null +++ b/.brightsec/tests/get-api-privacy-requests.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/privacy-requests', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'id_enumeration', 'improper_asset_management', 'sqli'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/PrivacyRequests`, + headers: { 'X-Recruiting': 'config.get(\'application.securityTxt.hiring\')' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-products-1.test.ts b/.brightsec/tests/get-api-products-1.test.ts new file mode 100644 index 00000000..bc61513d --- /dev/null +++ b/.brightsec/tests/get-api-products-1.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/products/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['id_enumeration', 'sqli', 'xss', 'csrf', 'improper_asset_management'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Products/1`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-products.test.ts b/.brightsec/tests/get-api-products.test.ts new file mode 100644 index 00000000..ae209d17 --- /dev/null +++ b/.brightsec/tests/get-api-products.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/products', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'business_constraint_bypass', 'sqli', 'xss', 'improper_asset_management'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Products`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-quantitys-1.test.ts b/.brightsec/tests/get-api-quantitys-1.test.ts new file mode 100644 index 00000000..873d284b --- /dev/null +++ b/.brightsec/tests/get-api-quantitys-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/Quantitys/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['id_enumeration', 'bopla', 'csrf', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Quantitys/1`, + headers: { 'X-Recruiting': 'We are hiring! Check out our careers page.' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-quantitys.test.ts b/.brightsec/tests/get-api-quantitys.test.ts new file mode 100644 index 00000000..6e4ff709 --- /dev/null +++ b/.brightsec/tests/get-api-quantitys.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/quantitys', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'business_constraint_bypass', 'id_enumeration', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Quantitys`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-recycles-1.test.ts b/.brightsec/tests/get-api-recycles-1.test.ts new file mode 100644 index 00000000..7fc82bc2 --- /dev/null +++ b/.brightsec/tests/get-api-recycles-1.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/recycles/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['sqli', 'id_enumeration', 'full_path_disclosure'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Recycles/1`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-security-answers-1.test.ts b/.brightsec/tests/get-api-security-answers-1.test.ts new file mode 100644 index 00000000..110d6411 --- /dev/null +++ b/.brightsec/tests/get-api-security-answers-1.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/security-answers/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'id_enumeration', 'sqli', 'xss', 'csrf'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/SecurityAnswers/1`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-security-answers.test.ts b/.brightsec/tests/get-api-security-answers.test.ts new file mode 100644 index 00000000..e0be35c0 --- /dev/null +++ b/.brightsec/tests/get-api-security-answers.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/security-answers', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'id_enumeration', 'sqli', 'xss', 'csrf'], + attackParamLocations: [AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/SecurityAnswers?email=user@example.com`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-security-questions.test.ts b/.brightsec/tests/get-api-security-questions.test.ts new file mode 100644 index 00000000..4101daeb --- /dev/null +++ b/.brightsec/tests/get-api-security-questions.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/security-questions', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'id_enumeration', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/SecurityQuestions?email=user@example.com`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-users-1.test.ts b/.brightsec/tests/get-api-users-1.test.ts new file mode 100644 index 00000000..3f594257 --- /dev/null +++ b/.brightsec/tests/get-api-users-1.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/users/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['id_enumeration', 'bopla', 'jwt', 'xss', 'sqli', 'csrf'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Users/1`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-api-users.test.ts b/.brightsec/tests/get-api-users.test.ts new file mode 100644 index 00000000..0a47755b --- /dev/null +++ b/.brightsec/tests/get-api-users.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /api/users', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'id_enumeration', 'bopla', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/api/Users`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-assets-i18n.test.ts b/.brightsec/tests/get-assets-i18n.test.ts new file mode 100644 index 00000000..5e675218 --- /dev/null +++ b/.brightsec/tests/get-assets-i18n.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /assets/i18n', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'xss', 'improper_asset_management', 'lfi'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/assets/i18n`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-assets-public-images-padding.test.ts b/.brightsec/tests/get-assets-public-images-padding.test.ts new file mode 100644 index 00000000..6a874f2d --- /dev/null +++ b/.brightsec/tests/get-assets-public-images-padding.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /assets/public/images/padding', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'xss', 'lfi', 'improper_asset_management'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/assets/public/images/padding`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-assets-public-images-products.test.ts b/.brightsec/tests/get-assets-public-images-products.test.ts new file mode 100644 index 00000000..6e5c9eae --- /dev/null +++ b/.brightsec/tests/get-assets-public-images-products.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /assets/public/images/products', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'xss', 'lfi', 'improper_asset_management', 'full_path_disclosure'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/assets/public/images/products`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-assets-public-images-uploads.test.ts b/.brightsec/tests/get-assets-public-images-uploads.test.ts new file mode 100644 index 00000000..7e89453a --- /dev/null +++ b/.brightsec/tests/get-assets-public-images-uploads.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /assets/public/images/uploads', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['lfi', 'xss', 'improper_asset_management', 'full_path_disclosure', 'file_upload'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/assets/public/images/uploads`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-dataerasure.test.ts b/.brightsec/tests/get-dataerasure.test.ts new file mode 100644 index 00000000..dcca2d88 --- /dev/null +++ b/.brightsec/tests/get-dataerasure.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /dataerasure', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'lfi', 'xss', 'id_enumeration', 'osi'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/dataerasure/`, + headers: { 'X-Recruiting': 'undefined' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-encryptionkeys-samplefile.test.ts b/.brightsec/tests/get-encryptionkeys-samplefile.test.ts new file mode 100644 index 00000000..8d970e68 --- /dev/null +++ b/.brightsec/tests/get-encryptionkeys-samplefile.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /encryptionkeys/samplefile', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['directoryListingChallenge', 'accessLogDisclosureChallenge', 'serveKeyFiles'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/encryptionkeys/samplefile`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-ftp-quarantine-samplefile-txt.test.ts b/.brightsec/tests/get-ftp-quarantine-samplefile-txt.test.ts new file mode 100644 index 00000000..adcf0578 --- /dev/null +++ b/.brightsec/tests/get-ftp-quarantine-samplefile-txt.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /ftp/quarantine/samplefile.txt', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['lfi', 'ssrf', 'full_path_disclosure', 'improper_asset_management'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/ftp/quarantine/samplefile.txt`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-ftp-sample-file-md.test.ts b/.brightsec/tests/get-ftp-sample-file-md.test.ts new file mode 100644 index 00000000..2714b9a5 --- /dev/null +++ b/.brightsec/tests/get-ftp-sample-file-md.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /ftp/sample-file.md', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['lfi', 'full_path_disclosure', 'unvalidated_redirect', 'xss'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/ftp/sample-file.md`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-ftp-sample-md.test.ts b/.brightsec/tests/get-ftp-sample-md.test.ts new file mode 100644 index 00000000..262cf40e --- /dev/null +++ b/.brightsec/tests/get-ftp-sample-md.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /ftp/sample.md', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['lfi', 'full_path_disclosure', 'directory_listing', 'ssrf'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/ftp/sample.md`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-metrics.test.ts b/.brightsec/tests/get-metrics.test.ts new file mode 100644 index 00000000..64c68666 --- /dev/null +++ b/.brightsec/tests/get-metrics.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /metrics', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'improper_asset_management', 'full_path_disclosure', 'open_database', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/metrics`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-profile.test.ts b/.brightsec/tests/get-profile.test.ts new file mode 100644 index 00000000..f14f2a0a --- /dev/null +++ b/.brightsec/tests/get-profile.test.ts @@ -0,0 +1,37 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /profile', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'xss', 'bopla', 'full_path_disclosure', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/profile`, + headers: { + 'Content-Security-Policy': "img-src 'self' ; script-src 'self' 'unsafe-eval' https://code.getmdl.io http://ajax.googleapis.com" + }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-promotion.test.ts b/.brightsec/tests/get-promotion.test.ts new file mode 100644 index 00000000..15e0fbcf --- /dev/null +++ b/.brightsec/tests/get-promotion.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /promotion', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['xss', 'csrf', 'unvalidated_redirect', 'improper_asset_management', 'full_path_disclosure'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/promotion`, + headers: { 'X-Recruiting': 'undefined' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-redirect.test.ts b/.brightsec/tests/get-redirect.test.ts new file mode 100644 index 00000000..63465bd2 --- /dev/null +++ b/.brightsec/tests/get-redirect.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /redirect?to=:url', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['unvalidated_redirect', 'ssrf'], + attackParamLocations: [AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/redirect?to=https://example.com`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-2fa-status.test.ts b/.brightsec/tests/get-rest-2fa-status.test.ts new file mode 100644 index 00000000..c3b2b8d2 --- /dev/null +++ b/.brightsec/tests/get-rest-2fa-status.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/2fa/status', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'jwt', 'id_enumeration', 'improper_asset_management'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/2fa/status`, + headers: { 'Authorization': 'Bearer ' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-admin-application-configuration.test.ts b/.brightsec/tests/get-rest-admin-application-configuration.test.ts new file mode 100644 index 00000000..4cdde846 --- /dev/null +++ b/.brightsec/tests/get-rest-admin-application-configuration.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/admin/application-configuration', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['improper_asset_management', 'secret_tokens', 'open_database', 'full_path_disclosure'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/admin/application-configuration`, + headers: { 'X-Recruiting': 'config.get(\'application.securityTxt.hiring\')' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-admin-application-version.test.ts b/.brightsec/tests/get-rest-admin-application-version.test.ts new file mode 100644 index 00000000..ef8e7c80 --- /dev/null +++ b/.brightsec/tests/get-rest-admin-application-version.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/admin/application-version', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['improper_asset_management', 'full_path_disclosure', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/admin/application-version`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-basket-1-order.test.ts b/.brightsec/tests/get-rest-basket-1-order.test.ts new file mode 100644 index 00000000..b93bb81c --- /dev/null +++ b/.brightsec/tests/get-rest-basket-1-order.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/basket/1/order', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'id_enumeration', 'bopla', 'business_constraint_bypass', 'xss', 'sqli'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/basket/1/order`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-basket-1.test.ts b/.brightsec/tests/get-rest-basket-1.test.ts new file mode 100644 index 00000000..56037664 --- /dev/null +++ b/.brightsec/tests/get-rest-basket-1.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/basket/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'id_enumeration', 'sqli', 'xss', 'csrf'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/basket/1`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-captcha.test.ts b/.brightsec/tests/get-rest-captcha.test.ts new file mode 100644 index 00000000..fdeeb82c --- /dev/null +++ b/.brightsec/tests/get-rest-captcha.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/captcha', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['osi', 'csrf', 'xss', 'sqli', 'id_enumeration'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/captcha`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-chatbot-status.test.ts b/.brightsec/tests/get-rest-chatbot-status.test.ts new file mode 100644 index 00000000..ec66914c --- /dev/null +++ b/.brightsec/tests/get-rest-chatbot-status.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/chatbot/status', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'jwt', 'xss', 'server_side_js_injection', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/chatbot/status`, + headers: { 'X-Recruiting': "We're hiring! Visit our careers page for more information." }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-continue-code-findit.test.ts b/.brightsec/tests/get-rest-continue-code-findit.test.ts new file mode 100644 index 00000000..f29796d3 --- /dev/null +++ b/.brightsec/tests/get-rest-continue-code-findit.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/continue-code-findIt', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['sqli', 'secret_tokens', 'full_path_disclosure'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/continue-code-findIt`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-continue-code-fixit.test.ts b/.brightsec/tests/get-rest-continue-code-fixit.test.ts new file mode 100644 index 00000000..c8f861cc --- /dev/null +++ b/.brightsec/tests/get-rest-continue-code-fixit.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/continue-code-fixIt', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['test/api/challengeApiSpec.ts'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/continue-code-fixIt`, + headers: { 'X-Recruiting': 'We are hiring!' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-continue-code.test.ts b/.brightsec/tests/get-rest-continue-code.test.ts new file mode 100644 index 00000000..04f7e832 --- /dev/null +++ b/.brightsec/tests/get-rest-continue-code.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/continue-code', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['sqli', 'xss', 'csrf', 'business_constraint_bypass'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/continue-code`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-country-mapping.test.ts b/.brightsec/tests/get-rest-country-mapping.test.ts new file mode 100644 index 00000000..2ff0c536 --- /dev/null +++ b/.brightsec/tests/get-rest-country-mapping.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/country-mapping', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['improper_asset_management', 'full_path_disclosure', 'open_database', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/country-mapping`, + headers: { 'X-Recruiting': 'config.get(\'application.securityTxt.hiring\')' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-deluxe-membership.test.ts b/.brightsec/tests/get-rest-deluxe-membership.test.ts new file mode 100644 index 00000000..b5f8734d --- /dev/null +++ b/.brightsec/tests/get-rest-deluxe-membership.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/deluxe-membership', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'id_enumeration', 'improper_asset_management', 'xss'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/deluxe-membership`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-image-captcha.test.ts b/.brightsec/tests/get-rest-image-captcha.test.ts new file mode 100644 index 00000000..68673450 --- /dev/null +++ b/.brightsec/tests/get-rest-image-captcha.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/image-captcha', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'xss', 'id_enumeration', 'improper_asset_management'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/image-captcha`, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-languages.test.ts b/.brightsec/tests/get-rest-languages.test.ts new file mode 100644 index 00000000..8a46ed68 --- /dev/null +++ b/.brightsec/tests/get-rest-languages.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/languages', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['full_path_disclosure', 'sqli', 'xss', 'lfi', 'business_constraint_bypass'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/languages`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-memories.test.ts b/.brightsec/tests/get-rest-memories.test.ts new file mode 100644 index 00000000..2d57d0d8 --- /dev/null +++ b/.brightsec/tests/get-rest-memories.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/memories', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'id_enumeration', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/memories`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-order-history-orders.test.ts b/.brightsec/tests/get-rest-order-history-orders.test.ts new file mode 100644 index 00000000..4f4c21dc --- /dev/null +++ b/.brightsec/tests/get-rest-order-history-orders.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/order-history/orders', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'id_enumeration', 'improper_asset_management', 'sqli'], + attackParamLocations: [AttackParamLocation.HEADER, AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/order-history/orders`, + headers: { 'X-Recruiting': 'We are hiring! Check out our careers page.' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/get-rest-order-history.test.ts b/.brightsec/tests/get-rest-order-history.test.ts new file mode 100644 index 00000000..b662a0b7 --- /dev/null +++ b/.brightsec/tests/get-rest-order-history.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/order-history', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'nosql', 'csrf', 'id_enumeration'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/order-history`, + headers: { 'Authorization': 'Bearer ' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-products-1-reviews.test.ts b/.brightsec/tests/get-rest-products-1-reviews.test.ts new file mode 100644 index 00000000..98c55de6 --- /dev/null +++ b/.brightsec/tests/get-rest-products-1-reviews.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/products/1/reviews', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['nosql', 'business_constraint_bypass', 'osi', 'stored_xss'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/products/1/reviews`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-products-search.test.ts b/.brightsec/tests/get-rest-products-search.test.ts new file mode 100644 index 00000000..99d4c859 --- /dev/null +++ b/.brightsec/tests/get-rest-products-search.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/products/search?q=:query', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['sqli', 'xss', 'full_path_disclosure', 'business_constraint_bypass'], + attackParamLocations: [AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/products/search?q=apple`, + headers: { 'X-Recruiting': 'We are hiring!' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-repeat-notification.test.ts b/.brightsec/tests/get-rest-repeat-notification.test.ts new file mode 100644 index 00000000..f180cdde --- /dev/null +++ b/.brightsec/tests/get-rest-repeat-notification.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/repeat-notification', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['xss', 'unvalidated_redirect', 'csrf', 'bopla'], + attackParamLocations: [AttackParamLocation.QUERY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/repeat-notification?challenge=OWASP%20Juice%20Shop`, + headers: { 'X-Recruiting': 'true' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-save-login-ip.test.ts b/.brightsec/tests/get-rest-save-login-ip.test.ts new file mode 100644 index 00000000..4b10ce9a --- /dev/null +++ b/.brightsec/tests/get-rest-save-login-ip.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/saveLoginIp', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['xss', 'csrf', 'bopla', 'osi'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/saveLoginIp`, + headers: { 'X-Recruiting': 'We are hiring! Check out our careers page.' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-track-order-12345.test.ts b/.brightsec/tests/get-rest-track-order-12345.test.ts new file mode 100644 index 00000000..9f32df26 --- /dev/null +++ b/.brightsec/tests/get-rest-track-order-12345.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/track-order/:id', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['xss', 'nosql', 'osi', 'id_enumeration'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/track-order/12345`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-user-authentication-details.test.ts b/.brightsec/tests/get-rest-user-authentication-details.test.ts new file mode 100644 index 00000000..0428f1b1 --- /dev/null +++ b/.brightsec/tests/get-rest-user-authentication-details.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/user/authentication-details', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'xss', 'id_enumeration', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/user/authentication-details`, + headers: { 'X-Recruiting': 'config.get(\'application.securityTxt.hiring\')' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-user-change-password.test.ts b/.brightsec/tests/get-rest-user-change-password.test.ts new file mode 100644 index 00000000..d9105dab --- /dev/null +++ b/.brightsec/tests/get-rest-user-change-password.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/user/change-password', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'xss', 'bopla', 'jwt', 'sqli'], + attackParamLocations: [AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/user/change-password?current=currentPassword123&new=newPassword123&repeat=newPassword123`, + headers: { 'Authorization': 'Bearer ' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-user-security-question.test.ts b/.brightsec/tests/get-rest-user-security-question.test.ts new file mode 100644 index 00000000..45aa5284 --- /dev/null +++ b/.brightsec/tests/get-rest-user-security-question.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/user/security-question', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'id_enumeration', 'email_injection', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.QUERY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/user/security-question?email=user@example.com`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-user-whoami.test.ts b/.brightsec/tests/get-rest-user-whoami.test.ts new file mode 100644 index 00000000..1779d049 --- /dev/null +++ b/.brightsec/tests/get-rest-user-whoami.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/user/whoami', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'xss', 'id_enumeration', 'open_database', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.HEADER, AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/user/whoami?callback=callbackFunction`, + headers: { 'X-Recruiting': 'undefined' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-wallet-balance.test.ts b/.brightsec/tests/get-rest-wallet-balance.test.ts new file mode 100644 index 00000000..b4df289a --- /dev/null +++ b/.brightsec/tests/get-rest-wallet-balance.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/wallet/balance', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'id_enumeration', 'xss', 'insecure_tls_configuration'], + attackParamLocations: [AttackParamLocation.HEADER, AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/wallet/balance`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-web3-nft-mint-listen.test.ts b/.brightsec/tests/get-rest-web3-nft-mint-listen.test.ts new file mode 100644 index 00000000..85a79709 --- /dev/null +++ b/.brightsec/tests/get-rest-web3-nft-mint-listen.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/web3/nftMintListen', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['ssrf', 'secret_tokens', 'osi', 'csrf'], + attackParamLocations: [AttackParamLocation.QUERY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/web3/nftMintListen`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-rest-web3-nft-unlocked.test.ts b/.brightsec/tests/get-rest-web3-nft-unlocked.test.ts new file mode 100644 index 00000000..14b8b34b --- /dev/null +++ b/.brightsec/tests/get-rest-web3-nft-unlocked.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /rest/web3/nftUnlocked', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'full_path_disclosure', 'improper_asset_management', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/rest/web3/nftUnlocked`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-security-txt.test.ts b/.brightsec/tests/get-security-txt.test.ts new file mode 100644 index 00000000..ee24085d --- /dev/null +++ b/.brightsec/tests/get-security-txt.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /security.txt', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'full_path_disclosure', 'improper_asset_management', 'xss'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/security.txt`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-snippets-fixes-sample-key.test.ts b/.brightsec/tests/get-snippets-fixes-sample-key.test.ts new file mode 100644 index 00000000..b522b5dd --- /dev/null +++ b/.brightsec/tests/get-snippets-fixes-sample-key.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /snippets/fixes/sampleKey', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'lfi', 'xss', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/snippets/fixes/sampleKey`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-snippets-sample-challenge.test.ts b/.brightsec/tests/get-snippets-sample-challenge.test.ts new file mode 100644 index 00000000..03ca8c80 --- /dev/null +++ b/.brightsec/tests/get-snippets-sample-challenge.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /snippets/sample-challenge', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['xss', 'csrf', 'id_enumeration', 'improper_asset_management', 'full_path_disclosure'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/snippets/sample-challenge`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-solve-challenges-server-side.test.ts b/.brightsec/tests/get-solve-challenges-server-side.test.ts new file mode 100644 index 00000000..27eae98d --- /dev/null +++ b/.brightsec/tests/get-solve-challenges-server-side.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /solve/challenges/server-side?key=:key', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['ssrf', 'ssti', 'xss', 'csrf', 'osi'], + attackParamLocations: [AttackParamLocation.QUERY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/solve/challenges/server-side?key=tRy_H4rd3r_n0thIng_iS_Imp0ssibl3`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-support-logs-sample-log.test.ts b/.brightsec/tests/get-support-logs-sample-log.test.ts new file mode 100644 index 00000000..f224d732 --- /dev/null +++ b/.brightsec/tests/get-support-logs-sample-log.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /support/logs/sample.log', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['lfi', 'full_path_disclosure', 'access_control'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/support/logs/sample.log`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-the-devs-are-so-funny-they-hid-an-easter-egg-within-the-easter-egg.test.ts b/.brightsec/tests/get-the-devs-are-so-funny-they-hid-an-easter-egg-within-the-easter-egg.test.ts new file mode 100644 index 00000000..8940c9c7 --- /dev/null +++ b/.brightsec/tests/get-the-devs-are-so-funny-they-hid-an-easter-egg-within-the-easter-egg.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /the/devs/are/so/funny/they/hid/an/easter/egg/within/the/easter/egg', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['xss', 'csrf', 'improper_asset_management', 'full_path_disclosure', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/the/devs/are/so/funny/they/hid/an/easter/egg/within/the/easter/egg`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-this-page-is-hidden-behind-an-incredibly-high-paywall-that-could-only-be-unlocked-by-sending-1btc-to-us.test.ts b/.brightsec/tests/get-this-page-is-hidden-behind-an-incredibly-high-paywall-that-could-only-be-unlocked-by-sending-1btc-to-us.test.ts new file mode 100644 index 00000000..7b99a580 --- /dev/null +++ b/.brightsec/tests/get-this-page-is-hidden-behind-an-incredibly-high-paywall-that-could-only-be-unlocked-by-sending-1btc-to-us.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /this/page/is/hidden/behind/an/incredibly/high/paywall/that/could/only/be/unlocked/by/sending/1btc/to/us', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'xss', 'unvalidated_redirect', 'sqli', 'ssrf', 'osi', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/this/page/is/hidden/behind/an/incredibly/high/paywall/that/could/only/be/unlocked/by/sending/1btc/to/us`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-video-range-bytes-0-1023.test.ts b/.brightsec/tests/get-video-range-bytes-0-1023.test.ts new file mode 100644 index 00000000..cf371b86 --- /dev/null +++ b/.brightsec/tests/get-video-range-bytes-0-1023.test.ts @@ -0,0 +1,41 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /video?range=bytes=0-1023', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['xss', 'ssrf', 'lfi', 'full_path_disclosure'], + attackParamLocations: [AttackParamLocation.QUERY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/video?range=bytes=0-1023`, + headers: { + 'Content-Range': 'bytes 0-1023/2048', + 'Accept-Ranges': 'bytes', + 'Content-Length': '1024', + 'Content-Location': '/assets/public/videos/owasp_promo.mp4', + 'Content-Type': 'video/mp4' + }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-we-may-also-instruct-you-to-refuse-all-reasonably-necessary-responsibility.test.ts b/.brightsec/tests/get-we-may-also-instruct-you-to-refuse-all-reasonably-necessary-responsibility.test.ts new file mode 100644 index 00000000..8d88989b --- /dev/null +++ b/.brightsec/tests/get-we-may-also-instruct-you-to-refuse-all-reasonably-necessary-responsibility.test.ts @@ -0,0 +1,34 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /we/may/also/instruct/you/to/refuse/all/reasonably/necessary/responsibility', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'xss', 'full_path_disclosure', 'improper_asset_management', 'sqli', 'ssrf'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/we/may/also/instruct/you/to/refuse/all/reasonably/necessary/responsibility`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-well-known-samplefile.test.ts b/.brightsec/tests/get-well-known-samplefile.test.ts new file mode 100644 index 00000000..65748df0 --- /dev/null +++ b/.brightsec/tests/get-well-known-samplefile.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /.well-known/samplefile', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['improper_asset_management', 'full_path_disclosure', 'xss', 'csrf'], + attackParamLocations: [AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/.well-known/samplefile`, + headers: { 'X-Recruiting': 'We are hiring! Visit our careers page for more information.' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-well-known-security-txt.test.ts b/.brightsec/tests/get-well-known-security-txt.test.ts new file mode 100644 index 00000000..489ed7c0 --- /dev/null +++ b/.brightsec/tests/get-well-known-security-txt.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /.well-known/security.txt', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'full_path_disclosure', 'improper_asset_management', 'unvalidated_redirect'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/.well-known/security.txt`, + headers: { 'X-Recruiting': '/#/jobs' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/get-well-known.test.ts b/.brightsec/tests/get-well-known.test.ts new file mode 100644 index 00000000..22e98f39 --- /dev/null +++ b/.brightsec/tests/get-well-known.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('GET /.well-known', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['improper_asset_management', 'full_path_disclosure', 'directory_listing'], + attackParamLocations: [AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.GET, + url: `${baseUrl}/.well-known`, + headers: { 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/patch-rest-products-id-reviews.test.ts b/.brightsec/tests/patch-rest-products-id-reviews.test.ts new file mode 100644 index 00000000..c4b5dcfd --- /dev/null +++ b/.brightsec/tests/patch-rest-products-id-reviews.test.ts @@ -0,0 +1,39 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PATCH /rest/products/:id/reviews', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['nosql', 'bopla', 'csrf'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PATCH, + url: `${baseUrl}/rest/products/507f1f77bcf86cd799439011/reviews`, + body: { + id: '507f1f77bcf86cd799439011', + message: 'This is an updated review message.' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/patch-rest-products-reviews.test.ts b/.brightsec/tests/patch-rest-products-reviews.test.ts new file mode 100644 index 00000000..f1dd225d --- /dev/null +++ b/.brightsec/tests/patch-rest-products-reviews.test.ts @@ -0,0 +1,39 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PATCH /rest/products/reviews', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'nosql', 'xss'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PATCH, + url: `${baseUrl}/rest/products/reviews`, + body: { + id: '507f1f77bcf86cd799439011', + message: 'Updated review message' + }, + headers: { 'X-Recruiting': '', 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-addresses.test.ts b/.brightsec/tests/post-api-addresses.test.ts new file mode 100644 index 00000000..c2bdca17 --- /dev/null +++ b/.brightsec/tests/post-api-addresses.test.ts @@ -0,0 +1,45 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/addresses', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'sqli', 'xss', 'csrf', 'id_enumeration'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/Addresses`, + body: { + UserId: 1, + fullName: 'John Doe', + mobileNum: 1234567890, + zipCode: '12345', + streetAddress: '123 Main St', + city: 'Metropolis', + state: 'NY', + country: 'USA' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-addresss.test.ts b/.brightsec/tests/post-api-addresss.test.ts new file mode 100644 index 00000000..70d6b2b4 --- /dev/null +++ b/.brightsec/tests/post-api-addresss.test.ts @@ -0,0 +1,45 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/addresss', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'sqli', 'xss', 'csrf', 'id_enumeration'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/Addresss`, + body: { + UserId: 1, + fullName: 'John Doe', + mobileNum: 1234567890, + zipCode: '12345', + streetAddress: '123 Main St', + city: 'Metropolis', + state: 'NY', + country: 'USA' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-basket-items.test.ts b/.brightsec/tests/post-api-basket-items.test.ts new file mode 100644 index 00000000..07ad83cd --- /dev/null +++ b/.brightsec/tests/post-api-basket-items.test.ts @@ -0,0 +1,36 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/basket-items', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'id_enumeration', 'sqli', 'xss', 'csrf', 'business_constraint_bypass'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/BasketItems`, + body: [{ "ProductId": 1, "BasketId": 1, "quantity": 2 }], + headers: { 'Content-Type': 'application/json', 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-cards.test.ts b/.brightsec/tests/post-api-cards.test.ts new file mode 100644 index 00000000..b9fc14cd --- /dev/null +++ b/.brightsec/tests/post-api-cards.test.ts @@ -0,0 +1,43 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/cards', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'sqli', 'xss', 'csrf', 'date_manipulation'], + attackParamLocations: [AttackParamLocation.BODY], + skipStaticParams: false + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/Cards`, + body: { + UserId: 1, + fullName: 'John Doe', + cardNum: 1234567812345678, + expMonth: 12, + expYear: 2099 + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-challenges.test.ts b/.brightsec/tests/post-api-challenges.test.ts new file mode 100644 index 00000000..f51d3aaf --- /dev/null +++ b/.brightsec/tests/post-api-challenges.test.ts @@ -0,0 +1,49 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/challenges', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['stored_xss', 'csrf', 'bopla', 'business_constraint_bypass', 'osi'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/Challenges`, + body: { + key: 'restfulXssChallenge', + name: 'Sample Challenge', + category: 'Security', + description: 'A challenge to test XSS vulnerabilities.', + difficulty: 3, + hint: 'Try injecting scripts.', + hintUrl: 'http://example.com/hint', + mitigationUrl: 'http://example.com/mitigation', + tags: 'xss,security', + solved: false, + codingChallengeStatus: 0, + hasCodingChallenge: true + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-complaints.test.ts b/.brightsec/tests/post-api-complaints.test.ts new file mode 100644 index 00000000..17dbbc05 --- /dev/null +++ b/.brightsec/tests/post-api-complaints.test.ts @@ -0,0 +1,40 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/complaints', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['file_upload', 'bopla', 'xss', 'sqli', 'csrf', 'osi'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/Complaints`, + body: { + UserId: 123, + message: "This is a sample complaint message.", + file: "optional-file-path.jpg" + }, + headers: { 'Content-Type': 'application/json', 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-feedbacks.test.ts b/.brightsec/tests/post-api-feedbacks.test.ts new file mode 100644 index 00000000..e1d632df --- /dev/null +++ b/.brightsec/tests/post-api-feedbacks.test.ts @@ -0,0 +1,40 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/feedbacks', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'xss', 'bopla', 'sqli', 'nosql'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/Feedbacks`, + body: { + UserId: 123, + comment: 'Great product!', + rating: 5 + }, + headers: { 'Content-Type': 'application/json', 'X-Recruiting': 'true' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-privacy-requests.test.ts b/.brightsec/tests/post-api-privacy-requests.test.ts new file mode 100644 index 00000000..4640a765 --- /dev/null +++ b/.brightsec/tests/post-api-privacy-requests.test.ts @@ -0,0 +1,40 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/privacy-requests', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'sqli', 'ssti', 'xss', 'file_upload'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/PrivacyRequests`, + body: { + email: 'user@example.com', + securityAnswer: 'exampleAnswer', + layout: 'optionalLayout.hbs' + }, + headers: { 'Content-Type': 'application/json', 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-products.test.ts b/.brightsec/tests/post-api-products.test.ts new file mode 100644 index 00000000..8bad4324 --- /dev/null +++ b/.brightsec/tests/post-api-products.test.ts @@ -0,0 +1,42 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/products', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'file_upload', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/Products`, + body: { + name: 'Apple Juice', + description: 'Freshly squeezed apple juice', + price: 3.99, + deluxePrice: 5.99, + image: 'apple-juice.png' + }, + headers: { 'Content-Type': 'application/json', 'X-Recruiting': 'We are hiring!' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-quantitys.test.ts b/.brightsec/tests/post-api-quantitys.test.ts new file mode 100644 index 00000000..8071ddca --- /dev/null +++ b/.brightsec/tests/post-api-quantitys.test.ts @@ -0,0 +1,39 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/quantitys', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'sqli', 'xss', 'id_enumeration'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/Quantitys`, + body: { + ProductId: 1, + quantity: 5 + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-recycles.test.ts b/.brightsec/tests/post-api-recycles.test.ts new file mode 100644 index 00000000..778e8e88 --- /dev/null +++ b/.brightsec/tests/post-api-recycles.test.ts @@ -0,0 +1,43 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/recycles', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'business_constraint_bypass', 'date_manipulation', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.BODY], + skipStaticParams: false + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/Recycles`, + body: { + UserId: 1, + AddressId: 1, + quantity: 10, + isPickup: true, + date: '2023-10-01T10:00:00Z' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-security-questions.test.ts b/.brightsec/tests/post-api-security-questions.test.ts new file mode 100644 index 00000000..42a5c291 --- /dev/null +++ b/.brightsec/tests/post-api-security-questions.test.ts @@ -0,0 +1,39 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/security-questions', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'sqli', 'xss', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/SecurityQuestions`, + body: { + question: 'What is your pet’s name?', + answer: 'Fluffy' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-api-users.test.ts b/.brightsec/tests/post-api-users.test.ts new file mode 100644 index 00000000..3ac8db0d --- /dev/null +++ b/.brightsec/tests/post-api-users.test.ts @@ -0,0 +1,40 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /api/users', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'xss', 'sqli', 'bopla', 'email_injection', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/api/Users`, + body: { + email: 'user@example.com', + password: 'securePassword123', + passwordRepeat: 'securePassword123' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-b2b-v2-orders.test.ts b/.brightsec/tests/post-b2b-v2-orders.test.ts new file mode 100644 index 00000000..99cd1718 --- /dev/null +++ b/.brightsec/tests/post-b2b-v2-orders.test.ts @@ -0,0 +1,42 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /b2b/v2/orders', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['osi', 'business_constraint_bypass', 'csrf', 'xss', 'sqli'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/b2b/v2/orders`, + body: { + cid: 'exampleCID', + orderLinesData: 'exampleOrderLinesData' + }, + headers: { + 'Content-Type': 'application/json', + 'X-Recruiting': '' + }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-dataerasure.test.ts b/.brightsec/tests/post-dataerasure.test.ts new file mode 100644 index 00000000..0f45ddf5 --- /dev/null +++ b/.brightsec/tests/post-dataerasure.test.ts @@ -0,0 +1,40 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /dataerasure', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['lfi', 'csrf', 'xss', 'osi'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/dataerasure`, + body: { + email: 'user@example.com', + securityAnswer: 'myAnswer', + layout: 'optionalLayout' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-file-upload.test.ts b/.brightsec/tests/post-file-upload.test.ts new file mode 100644 index 00000000..f49ca602 --- /dev/null +++ b/.brightsec/tests/post-file-upload.test.ts @@ -0,0 +1,36 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /file-upload', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['file_upload', 'xss', 'osi', 'ssrf', 'lfi'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/file-upload`, + headers: { 'Content-Type': 'multipart/form-data' }, + body: `--boundary\r\nContent-Disposition: form-data; name="file"; filename="example.zip"\r\nContent-Type: application/zip\r\n\r\n\r\n--boundary--`, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-profile-image-file.test.ts b/.brightsec/tests/post-profile-image-file.test.ts new file mode 100644 index 00000000..6f05764c --- /dev/null +++ b/.brightsec/tests/post-profile-image-file.test.ts @@ -0,0 +1,36 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /profile/image/file', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['file_upload', 'ssrf', 'xss', 'csrf'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/profile/image/file`, + headers: { 'X-Recruiting': 'We are hiring! Visit our careers page for more information.' }, + body: { file: '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-profile-image-url.test.ts b/.brightsec/tests/post-profile-image-url.test.ts new file mode 100644 index 00000000..aee59a27 --- /dev/null +++ b/.brightsec/tests/post-profile-image-url.test.ts @@ -0,0 +1,38 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /profile/image/url', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['ssrf', 'file_upload', 'xss', 'unvalidated_redirect'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/profile/image/url`, + body: { + imageUrl: 'https://example.com/image.jpg' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-profile.test.ts b/.brightsec/tests/post-profile.test.ts new file mode 100644 index 00000000..6a445df8 --- /dev/null +++ b/.brightsec/tests/post-profile.test.ts @@ -0,0 +1,38 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /profile', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'xss', 'sqli', 'proto_pollution'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/profile`, + body: { + username: 'newUsername' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-rest-2fa-disable.test.ts b/.brightsec/tests/post-rest-2fa-disable.test.ts new file mode 100644 index 00000000..1913a458 --- /dev/null +++ b/.brightsec/tests/post-rest-2fa-disable.test.ts @@ -0,0 +1,38 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/2fa/disable', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'osi', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/2fa/disable`, + body: { + password: 'examplePassword123' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-rest-2fa-setup.test.ts b/.brightsec/tests/post-rest-2fa-setup.test.ts new file mode 100644 index 00000000..eec835bb --- /dev/null +++ b/.brightsec/tests/post-rest-2fa-setup.test.ts @@ -0,0 +1,43 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/2fa/setup', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'osi', 'secret_tokens', 'stored_xss'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/2fa/setup`, + body: { + password: 'examplePassword123', + setupToken: 'exampleSetupToken', + initialToken: '123456' + }, + headers: { + 'Content-Type': 'application/json', + 'X-Recruiting': 'We are hiring! Check our careers page.' + }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-rest-2fa-verify.test.ts b/.brightsec/tests/post-rest-2fa-verify.test.ts new file mode 100644 index 00000000..4e6dcd9a --- /dev/null +++ b/.brightsec/tests/post-rest-2fa-verify.test.ts @@ -0,0 +1,39 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/2fa/verify', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['jwt', 'bopla', 'xss', 'sqli', 'csrf', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/2fa/verify`, + body: { + tmpToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', + totpToken: '123456' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-rest-basket-1-checkout.test.ts b/.brightsec/tests/post-rest-basket-1-checkout.test.ts new file mode 100644 index 00000000..705a83ab --- /dev/null +++ b/.brightsec/tests/post-rest-basket-1-checkout.test.ts @@ -0,0 +1,43 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/basket/1/checkout', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'business_constraint_bypass', 'csrf', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/basket/1/checkout`, + body: { + orderDetails: { + deliveryMethodId: 1, + paymentId: 'wallet', + addressId: 123 + }, + UserId: 456 + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/post-rest-chatbot-respond.test.ts b/.brightsec/tests/post-rest-chatbot-respond.test.ts new file mode 100644 index 00000000..c2d1f01c --- /dev/null +++ b/.brightsec/tests/post-rest-chatbot-respond.test.ts @@ -0,0 +1,39 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/chatbot/respond', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['jwt', 'xss', 'csrf', 'osi', 'nosql'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/chatbot/respond`, + body: { + action: 'query', + query: 'Hello, how are you?' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-rest-deluxe-membership.test.ts b/.brightsec/tests/post-rest-deluxe-membership.test.ts new file mode 100644 index 00000000..04b61f43 --- /dev/null +++ b/.brightsec/tests/post-rest-deluxe-membership.test.ts @@ -0,0 +1,39 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/deluxe-membership', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'sqli', 'xss', 'business_constraint_bypass', 'jwt'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/deluxe-membership`, + body: { + UserId: 123, + paymentMode: 'wallet' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-rest-memories.test.ts b/.brightsec/tests/post-rest-memories.test.ts new file mode 100644 index 00000000..967fd969 --- /dev/null +++ b/.brightsec/tests/post-rest-memories.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/memories', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['file_upload', 'stored_xss', 'bopla', 'csrf'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/memories`, + headers: { 'Content-Type': 'multipart/form-data' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-rest-products-123-reviews.test.ts b/.brightsec/tests/post-rest-products-123-reviews.test.ts new file mode 100644 index 00000000..d8e0882d --- /dev/null +++ b/.brightsec/tests/post-rest-products-123-reviews.test.ts @@ -0,0 +1,42 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/products/123/reviews', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'xss', 'sqli', 'email_injection', 'bopla'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/products/123/reviews`, + body: { + message: 'Great product!', + author: 'user@example.com' + }, + headers: { + 'Content-Type': 'application/json', + 'X-Forwarded-For': '192.168.1.1' + }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-rest-user-data-export.test.ts b/.brightsec/tests/post-rest-user-data-export.test.ts new file mode 100644 index 00000000..dfaf4dad --- /dev/null +++ b/.brightsec/tests/post-rest-user-data-export.test.ts @@ -0,0 +1,38 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/user/data-export', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'nosql', 'xss', 'csrf'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/user/data-export`, + body: { + UserId: '123' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/post-rest-user-login.test.ts b/.brightsec/tests/post-rest-user-login.test.ts new file mode 100644 index 00000000..5e85f436 --- /dev/null +++ b/.brightsec/tests/post-rest-user-login.test.ts @@ -0,0 +1,39 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/user/login', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['sqli', 'csrf', 'xss', 'jwt', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/user/login`, + body: { + email: 'user@example.com', + password: 'securePassword123' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-rest-user-reset-password.test.ts b/.brightsec/tests/post-rest-user-reset-password.test.ts new file mode 100644 index 00000000..94a15382 --- /dev/null +++ b/.brightsec/tests/post-rest-user-reset-password.test.ts @@ -0,0 +1,41 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/user/reset-password', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'email_injection', 'osi', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/user/reset-password`, + body: { + email: 'user@example.com', + answer: 'correct_answer', + new: 'new_password', + repeat: 'new_password' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-rest-web3-submit-key.test.ts b/.brightsec/tests/post-rest-web3-submit-key.test.ts new file mode 100644 index 00000000..3d844c65 --- /dev/null +++ b/.brightsec/tests/post-rest-web3-submit-key.test.ts @@ -0,0 +1,38 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/web3/submitKey', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['secret_tokens', 'csrf', 'osi', 'xss', 'sqli'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/web3/submitKey`, + body: { + privateKey: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-rest-web3-wallet-exploit-address.test.ts b/.brightsec/tests/post-rest-web3-wallet-exploit-address.test.ts new file mode 100644 index 00000000..723306bd --- /dev/null +++ b/.brightsec/tests/post-rest-web3-wallet-exploit-address.test.ts @@ -0,0 +1,38 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/web3/walletExploitAddress', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['ssrf', 'osi', 'csrf', 'xss', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/web3/walletExploitAddress`, + body: { + walletAddress: '0x1234567890abcdef1234567890abcdef12345678' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-rest-web3-wallet-nft-verify.test.ts b/.brightsec/tests/post-rest-web3-wallet-nft-verify.test.ts new file mode 100644 index 00000000..574ddaf8 --- /dev/null +++ b/.brightsec/tests/post-rest-web3-wallet-nft-verify.test.ts @@ -0,0 +1,38 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /rest/web3/walletNFTVerify', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'xss', 'osi', 'nosql'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/rest/web3/walletNFTVerify`, + body: { + walletAddress: '0x1234567890abcdef1234567890abcdef12345678' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-snippets-fixes.test.ts b/.brightsec/tests/post-snippets-fixes.test.ts new file mode 100644 index 00000000..a4190c64 --- /dev/null +++ b/.brightsec/tests/post-snippets-fixes.test.ts @@ -0,0 +1,39 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /snippets/fixes', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'xss', 'secret_tokens', 'sqli'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/snippets/fixes`, + body: { + key: 'exampleKey', + selectedFix: 1 + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/post-snippets-verdict.test.ts b/.brightsec/tests/post-snippets-verdict.test.ts new file mode 100644 index 00000000..4bcc685a --- /dev/null +++ b/.brightsec/tests/post-snippets-verdict.test.ts @@ -0,0 +1,39 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('POST /snippets/verdict', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'xss', 'sqli', 'nosql', 'osi', 'ssti'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.POST, + url: `${baseUrl}/snippets/verdict`, + body: { + selectedLines: [1, 2, 3], + key: 'exampleKey' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/put-api-addresses-1.test.ts b/.brightsec/tests/put-api-addresses-1.test.ts new file mode 100644 index 00000000..70a6d245 --- /dev/null +++ b/.brightsec/tests/put-api-addresses-1.test.ts @@ -0,0 +1,44 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /api/addresses/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/api/Addresses/1`, + body: { + fullName: 'John Doe', + mobileNum: 1234567890, + zipCode: '12345', + streetAddress: '123 Main St', + city: 'Metropolis', + state: 'NY', + country: 'USA' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-addresss-1.test.ts b/.brightsec/tests/put-api-addresss-1.test.ts new file mode 100644 index 00000000..ebf3ac9c --- /dev/null +++ b/.brightsec/tests/put-api-addresss-1.test.ts @@ -0,0 +1,44 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /api/addresss/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'sqli', 'xss', 'id_enumeration'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/api/Addresss/1`, + body: { + fullName: 'John Doe', + mobileNum: 1234567890, + zipCode: '12345', + streetAddress: '123 Main St', + city: 'Metropolis', + state: 'NY', + country: 'USA' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/put-api-basket-items-1.test.ts b/.brightsec/tests/put-api-basket-items-1.test.ts new file mode 100644 index 00000000..60269fdc --- /dev/null +++ b/.brightsec/tests/put-api-basket-items-1.test.ts @@ -0,0 +1,40 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /api/basket-items/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'business_constraint_bypass', 'csrf', 'id_enumeration', 'sqli'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/api/BasketItems/1`, + body: { + ProductId: 1, + BasketId: 1, + quantity: 2 + }, + headers: { 'Content-Type': 'application/json', 'X-Recruiting': 'true' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-cards-1.test.ts b/.brightsec/tests/put-api-cards-1.test.ts new file mode 100644 index 00000000..9fc54c22 --- /dev/null +++ b/.brightsec/tests/put-api-cards-1.test.ts @@ -0,0 +1,42 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /api/cards/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'sqli', 'xss', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/api/Cards/1`, + body: { + UserId: 1, + fullName: 'John Doe', + cardNum: 1234567812345678, + expMonth: 12, + expYear: 2090 + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-challenges-1.test.ts b/.brightsec/tests/put-api-challenges-1.test.ts new file mode 100644 index 00000000..81e0da5e --- /dev/null +++ b/.brightsec/tests/put-api-challenges-1.test.ts @@ -0,0 +1,49 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /api/challenges/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'stored_xss', 'csrf', 'sqli', 'osi'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/api/Challenges/1`, + body: { + name: "New Challenge Name", + category: "Security", + description: "Solve the XSS challenge", + difficulty: 3, + hint: "Try looking at the source code", + hintUrl: "http://example.com/hint", + mitigationUrl: "http://example.com/mitigation", + key: "restfulXssChallenge", + tags: "xss,security", + solved: false, + codingChallengeStatus: 0, + hasCodingChallenge: true + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/put-api-feedbacks-1.test.ts b/.brightsec/tests/put-api-feedbacks-1.test.ts new file mode 100644 index 00000000..298cd3f8 --- /dev/null +++ b/.brightsec/tests/put-api-feedbacks-1.test.ts @@ -0,0 +1,43 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /api/feedbacks/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'xss', 'sqli', 'id_enumeration'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/api/Feedbacks/1`, + body: { + UserId: 1, + comment: 'Great product!', + rating: 5 + }, + headers: { + 'Content-Type': 'application/json', + 'X-Recruiting': 'Your Company is Hiring!' + }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/put-api-privacy-requests-1.test.ts b/.brightsec/tests/put-api-privacy-requests-1.test.ts new file mode 100644 index 00000000..03dd1157 --- /dev/null +++ b/.brightsec/tests/put-api-privacy-requests-1.test.ts @@ -0,0 +1,42 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /api/PrivacyRequests/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'id_enumeration', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/api/PrivacyRequests/1`, + body: { + UserId: 123, + deletionRequested: true + }, + headers: { + 'Content-Type': 'application/json', + 'X-Recruiting': 'We are hiring! Check out our careers page.' + }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-quantitys-1.test.ts b/.brightsec/tests/put-api-quantitys-1.test.ts new file mode 100644 index 00000000..1d37cef6 --- /dev/null +++ b/.brightsec/tests/put-api-quantitys-1.test.ts @@ -0,0 +1,40 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /api/quantitys/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'business_constraint_bypass', 'sqli', 'csrf', 'xss'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/api/Quantitys/1`, + body: { + ProductId: 1, + quantity: 100, + limitPerUser: 5 + }, + headers: { 'X-Recruiting': 'true', 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-recycles-1.test.ts b/.brightsec/tests/put-api-recycles-1.test.ts new file mode 100644 index 00000000..72083a26 --- /dev/null +++ b/.brightsec/tests/put-api-recycles-1.test.ts @@ -0,0 +1,42 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /api/recycles/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['sqli', 'bopla', 'csrf', 'id_enumeration', 'date_manipulation'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.PATH] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/api/Recycles/1`, + body: { + UserId: 1, + AddressId: 1, + quantity: 10, + isPickup: true, + date: '2023-10-01T00:00:00Z' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-security-answers-1.test.ts b/.brightsec/tests/put-api-security-answers-1.test.ts new file mode 100644 index 00000000..339720f2 --- /dev/null +++ b/.brightsec/tests/put-api-security-answers-1.test.ts @@ -0,0 +1,38 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /api/security-answers/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'id_enumeration', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/api/SecurityAnswers/1`, + body: { + answer: 'Blurp' + }, + headers: { 'Authorization': `Bearer ${process.env.BRIGHT_AUTH_ID}` }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/put-api-security-questions-1.test.ts b/.brightsec/tests/put-api-security-questions-1.test.ts new file mode 100644 index 00000000..9b6251ed --- /dev/null +++ b/.brightsec/tests/put-api-security-questions-1.test.ts @@ -0,0 +1,41 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /api/security-questions/1', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'xss', 'sqli', 'id_enumeration'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/api/SecurityQuestions/1`, + body: { + question: 'Your own first name?' + }, + headers: { + 'Authorization': 'Bearer ', + 'Content-Type': 'application/json' + }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-users-123.test.ts b/.brightsec/tests/put-api-users-123.test.ts new file mode 100644 index 00000000..f5b6e704 --- /dev/null +++ b/.brightsec/tests/put-api-users-123.test.ts @@ -0,0 +1,46 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /api/users/123', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'xss', 'sqli', 'file_upload', 'secret_tokens'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/api/Users/123`, + body: { + username: 'new_username', + email: 'new_email@example.com', + password: 'new_password', + role: 'customer', + deluxeToken: '', + lastLoginIp: '192.168.1.1', + profileImage: '/assets/public/images/uploads/default.svg', + totpSecret: '', + isActive: true + }, + headers: { 'Content-Type': 'application/json', 'X-Recruiting': '' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/put-rest-basket-1-coupon-summer21.test.ts b/.brightsec/tests/put-rest-basket-1-coupon-summer21.test.ts new file mode 100644 index 00000000..32f51322 --- /dev/null +++ b/.brightsec/tests/put-rest-basket-1-coupon-summer21.test.ts @@ -0,0 +1,35 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /rest/basket/1/coupon/SUMMER21', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'sqli', 'xss', 'business_constraint_bypass'], + attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/rest/basket/1/coupon/SUMMER21`, + headers: { 'X-Recruiting': 'undefined' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/put-rest-continue-code-apply-continuecode.test.ts b/.brightsec/tests/put-rest-continue-code-apply-continuecode.test.ts new file mode 100644 index 00000000..fac04b88 --- /dev/null +++ b/.brightsec/tests/put-rest-continue-code-apply-continuecode.test.ts @@ -0,0 +1,38 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /rest/continue-code/apply/:continueCode', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'id_enumeration', 'xss', 'sqli', 'nosql', 'osi', 'xxe'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/rest/continue-code/apply/yXjv6Z5jWJnzD6a3YvmwPRXK7roAyzHDde2Og19yEN84plqxkMBbLVQrDeoY`, + headers: { 'X-Recruiting': 'We are hiring!' }, + body: { + continueCode: 'yXjv6Z5jWJnzD6a3YvmwPRXK7roAyzHDde2Og19yEN84plqxkMBbLVQrDeoY' + }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/put-rest-continue-code-findit-apply-examplecontinuecode123.test.ts b/.brightsec/tests/put-rest-continue-code-findit-apply-examplecontinuecode123.test.ts new file mode 100644 index 00000000..1230b7d4 --- /dev/null +++ b/.brightsec/tests/put-rest-continue-code-findit-apply-examplecontinuecode123.test.ts @@ -0,0 +1,38 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /rest/continue-code-findIt/apply/exampleContinueCode123', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'http_method_fuzzing', 'sqli', 'xss'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/rest/continue-code-findIt/apply/exampleContinueCode123`, + body: { + continueCode: 'exampleContinueCode123' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/put-rest-continue-code-fixit-apply-example-continue-code-123.test.ts b/.brightsec/tests/put-rest-continue-code-fixit-apply-example-continue-code-123.test.ts new file mode 100644 index 00000000..54ea7d88 --- /dev/null +++ b/.brightsec/tests/put-rest-continue-code-fixit-apply-example-continue-code-123.test.ts @@ -0,0 +1,38 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /rest/continue-code-fixIt/apply/exampleContinueCode123', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['csrf', 'bopla', 'sqli', 'xss', 'osi'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/rest/continue-code-fixIt/apply/exampleContinueCode123`, + body: { + continueCode: 'exampleContinueCode123' + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/put-rest-order-history-1-delivery-status.test.ts b/.brightsec/tests/put-rest-order-history-1-delivery-status.test.ts new file mode 100644 index 00000000..58783bc3 --- /dev/null +++ b/.brightsec/tests/put-rest-order-history-1-delivery-status.test.ts @@ -0,0 +1,36 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /rest/order-history/1/delivery-status', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'id_enumeration', 'jwt', 'xss'], + attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/rest/order-history/1/delivery-status`, + body: { delivered: false }, + headers: { 'Authorization': 'Bearer ', 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); diff --git a/.brightsec/tests/put-rest-wallet-balance.test.ts b/.brightsec/tests/put-rest-wallet-balance.test.ts new file mode 100644 index 00000000..dda947b8 --- /dev/null +++ b/.brightsec/tests/put-rest-wallet-balance.test.ts @@ -0,0 +1,40 @@ +import { test, before, after } from 'node:test'; +import { SecRunner } from '@sectester/runner'; +import { AttackParamLocation, HttpMethod } from '@sectester/scan'; + +const timeout = 40 * 60 * 1000; +const baseUrl = process.env.BRIGHT_TARGET_URL!; + +let runner!: SecRunner; + +before(async () => { + runner = new SecRunner({ + hostname: process.env.BRIGHT_HOSTNAME!, + projectId: process.env.BRIGHT_PROJECT_ID! + }); + + await runner.init(); +}); + +after(() => runner.clear()); + +test('PUT /rest/wallet/balance', { signal: AbortSignal.timeout(timeout) }, async () => { + await runner + .createScan({ + tests: ['bopla', 'csrf', 'sqli', 'id_enumeration', 'xss'], + attackParamLocations: [AttackParamLocation.BODY] + }) + .setFailFast(false) + .timeout(timeout) + .run({ + method: HttpMethod.PUT, + url: `${baseUrl}/rest/wallet/balance`, + body: { + UserId: 1, + paymentId: 123, + balance: 100 + }, + headers: { 'Content-Type': 'application/json' }, + auth: process.env.BRIGHT_AUTH_ID + }); +}); From e84b85cd7223f367d96c5ea2b27f4d5c589bd0dd Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 11:37:52 +0400 Subject: [PATCH 04/13] ci: add CI workflow to run e2e security tests --- .github/workflows/bright.yml | 66 ++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/bright.yml diff --git a/.github/workflows/bright.yml b/.github/workflows/bright.yml new file mode 100644 index 00000000..6043b348 --- /dev/null +++ b/.github/workflows/bright.yml @@ -0,0 +1,66 @@ +name: Bright + +on: + pull_request: + branches: + - '**' + +permissions: + checks: write + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Node.js 22.x + uses: actions/setup-node@v4 + with: + node-version: 22.x + + - name: Install application dependencies + run: | + npm install + + - name: Build Docker image and start application + run: | + docker build -t juice-shop . + docker run -d -p 3000:3000 --name juice-shop-container juice-shop + + - name: Wait for application to be ready + run: | + for i in {1..30}; do + nc -zv 127.0.0.1 3000 && echo "Application is ready" && exit 0 + echo "Waiting for application..." + sleep 5 + done + echo "Application did not start in time" && exit 1 + + - name: Set up Node.js latest + uses: actions/setup-node@v4 + with: + node-version: '>=22' + + - name: Install SecTesterJS dependencies + run: | + npm i --save=false --prefix .brightsec @sectester/core @sectester/repeater @sectester/scan @sectester/runner @sectester/reporter + + - name: Run security tests + env: + BRIGHT_HOSTNAME: ${{ vars.BRIGHT_HOSTNAME }} + BRIGHT_PROJECT_ID: ${{ vars.BRIGHT_PROJECT_ID }} + BRIGHT_AUTH_ID: ${{ vars.BRIGHT_AUTH_ID }} + BRIGHT_TOKEN: ${{ secrets.BRIGHT_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRIGHT_TARGET_URL: http://127.0.0.1:3000 + run: | + node --experimental-transform-types --experimental-strip-types --experimental-detect-module --disable-warning=MODULE_TYPELESS_PACKAGE_JSON --disable-warning=ExperimentalWarning --test-force-exit --test-concurrency=4 --test .brightsec/tests/*.test.ts + + - name: Stop and remove Docker container + if: always() + run: | + docker stop juice-shop-container + docker rm juice-shop-container From 89949e51733240c1d25e34797b42784dc50183c8 Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 15:04:25 +0400 Subject: [PATCH 05/13] test: remove completed test files that are no longer relevant skip-checks:true --- .../tests/delete-api-addresses-1.test.ts | 35 ------------- .../tests/delete-api-addresss-1.test.ts | 35 ------------- .../tests/delete-api-basket-items-1.test.ts | 35 ------------- .brightsec/tests/delete-api-cards-123.test.ts | 35 ------------- .../tests/delete-api-challenges-1.test.ts | 35 ------------- .../tests/delete-api-complaints-1.test.ts | 38 -------------- .../delete-api-privacy-requests-1.test.ts | 35 ------------- .../tests/delete-api-products-1.test.ts | 35 ------------- .../tests/delete-api-quantitys-1.test.ts | 35 ------------- .../tests/delete-api-recycles-1.test.ts | 34 ------------- .../delete-api-security-answers-1.test.ts | 35 ------------- .../delete-api-security-questions-1.test.ts | 35 ------------- .brightsec/tests/delete-api-users-123.test.ts | 35 ------------- .brightsec/tests/get-api-addresses-1.test.ts | 35 ------------- .brightsec/tests/get-api-addresss-1.test.ts | 34 ------------- .brightsec/tests/get-api-addresss.test.ts | 35 ------------- .brightsec/tests/get-api-basket-items.test.ts | 35 ------------- .brightsec/tests/get-api-cards-1.test.ts | 35 ------------- .brightsec/tests/get-api-cards.test.ts | 35 ------------- .brightsec/tests/get-api-challenges-1.test.ts | 35 ------------- .brightsec/tests/get-api-challenges.test.ts | 34 ------------- .brightsec/tests/get-api-complaints-1.test.ts | 35 ------------- .brightsec/tests/get-api-complaints.test.ts | 35 ------------- .brightsec/tests/get-api-deliverys-1.test.ts | 35 ------------- .brightsec/tests/get-api-deliverys.test.ts | 35 ------------- .brightsec/tests/get-api-docs.test.ts | 35 ------------- .brightsec/tests/get-api-feedbacks-1.test.ts | 35 ------------- .brightsec/tests/get-api-feedbacks.test.ts | 34 ------------- .../tests/get-api-privacy-requests-1.test.ts | 35 ------------- .../tests/get-api-privacy-requests.test.ts | 35 ------------- .brightsec/tests/get-api-products-1.test.ts | 34 ------------- .brightsec/tests/get-api-products.test.ts | 34 ------------- .brightsec/tests/get-api-quantitys-1.test.ts | 35 ------------- .brightsec/tests/get-api-quantitys.test.ts | 34 ------------- .brightsec/tests/get-api-recycles-1.test.ts | 34 ------------- .../tests/get-api-security-answers-1.test.ts | 34 ------------- .../tests/get-api-security-answers.test.ts | 34 ------------- .../tests/get-api-security-questions.test.ts | 35 ------------- .brightsec/tests/get-api-users.test.ts | 35 ------------- .brightsec/tests/get-assets-i18n.test.ts | 35 ------------- .../get-assets-public-images-padding.test.ts | 34 ------------- .../get-assets-public-images-products.test.ts | 34 ------------- .../get-assets-public-images-uploads.test.ts | 34 ------------- .brightsec/tests/get-dataerasure.test.ts | 35 ------------- .../get-encryptionkeys-samplefile.test.ts | 34 ------------- .../get-ftp-quarantine-samplefile-txt.test.ts | 35 ------------- .../tests/get-ftp-sample-file-md.test.ts | 34 ------------- .brightsec/tests/get-ftp-sample-md.test.ts | 35 ------------- .brightsec/tests/get-metrics.test.ts | 34 ------------- .brightsec/tests/get-profile.test.ts | 37 -------------- .brightsec/tests/get-promotion.test.ts | 35 ------------- .brightsec/tests/get-redirect.test.ts | 34 ------------- .brightsec/tests/get-rest-2fa-status.test.ts | 35 ------------- ...st-admin-application-configuration.test.ts | 35 ------------- ...get-rest-admin-application-version.test.ts | 35 ------------- .../tests/get-rest-basket-1-order.test.ts | 35 ------------- .brightsec/tests/get-rest-basket-1.test.ts | 35 ------------- .brightsec/tests/get-rest-captcha.test.ts | 34 ------------- .../get-rest-continue-code-findit.test.ts | 35 ------------- .../get-rest-continue-code-fixit.test.ts | 35 ------------- .../tests/get-rest-continue-code.test.ts | 34 ------------- .../tests/get-rest-country-mapping.test.ts | 35 ------------- .../tests/get-rest-deluxe-membership.test.ts | 34 ------------- .../tests/get-rest-image-captcha.test.ts | 35 ------------- .brightsec/tests/get-rest-languages.test.ts | 34 ------------- .brightsec/tests/get-rest-memories.test.ts | 34 ------------- .../get-rest-order-history-orders.test.ts | 35 ------------- .../tests/get-rest-order-history.test.ts | 35 ------------- .../tests/get-rest-products-1-reviews.test.ts | 34 ------------- .../get-rest-repeat-notification.test.ts | 35 ------------- .../tests/get-rest-save-login-ip.test.ts | 35 ------------- .../tests/get-rest-track-order-12345.test.ts | 34 ------------- ...t-rest-user-authentication-details.test.ts | 35 ------------- .../get-rest-user-change-password.test.ts | 35 ------------- .../get-rest-user-security-question.test.ts | 35 ------------- .brightsec/tests/get-rest-user-whoami.test.ts | 35 ------------- .../tests/get-rest-wallet-balance.test.ts | 34 ------------- .../get-rest-web3-nft-mint-listen.test.ts | 34 ------------- .../tests/get-rest-web3-nft-unlocked.test.ts | 34 ------------- .brightsec/tests/get-security-txt.test.ts | 35 ------------- .../get-snippets-fixes-sample-key.test.ts | 34 ------------- .../get-snippets-sample-challenge.test.ts | 34 ------------- .../get-solve-challenges-server-side.test.ts | 34 ------------- .../tests/get-support-logs-sample-log.test.ts | 34 ------------- ...n-easter-egg-within-the-easter-egg.test.ts | 35 ------------- ...-be-unlocked-by-sending-1btc-to-us.test.ts | 35 ------------- .../get-video-range-bytes-0-1023.test.ts | 41 ---------------- ...easonably-necessary-responsibility.test.ts | 34 ------------- .../tests/get-well-known-samplefile.test.ts | 35 ------------- .../tests/get-well-known-security-txt.test.ts | 35 ------------- .brightsec/tests/get-well-known.test.ts | 35 ------------- .../patch-rest-products-id-reviews.test.ts | 39 --------------- .../tests/patch-rest-products-reviews.test.ts | 39 --------------- .brightsec/tests/post-api-addresses.test.ts | 45 ----------------- .../tests/post-api-basket-items.test.ts | 36 -------------- .brightsec/tests/post-api-cards.test.ts | 43 ---------------- .brightsec/tests/post-api-challenges.test.ts | 49 ------------------- .brightsec/tests/post-api-complaints.test.ts | 40 --------------- .brightsec/tests/post-api-feedbacks.test.ts | 40 --------------- .../tests/post-api-privacy-requests.test.ts | 40 --------------- .brightsec/tests/post-api-products.test.ts | 42 ---------------- .brightsec/tests/post-api-quantitys.test.ts | 39 --------------- .brightsec/tests/post-api-recycles.test.ts | 43 ---------------- .../tests/post-api-security-questions.test.ts | 39 --------------- .brightsec/tests/post-api-users.test.ts | 40 --------------- .brightsec/tests/post-b2b-v2-orders.test.ts | 42 ---------------- .brightsec/tests/post-dataerasure.test.ts | 40 --------------- .brightsec/tests/post-file-upload.test.ts | 36 -------------- .../tests/post-profile-image-file.test.ts | 36 -------------- .../tests/post-profile-image-url.test.ts | 38 -------------- .brightsec/tests/post-profile.test.ts | 38 -------------- .../tests/post-rest-2fa-disable.test.ts | 38 -------------- .brightsec/tests/post-rest-2fa-setup.test.ts | 43 ---------------- .brightsec/tests/post-rest-2fa-verify.test.ts | 39 --------------- .../tests/post-rest-basket-1-checkout.test.ts | 43 ---------------- .../tests/post-rest-deluxe-membership.test.ts | 39 --------------- .brightsec/tests/post-rest-memories.test.ts | 35 ------------- .../post-rest-products-123-reviews.test.ts | 42 ---------------- .../tests/post-rest-user-data-export.test.ts | 38 -------------- .brightsec/tests/post-rest-user-login.test.ts | 39 --------------- .../post-rest-user-reset-password.test.ts | 41 ---------------- .../tests/post-rest-web3-submit-key.test.ts | 38 -------------- ...t-rest-web3-wallet-exploit-address.test.ts | 38 -------------- .../post-rest-web3-wallet-nft-verify.test.ts | 38 -------------- .brightsec/tests/post-snippets-fixes.test.ts | 39 --------------- .../tests/post-snippets-verdict.test.ts | 39 --------------- .brightsec/tests/put-api-addresses-1.test.ts | 44 ----------------- .brightsec/tests/put-api-addresss-1.test.ts | 44 ----------------- .../tests/put-api-basket-items-1.test.ts | 40 --------------- .brightsec/tests/put-api-cards-1.test.ts | 42 ---------------- .brightsec/tests/put-api-challenges-1.test.ts | 49 ------------------- .brightsec/tests/put-api-feedbacks-1.test.ts | 43 ---------------- .../tests/put-api-privacy-requests-1.test.ts | 42 ---------------- .brightsec/tests/put-api-quantitys-1.test.ts | 40 --------------- .brightsec/tests/put-api-recycles-1.test.ts | 42 ---------------- .../tests/put-api-security-answers-1.test.ts | 38 -------------- .../put-api-security-questions-1.test.ts | 41 ---------------- .brightsec/tests/put-api-users-123.test.ts | 46 ----------------- .../put-rest-basket-1-coupon-summer21.test.ts | 35 ------------- ...t-continue-code-apply-continuecode.test.ts | 38 -------------- ...indit-apply-examplecontinuecode123.test.ts | 38 -------------- ...it-apply-example-continue-code-123.test.ts | 38 -------------- ...st-order-history-1-delivery-status.test.ts | 36 -------------- .../tests/put-rest-wallet-balance.test.ts | 40 --------------- 144 files changed, 5293 deletions(-) delete mode 100644 .brightsec/tests/delete-api-addresses-1.test.ts delete mode 100644 .brightsec/tests/delete-api-addresss-1.test.ts delete mode 100644 .brightsec/tests/delete-api-basket-items-1.test.ts delete mode 100644 .brightsec/tests/delete-api-cards-123.test.ts delete mode 100644 .brightsec/tests/delete-api-challenges-1.test.ts delete mode 100644 .brightsec/tests/delete-api-complaints-1.test.ts delete mode 100644 .brightsec/tests/delete-api-privacy-requests-1.test.ts delete mode 100644 .brightsec/tests/delete-api-products-1.test.ts delete mode 100644 .brightsec/tests/delete-api-quantitys-1.test.ts delete mode 100644 .brightsec/tests/delete-api-recycles-1.test.ts delete mode 100644 .brightsec/tests/delete-api-security-answers-1.test.ts delete mode 100644 .brightsec/tests/delete-api-security-questions-1.test.ts delete mode 100644 .brightsec/tests/delete-api-users-123.test.ts delete mode 100644 .brightsec/tests/get-api-addresses-1.test.ts delete mode 100644 .brightsec/tests/get-api-addresss-1.test.ts delete mode 100644 .brightsec/tests/get-api-addresss.test.ts delete mode 100644 .brightsec/tests/get-api-basket-items.test.ts delete mode 100644 .brightsec/tests/get-api-cards-1.test.ts delete mode 100644 .brightsec/tests/get-api-cards.test.ts delete mode 100644 .brightsec/tests/get-api-challenges-1.test.ts delete mode 100644 .brightsec/tests/get-api-challenges.test.ts delete mode 100644 .brightsec/tests/get-api-complaints-1.test.ts delete mode 100644 .brightsec/tests/get-api-complaints.test.ts delete mode 100644 .brightsec/tests/get-api-deliverys-1.test.ts delete mode 100644 .brightsec/tests/get-api-deliverys.test.ts delete mode 100644 .brightsec/tests/get-api-docs.test.ts delete mode 100644 .brightsec/tests/get-api-feedbacks-1.test.ts delete mode 100644 .brightsec/tests/get-api-feedbacks.test.ts delete mode 100644 .brightsec/tests/get-api-privacy-requests-1.test.ts delete mode 100644 .brightsec/tests/get-api-privacy-requests.test.ts delete mode 100644 .brightsec/tests/get-api-products-1.test.ts delete mode 100644 .brightsec/tests/get-api-products.test.ts delete mode 100644 .brightsec/tests/get-api-quantitys-1.test.ts delete mode 100644 .brightsec/tests/get-api-quantitys.test.ts delete mode 100644 .brightsec/tests/get-api-recycles-1.test.ts delete mode 100644 .brightsec/tests/get-api-security-answers-1.test.ts delete mode 100644 .brightsec/tests/get-api-security-answers.test.ts delete mode 100644 .brightsec/tests/get-api-security-questions.test.ts delete mode 100644 .brightsec/tests/get-api-users.test.ts delete mode 100644 .brightsec/tests/get-assets-i18n.test.ts delete mode 100644 .brightsec/tests/get-assets-public-images-padding.test.ts delete mode 100644 .brightsec/tests/get-assets-public-images-products.test.ts delete mode 100644 .brightsec/tests/get-assets-public-images-uploads.test.ts delete mode 100644 .brightsec/tests/get-dataerasure.test.ts delete mode 100644 .brightsec/tests/get-encryptionkeys-samplefile.test.ts delete mode 100644 .brightsec/tests/get-ftp-quarantine-samplefile-txt.test.ts delete mode 100644 .brightsec/tests/get-ftp-sample-file-md.test.ts delete mode 100644 .brightsec/tests/get-ftp-sample-md.test.ts delete mode 100644 .brightsec/tests/get-metrics.test.ts delete mode 100644 .brightsec/tests/get-profile.test.ts delete mode 100644 .brightsec/tests/get-promotion.test.ts delete mode 100644 .brightsec/tests/get-redirect.test.ts delete mode 100644 .brightsec/tests/get-rest-2fa-status.test.ts delete mode 100644 .brightsec/tests/get-rest-admin-application-configuration.test.ts delete mode 100644 .brightsec/tests/get-rest-admin-application-version.test.ts delete mode 100644 .brightsec/tests/get-rest-basket-1-order.test.ts delete mode 100644 .brightsec/tests/get-rest-basket-1.test.ts delete mode 100644 .brightsec/tests/get-rest-captcha.test.ts delete mode 100644 .brightsec/tests/get-rest-continue-code-findit.test.ts delete mode 100644 .brightsec/tests/get-rest-continue-code-fixit.test.ts delete mode 100644 .brightsec/tests/get-rest-continue-code.test.ts delete mode 100644 .brightsec/tests/get-rest-country-mapping.test.ts delete mode 100644 .brightsec/tests/get-rest-deluxe-membership.test.ts delete mode 100644 .brightsec/tests/get-rest-image-captcha.test.ts delete mode 100644 .brightsec/tests/get-rest-languages.test.ts delete mode 100644 .brightsec/tests/get-rest-memories.test.ts delete mode 100644 .brightsec/tests/get-rest-order-history-orders.test.ts delete mode 100644 .brightsec/tests/get-rest-order-history.test.ts delete mode 100644 .brightsec/tests/get-rest-products-1-reviews.test.ts delete mode 100644 .brightsec/tests/get-rest-repeat-notification.test.ts delete mode 100644 .brightsec/tests/get-rest-save-login-ip.test.ts delete mode 100644 .brightsec/tests/get-rest-track-order-12345.test.ts delete mode 100644 .brightsec/tests/get-rest-user-authentication-details.test.ts delete mode 100644 .brightsec/tests/get-rest-user-change-password.test.ts delete mode 100644 .brightsec/tests/get-rest-user-security-question.test.ts delete mode 100644 .brightsec/tests/get-rest-user-whoami.test.ts delete mode 100644 .brightsec/tests/get-rest-wallet-balance.test.ts delete mode 100644 .brightsec/tests/get-rest-web3-nft-mint-listen.test.ts delete mode 100644 .brightsec/tests/get-rest-web3-nft-unlocked.test.ts delete mode 100644 .brightsec/tests/get-security-txt.test.ts delete mode 100644 .brightsec/tests/get-snippets-fixes-sample-key.test.ts delete mode 100644 .brightsec/tests/get-snippets-sample-challenge.test.ts delete mode 100644 .brightsec/tests/get-solve-challenges-server-side.test.ts delete mode 100644 .brightsec/tests/get-support-logs-sample-log.test.ts delete mode 100644 .brightsec/tests/get-the-devs-are-so-funny-they-hid-an-easter-egg-within-the-easter-egg.test.ts delete mode 100644 .brightsec/tests/get-this-page-is-hidden-behind-an-incredibly-high-paywall-that-could-only-be-unlocked-by-sending-1btc-to-us.test.ts delete mode 100644 .brightsec/tests/get-video-range-bytes-0-1023.test.ts delete mode 100644 .brightsec/tests/get-we-may-also-instruct-you-to-refuse-all-reasonably-necessary-responsibility.test.ts delete mode 100644 .brightsec/tests/get-well-known-samplefile.test.ts delete mode 100644 .brightsec/tests/get-well-known-security-txt.test.ts delete mode 100644 .brightsec/tests/get-well-known.test.ts delete mode 100644 .brightsec/tests/patch-rest-products-id-reviews.test.ts delete mode 100644 .brightsec/tests/patch-rest-products-reviews.test.ts delete mode 100644 .brightsec/tests/post-api-addresses.test.ts delete mode 100644 .brightsec/tests/post-api-basket-items.test.ts delete mode 100644 .brightsec/tests/post-api-cards.test.ts delete mode 100644 .brightsec/tests/post-api-challenges.test.ts delete mode 100644 .brightsec/tests/post-api-complaints.test.ts delete mode 100644 .brightsec/tests/post-api-feedbacks.test.ts delete mode 100644 .brightsec/tests/post-api-privacy-requests.test.ts delete mode 100644 .brightsec/tests/post-api-products.test.ts delete mode 100644 .brightsec/tests/post-api-quantitys.test.ts delete mode 100644 .brightsec/tests/post-api-recycles.test.ts delete mode 100644 .brightsec/tests/post-api-security-questions.test.ts delete mode 100644 .brightsec/tests/post-api-users.test.ts delete mode 100644 .brightsec/tests/post-b2b-v2-orders.test.ts delete mode 100644 .brightsec/tests/post-dataerasure.test.ts delete mode 100644 .brightsec/tests/post-file-upload.test.ts delete mode 100644 .brightsec/tests/post-profile-image-file.test.ts delete mode 100644 .brightsec/tests/post-profile-image-url.test.ts delete mode 100644 .brightsec/tests/post-profile.test.ts delete mode 100644 .brightsec/tests/post-rest-2fa-disable.test.ts delete mode 100644 .brightsec/tests/post-rest-2fa-setup.test.ts delete mode 100644 .brightsec/tests/post-rest-2fa-verify.test.ts delete mode 100644 .brightsec/tests/post-rest-basket-1-checkout.test.ts delete mode 100644 .brightsec/tests/post-rest-deluxe-membership.test.ts delete mode 100644 .brightsec/tests/post-rest-memories.test.ts delete mode 100644 .brightsec/tests/post-rest-products-123-reviews.test.ts delete mode 100644 .brightsec/tests/post-rest-user-data-export.test.ts delete mode 100644 .brightsec/tests/post-rest-user-login.test.ts delete mode 100644 .brightsec/tests/post-rest-user-reset-password.test.ts delete mode 100644 .brightsec/tests/post-rest-web3-submit-key.test.ts delete mode 100644 .brightsec/tests/post-rest-web3-wallet-exploit-address.test.ts delete mode 100644 .brightsec/tests/post-rest-web3-wallet-nft-verify.test.ts delete mode 100644 .brightsec/tests/post-snippets-fixes.test.ts delete mode 100644 .brightsec/tests/post-snippets-verdict.test.ts delete mode 100644 .brightsec/tests/put-api-addresses-1.test.ts delete mode 100644 .brightsec/tests/put-api-addresss-1.test.ts delete mode 100644 .brightsec/tests/put-api-basket-items-1.test.ts delete mode 100644 .brightsec/tests/put-api-cards-1.test.ts delete mode 100644 .brightsec/tests/put-api-challenges-1.test.ts delete mode 100644 .brightsec/tests/put-api-feedbacks-1.test.ts delete mode 100644 .brightsec/tests/put-api-privacy-requests-1.test.ts delete mode 100644 .brightsec/tests/put-api-quantitys-1.test.ts delete mode 100644 .brightsec/tests/put-api-recycles-1.test.ts delete mode 100644 .brightsec/tests/put-api-security-answers-1.test.ts delete mode 100644 .brightsec/tests/put-api-security-questions-1.test.ts delete mode 100644 .brightsec/tests/put-api-users-123.test.ts delete mode 100644 .brightsec/tests/put-rest-basket-1-coupon-summer21.test.ts delete mode 100644 .brightsec/tests/put-rest-continue-code-apply-continuecode.test.ts delete mode 100644 .brightsec/tests/put-rest-continue-code-findit-apply-examplecontinuecode123.test.ts delete mode 100644 .brightsec/tests/put-rest-continue-code-fixit-apply-example-continue-code-123.test.ts delete mode 100644 .brightsec/tests/put-rest-order-history-1-delivery-status.test.ts delete mode 100644 .brightsec/tests/put-rest-wallet-balance.test.ts diff --git a/.brightsec/tests/delete-api-addresses-1.test.ts b/.brightsec/tests/delete-api-addresses-1.test.ts deleted file mode 100644 index 71da9a01..00000000 --- a/.brightsec/tests/delete-api-addresses-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/addresses/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'id_enumeration', 'sqli', 'osi'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/Addresses/1`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/delete-api-addresss-1.test.ts b/.brightsec/tests/delete-api-addresss-1.test.ts deleted file mode 100644 index 7198a83a..00000000 --- a/.brightsec/tests/delete-api-addresss-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/addresss/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'id_enumeration', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/Addresss/1`, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/delete-api-basket-items-1.test.ts b/.brightsec/tests/delete-api-basket-items-1.test.ts deleted file mode 100644 index c352a538..00000000 --- a/.brightsec/tests/delete-api-basket-items-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/basket-items/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'id_enumeration', 'jwt', 'sqli', 'csrf'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/BasketItems/1`, - headers: { 'Authorization': 'Bearer ' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/delete-api-cards-123.test.ts b/.brightsec/tests/delete-api-cards-123.test.ts deleted file mode 100644 index 40db6ec0..00000000 --- a/.brightsec/tests/delete-api-cards-123.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/cards/123', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'id_enumeration', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/Cards/123`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/delete-api-challenges-1.test.ts b/.brightsec/tests/delete-api-challenges-1.test.ts deleted file mode 100644 index 7ce631df..00000000 --- a/.brightsec/tests/delete-api-challenges-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/challenges/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'id_enumeration', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/Challenges/1`, - headers: { 'X-Recruiting': 'https://owasp-juice.shop/security.txt' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/delete-api-complaints-1.test.ts b/.brightsec/tests/delete-api-complaints-1.test.ts deleted file mode 100644 index 46e45f42..00000000 --- a/.brightsec/tests/delete-api-complaints-1.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/complaints/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'id_enumeration', 'jwt', 'sqli'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/Complaints/1`, - headers: { - 'Authorization': 'Bearer ', - 'Content-Type': 'application/json' - }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/delete-api-privacy-requests-1.test.ts b/.brightsec/tests/delete-api-privacy-requests-1.test.ts deleted file mode 100644 index b1f41a77..00000000 --- a/.brightsec/tests/delete-api-privacy-requests-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/PrivacyRequests/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'id_enumeration', 'sqli'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/PrivacyRequests/1`, - headers: { 'Authorization': 'Bearer ' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/delete-api-products-1.test.ts b/.brightsec/tests/delete-api-products-1.test.ts deleted file mode 100644 index 55b0a3ae..00000000 --- a/.brightsec/tests/delete-api-products-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/products/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'id_enumeration', 'bopla', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/Products/1`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/delete-api-quantitys-1.test.ts b/.brightsec/tests/delete-api-quantitys-1.test.ts deleted file mode 100644 index 909a80cd..00000000 --- a/.brightsec/tests/delete-api-quantitys-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/quantitys/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'id_enumeration', 'http_method_fuzzing', 'sqli'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/Quantitys/1`, - headers: { 'X-Recruiting': 'true' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/delete-api-recycles-1.test.ts b/.brightsec/tests/delete-api-recycles-1.test.ts deleted file mode 100644 index 4bf5ea5b..00000000 --- a/.brightsec/tests/delete-api-recycles-1.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/recycles/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'id_enumeration', 'bopla', 'sqli'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/Recycles/1`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/delete-api-security-answers-1.test.ts b/.brightsec/tests/delete-api-security-answers-1.test.ts deleted file mode 100644 index 0594129c..00000000 --- a/.brightsec/tests/delete-api-security-answers-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/security-answers/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'id_enumeration', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/SecurityAnswers/1`, - headers: { 'X-Recruiting': 'YourCompany' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/delete-api-security-questions-1.test.ts b/.brightsec/tests/delete-api-security-questions-1.test.ts deleted file mode 100644 index 53f6c080..00000000 --- a/.brightsec/tests/delete-api-security-questions-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/security-questions/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'id_enumeration', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/SecurityQuestions/1`, - headers: { 'X-Recruiting': 'We are hiring! Check out our careers page.' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/delete-api-users-123.test.ts b/.brightsec/tests/delete-api-users-123.test.ts deleted file mode 100644 index 0036de16..00000000 --- a/.brightsec/tests/delete-api-users-123.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('DELETE /api/users/123', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'id_enumeration', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.DELETE, - url: `${baseUrl}/api/Users/123`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-addresses-1.test.ts b/.brightsec/tests/get-api-addresses-1.test.ts deleted file mode 100644 index 3b31232d..00000000 --- a/.brightsec/tests/get-api-addresses-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/addresses/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['id_enumeration', 'bopla', 'sqli', 'xss', 'csrf'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Addresses/1`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-addresss-1.test.ts b/.brightsec/tests/get-api-addresss-1.test.ts deleted file mode 100644 index 19007b68..00000000 --- a/.brightsec/tests/get-api-addresss-1.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/addresss/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'id_enumeration', 'sqli', 'csrf'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Addresss/1`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-addresss.test.ts b/.brightsec/tests/get-api-addresss.test.ts deleted file mode 100644 index ca7b4947..00000000 --- a/.brightsec/tests/get-api-addresss.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/addresss', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'id_enumeration', 'sqli'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Addresss`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-basket-items.test.ts b/.brightsec/tests/get-api-basket-items.test.ts deleted file mode 100644 index 5dfec17f..00000000 --- a/.brightsec/tests/get-api-basket-items.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/basket-items', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'business_constraint_bypass', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/BasketItems`, - headers: { 'X-Recruiting': 'We are hiring! Visit our careers page for more information.' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/get-api-cards-1.test.ts b/.brightsec/tests/get-api-cards-1.test.ts deleted file mode 100644 index ff907aa2..00000000 --- a/.brightsec/tests/get-api-cards-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/cards/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['id_enumeration', 'bopla', 'csrf', 'sqli', 'xss', 'full_path_disclosure'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/cards/1`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/get-api-cards.test.ts b/.brightsec/tests/get-api-cards.test.ts deleted file mode 100644 index 31c9e884..00000000 --- a/.brightsec/tests/get-api-cards.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/cards', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'id_enumeration', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Cards`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-challenges-1.test.ts b/.brightsec/tests/get-api-challenges-1.test.ts deleted file mode 100644 index 34ba8959..00000000 --- a/.brightsec/tests/get-api-challenges-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/challenges/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'id_enumeration', 'sqli', 'xss', 'csrf'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Challenges/1`, - headers: { 'X-Recruiting': 'We are hiring! Visit our careers page for more information.' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-challenges.test.ts b/.brightsec/tests/get-api-challenges.test.ts deleted file mode 100644 index 9674a225..00000000 --- a/.brightsec/tests/get-api-challenges.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/challenges', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'business_constraint_bypass', 'xss', 'sqli'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Challenges`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-complaints-1.test.ts b/.brightsec/tests/get-api-complaints-1.test.ts deleted file mode 100644 index 2e7023c0..00000000 --- a/.brightsec/tests/get-api-complaints-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/complaints/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['id_enumeration', 'bopla', 'csrf', 'xss', 'sqli', 'full_path_disclosure'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Complaints/1`, - headers: { 'X-Recruiting': 'Your Company is Hiring!' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/get-api-complaints.test.ts b/.brightsec/tests/get-api-complaints.test.ts deleted file mode 100644 index 39b7ff25..00000000 --- a/.brightsec/tests/get-api-complaints.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/complaints', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'id_enumeration', 'bopla', 'improper_asset_management'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Complaints`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-deliverys-1.test.ts b/.brightsec/tests/get-api-deliverys-1.test.ts deleted file mode 100644 index efbf5550..00000000 --- a/.brightsec/tests/get-api-deliverys-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/deliverys/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['id_enumeration', 'bopla', 'sqli', 'xss', 'csrf'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Deliverys/1`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-deliverys.test.ts b/.brightsec/tests/get-api-deliverys.test.ts deleted file mode 100644 index bd54d905..00000000 --- a/.brightsec/tests/get-api-deliverys.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/deliverys', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'id_enumeration', 'improper_asset_management', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.HEADER, AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Deliverys`, - headers: { 'X-Recruiting': 'undefined' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/get-api-docs.test.ts b/.brightsec/tests/get-api-docs.test.ts deleted file mode 100644 index 8ea84c16..00000000 --- a/.brightsec/tests/get-api-docs.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api-docs', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['xss', 'csrf', 'improper_asset_management', 'full_path_disclosure'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api-docs`, - headers: { 'X-Recruiting': 'Your Company is Hiring!' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-feedbacks-1.test.ts b/.brightsec/tests/get-api-feedbacks-1.test.ts deleted file mode 100644 index e4139118..00000000 --- a/.brightsec/tests/get-api-feedbacks-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/Feedbacks/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['id_enumeration', 'bopla', 'xss', 'sqli', 'csrf'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Feedbacks/1`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-feedbacks.test.ts b/.brightsec/tests/get-api-feedbacks.test.ts deleted file mode 100644 index f0739704..00000000 --- a/.brightsec/tests/get-api-feedbacks.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/feedbacks', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'id_enumeration', 'xss', 'sqli', 'improper_asset_management'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Feedbacks`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/get-api-privacy-requests-1.test.ts b/.brightsec/tests/get-api-privacy-requests-1.test.ts deleted file mode 100644 index a143d5b3..00000000 --- a/.brightsec/tests/get-api-privacy-requests-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/privacy-requests/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['id_enumeration', 'bopla', 'csrf', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/PrivacyRequests/1`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-privacy-requests.test.ts b/.brightsec/tests/get-api-privacy-requests.test.ts deleted file mode 100644 index ad25b359..00000000 --- a/.brightsec/tests/get-api-privacy-requests.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/privacy-requests', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'id_enumeration', 'improper_asset_management', 'sqli'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/PrivacyRequests`, - headers: { 'X-Recruiting': 'config.get(\'application.securityTxt.hiring\')' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-products-1.test.ts b/.brightsec/tests/get-api-products-1.test.ts deleted file mode 100644 index bc61513d..00000000 --- a/.brightsec/tests/get-api-products-1.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/products/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['id_enumeration', 'sqli', 'xss', 'csrf', 'improper_asset_management'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Products/1`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-products.test.ts b/.brightsec/tests/get-api-products.test.ts deleted file mode 100644 index ae209d17..00000000 --- a/.brightsec/tests/get-api-products.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/products', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'business_constraint_bypass', 'sqli', 'xss', 'improper_asset_management'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Products`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-quantitys-1.test.ts b/.brightsec/tests/get-api-quantitys-1.test.ts deleted file mode 100644 index 873d284b..00000000 --- a/.brightsec/tests/get-api-quantitys-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/Quantitys/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['id_enumeration', 'bopla', 'csrf', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Quantitys/1`, - headers: { 'X-Recruiting': 'We are hiring! Check out our careers page.' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-quantitys.test.ts b/.brightsec/tests/get-api-quantitys.test.ts deleted file mode 100644 index 6e4ff709..00000000 --- a/.brightsec/tests/get-api-quantitys.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/quantitys', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'business_constraint_bypass', 'id_enumeration', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Quantitys`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-recycles-1.test.ts b/.brightsec/tests/get-api-recycles-1.test.ts deleted file mode 100644 index 7fc82bc2..00000000 --- a/.brightsec/tests/get-api-recycles-1.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/recycles/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['sqli', 'id_enumeration', 'full_path_disclosure'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Recycles/1`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-security-answers-1.test.ts b/.brightsec/tests/get-api-security-answers-1.test.ts deleted file mode 100644 index 110d6411..00000000 --- a/.brightsec/tests/get-api-security-answers-1.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/security-answers/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'id_enumeration', 'sqli', 'xss', 'csrf'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/SecurityAnswers/1`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-security-answers.test.ts b/.brightsec/tests/get-api-security-answers.test.ts deleted file mode 100644 index e0be35c0..00000000 --- a/.brightsec/tests/get-api-security-answers.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/security-answers', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'id_enumeration', 'sqli', 'xss', 'csrf'], - attackParamLocations: [AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/SecurityAnswers?email=user@example.com`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-security-questions.test.ts b/.brightsec/tests/get-api-security-questions.test.ts deleted file mode 100644 index 4101daeb..00000000 --- a/.brightsec/tests/get-api-security-questions.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/security-questions', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'id_enumeration', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/SecurityQuestions?email=user@example.com`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-api-users.test.ts b/.brightsec/tests/get-api-users.test.ts deleted file mode 100644 index 0a47755b..00000000 --- a/.brightsec/tests/get-api-users.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/users', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'id_enumeration', 'bopla', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Users`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-assets-i18n.test.ts b/.brightsec/tests/get-assets-i18n.test.ts deleted file mode 100644 index 5e675218..00000000 --- a/.brightsec/tests/get-assets-i18n.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /assets/i18n', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'xss', 'improper_asset_management', 'lfi'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/assets/i18n`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-assets-public-images-padding.test.ts b/.brightsec/tests/get-assets-public-images-padding.test.ts deleted file mode 100644 index 6a874f2d..00000000 --- a/.brightsec/tests/get-assets-public-images-padding.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /assets/public/images/padding', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'xss', 'lfi', 'improper_asset_management'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/assets/public/images/padding`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-assets-public-images-products.test.ts b/.brightsec/tests/get-assets-public-images-products.test.ts deleted file mode 100644 index 6e5c9eae..00000000 --- a/.brightsec/tests/get-assets-public-images-products.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /assets/public/images/products', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'xss', 'lfi', 'improper_asset_management', 'full_path_disclosure'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/assets/public/images/products`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-assets-public-images-uploads.test.ts b/.brightsec/tests/get-assets-public-images-uploads.test.ts deleted file mode 100644 index 7e89453a..00000000 --- a/.brightsec/tests/get-assets-public-images-uploads.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /assets/public/images/uploads', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['lfi', 'xss', 'improper_asset_management', 'full_path_disclosure', 'file_upload'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/assets/public/images/uploads`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-dataerasure.test.ts b/.brightsec/tests/get-dataerasure.test.ts deleted file mode 100644 index dcca2d88..00000000 --- a/.brightsec/tests/get-dataerasure.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /dataerasure', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'lfi', 'xss', 'id_enumeration', 'osi'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/dataerasure/`, - headers: { 'X-Recruiting': 'undefined' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-encryptionkeys-samplefile.test.ts b/.brightsec/tests/get-encryptionkeys-samplefile.test.ts deleted file mode 100644 index 8d970e68..00000000 --- a/.brightsec/tests/get-encryptionkeys-samplefile.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /encryptionkeys/samplefile', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['directoryListingChallenge', 'accessLogDisclosureChallenge', 'serveKeyFiles'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/encryptionkeys/samplefile`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-ftp-quarantine-samplefile-txt.test.ts b/.brightsec/tests/get-ftp-quarantine-samplefile-txt.test.ts deleted file mode 100644 index adcf0578..00000000 --- a/.brightsec/tests/get-ftp-quarantine-samplefile-txt.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /ftp/quarantine/samplefile.txt', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['lfi', 'ssrf', 'full_path_disclosure', 'improper_asset_management'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/ftp/quarantine/samplefile.txt`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-ftp-sample-file-md.test.ts b/.brightsec/tests/get-ftp-sample-file-md.test.ts deleted file mode 100644 index 2714b9a5..00000000 --- a/.brightsec/tests/get-ftp-sample-file-md.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /ftp/sample-file.md', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['lfi', 'full_path_disclosure', 'unvalidated_redirect', 'xss'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/ftp/sample-file.md`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-ftp-sample-md.test.ts b/.brightsec/tests/get-ftp-sample-md.test.ts deleted file mode 100644 index 262cf40e..00000000 --- a/.brightsec/tests/get-ftp-sample-md.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /ftp/sample.md', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['lfi', 'full_path_disclosure', 'directory_listing', 'ssrf'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/ftp/sample.md`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-metrics.test.ts b/.brightsec/tests/get-metrics.test.ts deleted file mode 100644 index 64c68666..00000000 --- a/.brightsec/tests/get-metrics.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /metrics', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'improper_asset_management', 'full_path_disclosure', 'open_database', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/metrics`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-profile.test.ts b/.brightsec/tests/get-profile.test.ts deleted file mode 100644 index f14f2a0a..00000000 --- a/.brightsec/tests/get-profile.test.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /profile', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'xss', 'bopla', 'full_path_disclosure', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/profile`, - headers: { - 'Content-Security-Policy': "img-src 'self' ; script-src 'self' 'unsafe-eval' https://code.getmdl.io http://ajax.googleapis.com" - }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-promotion.test.ts b/.brightsec/tests/get-promotion.test.ts deleted file mode 100644 index 15e0fbcf..00000000 --- a/.brightsec/tests/get-promotion.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /promotion', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['xss', 'csrf', 'unvalidated_redirect', 'improper_asset_management', 'full_path_disclosure'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/promotion`, - headers: { 'X-Recruiting': 'undefined' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-redirect.test.ts b/.brightsec/tests/get-redirect.test.ts deleted file mode 100644 index 63465bd2..00000000 --- a/.brightsec/tests/get-redirect.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /redirect?to=:url', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['unvalidated_redirect', 'ssrf'], - attackParamLocations: [AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/redirect?to=https://example.com`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-2fa-status.test.ts b/.brightsec/tests/get-rest-2fa-status.test.ts deleted file mode 100644 index c3b2b8d2..00000000 --- a/.brightsec/tests/get-rest-2fa-status.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/2fa/status', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'jwt', 'id_enumeration', 'improper_asset_management'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/2fa/status`, - headers: { 'Authorization': 'Bearer ' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-admin-application-configuration.test.ts b/.brightsec/tests/get-rest-admin-application-configuration.test.ts deleted file mode 100644 index 4cdde846..00000000 --- a/.brightsec/tests/get-rest-admin-application-configuration.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/admin/application-configuration', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['improper_asset_management', 'secret_tokens', 'open_database', 'full_path_disclosure'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/admin/application-configuration`, - headers: { 'X-Recruiting': 'config.get(\'application.securityTxt.hiring\')' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-admin-application-version.test.ts b/.brightsec/tests/get-rest-admin-application-version.test.ts deleted file mode 100644 index ef8e7c80..00000000 --- a/.brightsec/tests/get-rest-admin-application-version.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/admin/application-version', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['improper_asset_management', 'full_path_disclosure', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/admin/application-version`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-basket-1-order.test.ts b/.brightsec/tests/get-rest-basket-1-order.test.ts deleted file mode 100644 index b93bb81c..00000000 --- a/.brightsec/tests/get-rest-basket-1-order.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/basket/1/order', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'id_enumeration', 'bopla', 'business_constraint_bypass', 'xss', 'sqli'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/basket/1/order`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-basket-1.test.ts b/.brightsec/tests/get-rest-basket-1.test.ts deleted file mode 100644 index 56037664..00000000 --- a/.brightsec/tests/get-rest-basket-1.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/basket/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'id_enumeration', 'sqli', 'xss', 'csrf'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/basket/1`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-captcha.test.ts b/.brightsec/tests/get-rest-captcha.test.ts deleted file mode 100644 index fdeeb82c..00000000 --- a/.brightsec/tests/get-rest-captcha.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/captcha', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['osi', 'csrf', 'xss', 'sqli', 'id_enumeration'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/captcha`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-continue-code-findit.test.ts b/.brightsec/tests/get-rest-continue-code-findit.test.ts deleted file mode 100644 index f29796d3..00000000 --- a/.brightsec/tests/get-rest-continue-code-findit.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/continue-code-findIt', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['sqli', 'secret_tokens', 'full_path_disclosure'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/continue-code-findIt`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-continue-code-fixit.test.ts b/.brightsec/tests/get-rest-continue-code-fixit.test.ts deleted file mode 100644 index c8f861cc..00000000 --- a/.brightsec/tests/get-rest-continue-code-fixit.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/continue-code-fixIt', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['test/api/challengeApiSpec.ts'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/continue-code-fixIt`, - headers: { 'X-Recruiting': 'We are hiring!' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-continue-code.test.ts b/.brightsec/tests/get-rest-continue-code.test.ts deleted file mode 100644 index 04f7e832..00000000 --- a/.brightsec/tests/get-rest-continue-code.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/continue-code', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['sqli', 'xss', 'csrf', 'business_constraint_bypass'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/continue-code`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-country-mapping.test.ts b/.brightsec/tests/get-rest-country-mapping.test.ts deleted file mode 100644 index 2ff0c536..00000000 --- a/.brightsec/tests/get-rest-country-mapping.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/country-mapping', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['improper_asset_management', 'full_path_disclosure', 'open_database', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/country-mapping`, - headers: { 'X-Recruiting': 'config.get(\'application.securityTxt.hiring\')' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-deluxe-membership.test.ts b/.brightsec/tests/get-rest-deluxe-membership.test.ts deleted file mode 100644 index b5f8734d..00000000 --- a/.brightsec/tests/get-rest-deluxe-membership.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/deluxe-membership', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'id_enumeration', 'improper_asset_management', 'xss'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/deluxe-membership`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-image-captcha.test.ts b/.brightsec/tests/get-rest-image-captcha.test.ts deleted file mode 100644 index 68673450..00000000 --- a/.brightsec/tests/get-rest-image-captcha.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/image-captcha', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'xss', 'id_enumeration', 'improper_asset_management'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/image-captcha`, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-languages.test.ts b/.brightsec/tests/get-rest-languages.test.ts deleted file mode 100644 index 8a46ed68..00000000 --- a/.brightsec/tests/get-rest-languages.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/languages', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['full_path_disclosure', 'sqli', 'xss', 'lfi', 'business_constraint_bypass'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/languages`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-memories.test.ts b/.brightsec/tests/get-rest-memories.test.ts deleted file mode 100644 index 2d57d0d8..00000000 --- a/.brightsec/tests/get-rest-memories.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/memories', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'id_enumeration', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/memories`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-order-history-orders.test.ts b/.brightsec/tests/get-rest-order-history-orders.test.ts deleted file mode 100644 index 4f4c21dc..00000000 --- a/.brightsec/tests/get-rest-order-history-orders.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/order-history/orders', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'id_enumeration', 'improper_asset_management', 'sqli'], - attackParamLocations: [AttackParamLocation.HEADER, AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/order-history/orders`, - headers: { 'X-Recruiting': 'We are hiring! Check out our careers page.' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/get-rest-order-history.test.ts b/.brightsec/tests/get-rest-order-history.test.ts deleted file mode 100644 index b662a0b7..00000000 --- a/.brightsec/tests/get-rest-order-history.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/order-history', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'nosql', 'csrf', 'id_enumeration'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/order-history`, - headers: { 'Authorization': 'Bearer ' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-products-1-reviews.test.ts b/.brightsec/tests/get-rest-products-1-reviews.test.ts deleted file mode 100644 index 98c55de6..00000000 --- a/.brightsec/tests/get-rest-products-1-reviews.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/products/1/reviews', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['nosql', 'business_constraint_bypass', 'osi', 'stored_xss'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/products/1/reviews`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-repeat-notification.test.ts b/.brightsec/tests/get-rest-repeat-notification.test.ts deleted file mode 100644 index f180cdde..00000000 --- a/.brightsec/tests/get-rest-repeat-notification.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/repeat-notification', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['xss', 'unvalidated_redirect', 'csrf', 'bopla'], - attackParamLocations: [AttackParamLocation.QUERY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/repeat-notification?challenge=OWASP%20Juice%20Shop`, - headers: { 'X-Recruiting': 'true' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-save-login-ip.test.ts b/.brightsec/tests/get-rest-save-login-ip.test.ts deleted file mode 100644 index 4b10ce9a..00000000 --- a/.brightsec/tests/get-rest-save-login-ip.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/saveLoginIp', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['xss', 'csrf', 'bopla', 'osi'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/saveLoginIp`, - headers: { 'X-Recruiting': 'We are hiring! Check out our careers page.' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-track-order-12345.test.ts b/.brightsec/tests/get-rest-track-order-12345.test.ts deleted file mode 100644 index 9f32df26..00000000 --- a/.brightsec/tests/get-rest-track-order-12345.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/track-order/:id', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['xss', 'nosql', 'osi', 'id_enumeration'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/track-order/12345`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-user-authentication-details.test.ts b/.brightsec/tests/get-rest-user-authentication-details.test.ts deleted file mode 100644 index 0428f1b1..00000000 --- a/.brightsec/tests/get-rest-user-authentication-details.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/user/authentication-details', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'xss', 'id_enumeration', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/user/authentication-details`, - headers: { 'X-Recruiting': 'config.get(\'application.securityTxt.hiring\')' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-user-change-password.test.ts b/.brightsec/tests/get-rest-user-change-password.test.ts deleted file mode 100644 index d9105dab..00000000 --- a/.brightsec/tests/get-rest-user-change-password.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/user/change-password', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'xss', 'bopla', 'jwt', 'sqli'], - attackParamLocations: [AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/user/change-password?current=currentPassword123&new=newPassword123&repeat=newPassword123`, - headers: { 'Authorization': 'Bearer ' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-user-security-question.test.ts b/.brightsec/tests/get-rest-user-security-question.test.ts deleted file mode 100644 index 45aa5284..00000000 --- a/.brightsec/tests/get-rest-user-security-question.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/user/security-question', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'id_enumeration', 'email_injection', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.QUERY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/user/security-question?email=user@example.com`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-user-whoami.test.ts b/.brightsec/tests/get-rest-user-whoami.test.ts deleted file mode 100644 index 1779d049..00000000 --- a/.brightsec/tests/get-rest-user-whoami.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/user/whoami', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'xss', 'id_enumeration', 'open_database', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.HEADER, AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/user/whoami?callback=callbackFunction`, - headers: { 'X-Recruiting': 'undefined' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-wallet-balance.test.ts b/.brightsec/tests/get-rest-wallet-balance.test.ts deleted file mode 100644 index b4df289a..00000000 --- a/.brightsec/tests/get-rest-wallet-balance.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/wallet/balance', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'id_enumeration', 'xss', 'insecure_tls_configuration'], - attackParamLocations: [AttackParamLocation.HEADER, AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/wallet/balance`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-web3-nft-mint-listen.test.ts b/.brightsec/tests/get-rest-web3-nft-mint-listen.test.ts deleted file mode 100644 index 85a79709..00000000 --- a/.brightsec/tests/get-rest-web3-nft-mint-listen.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/web3/nftMintListen', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['ssrf', 'secret_tokens', 'osi', 'csrf'], - attackParamLocations: [AttackParamLocation.QUERY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/web3/nftMintListen`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-web3-nft-unlocked.test.ts b/.brightsec/tests/get-rest-web3-nft-unlocked.test.ts deleted file mode 100644 index 14b8b34b..00000000 --- a/.brightsec/tests/get-rest-web3-nft-unlocked.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/web3/nftUnlocked', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'full_path_disclosure', 'improper_asset_management', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/web3/nftUnlocked`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-security-txt.test.ts b/.brightsec/tests/get-security-txt.test.ts deleted file mode 100644 index ee24085d..00000000 --- a/.brightsec/tests/get-security-txt.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /security.txt', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'full_path_disclosure', 'improper_asset_management', 'xss'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/security.txt`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-snippets-fixes-sample-key.test.ts b/.brightsec/tests/get-snippets-fixes-sample-key.test.ts deleted file mode 100644 index b522b5dd..00000000 --- a/.brightsec/tests/get-snippets-fixes-sample-key.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /snippets/fixes/sampleKey', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'lfi', 'xss', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/snippets/fixes/sampleKey`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-snippets-sample-challenge.test.ts b/.brightsec/tests/get-snippets-sample-challenge.test.ts deleted file mode 100644 index 03ca8c80..00000000 --- a/.brightsec/tests/get-snippets-sample-challenge.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /snippets/sample-challenge', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['xss', 'csrf', 'id_enumeration', 'improper_asset_management', 'full_path_disclosure'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/snippets/sample-challenge`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-solve-challenges-server-side.test.ts b/.brightsec/tests/get-solve-challenges-server-side.test.ts deleted file mode 100644 index 27eae98d..00000000 --- a/.brightsec/tests/get-solve-challenges-server-side.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /solve/challenges/server-side?key=:key', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['ssrf', 'ssti', 'xss', 'csrf', 'osi'], - attackParamLocations: [AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/solve/challenges/server-side?key=tRy_H4rd3r_n0thIng_iS_Imp0ssibl3`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-support-logs-sample-log.test.ts b/.brightsec/tests/get-support-logs-sample-log.test.ts deleted file mode 100644 index f224d732..00000000 --- a/.brightsec/tests/get-support-logs-sample-log.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /support/logs/sample.log', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['lfi', 'full_path_disclosure', 'access_control'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/support/logs/sample.log`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-the-devs-are-so-funny-they-hid-an-easter-egg-within-the-easter-egg.test.ts b/.brightsec/tests/get-the-devs-are-so-funny-they-hid-an-easter-egg-within-the-easter-egg.test.ts deleted file mode 100644 index 8940c9c7..00000000 --- a/.brightsec/tests/get-the-devs-are-so-funny-they-hid-an-easter-egg-within-the-easter-egg.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /the/devs/are/so/funny/they/hid/an/easter/egg/within/the/easter/egg', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['xss', 'csrf', 'improper_asset_management', 'full_path_disclosure', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/the/devs/are/so/funny/they/hid/an/easter/egg/within/the/easter/egg`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-this-page-is-hidden-behind-an-incredibly-high-paywall-that-could-only-be-unlocked-by-sending-1btc-to-us.test.ts b/.brightsec/tests/get-this-page-is-hidden-behind-an-incredibly-high-paywall-that-could-only-be-unlocked-by-sending-1btc-to-us.test.ts deleted file mode 100644 index 7b99a580..00000000 --- a/.brightsec/tests/get-this-page-is-hidden-behind-an-incredibly-high-paywall-that-could-only-be-unlocked-by-sending-1btc-to-us.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /this/page/is/hidden/behind/an/incredibly/high/paywall/that/could/only/be/unlocked/by/sending/1btc/to/us', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'xss', 'unvalidated_redirect', 'sqli', 'ssrf', 'osi', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/this/page/is/hidden/behind/an/incredibly/high/paywall/that/could/only/be/unlocked/by/sending/1btc/to/us`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-video-range-bytes-0-1023.test.ts b/.brightsec/tests/get-video-range-bytes-0-1023.test.ts deleted file mode 100644 index cf371b86..00000000 --- a/.brightsec/tests/get-video-range-bytes-0-1023.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /video?range=bytes=0-1023', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['xss', 'ssrf', 'lfi', 'full_path_disclosure'], - attackParamLocations: [AttackParamLocation.QUERY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/video?range=bytes=0-1023`, - headers: { - 'Content-Range': 'bytes 0-1023/2048', - 'Accept-Ranges': 'bytes', - 'Content-Length': '1024', - 'Content-Location': '/assets/public/videos/owasp_promo.mp4', - 'Content-Type': 'video/mp4' - }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-we-may-also-instruct-you-to-refuse-all-reasonably-necessary-responsibility.test.ts b/.brightsec/tests/get-we-may-also-instruct-you-to-refuse-all-reasonably-necessary-responsibility.test.ts deleted file mode 100644 index 8d88989b..00000000 --- a/.brightsec/tests/get-we-may-also-instruct-you-to-refuse-all-reasonably-necessary-responsibility.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /we/may/also/instruct/you/to/refuse/all/reasonably/necessary/responsibility', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'xss', 'full_path_disclosure', 'improper_asset_management', 'sqli', 'ssrf'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/we/may/also/instruct/you/to/refuse/all/reasonably/necessary/responsibility`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-well-known-samplefile.test.ts b/.brightsec/tests/get-well-known-samplefile.test.ts deleted file mode 100644 index 65748df0..00000000 --- a/.brightsec/tests/get-well-known-samplefile.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /.well-known/samplefile', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['improper_asset_management', 'full_path_disclosure', 'xss', 'csrf'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/.well-known/samplefile`, - headers: { 'X-Recruiting': 'We are hiring! Visit our careers page for more information.' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-well-known-security-txt.test.ts b/.brightsec/tests/get-well-known-security-txt.test.ts deleted file mode 100644 index 489ed7c0..00000000 --- a/.brightsec/tests/get-well-known-security-txt.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /.well-known/security.txt', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'full_path_disclosure', 'improper_asset_management', 'unvalidated_redirect'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/.well-known/security.txt`, - headers: { 'X-Recruiting': '/#/jobs' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-well-known.test.ts b/.brightsec/tests/get-well-known.test.ts deleted file mode 100644 index 22e98f39..00000000 --- a/.brightsec/tests/get-well-known.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /.well-known', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['improper_asset_management', 'full_path_disclosure', 'directory_listing'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/.well-known`, - headers: { 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/patch-rest-products-id-reviews.test.ts b/.brightsec/tests/patch-rest-products-id-reviews.test.ts deleted file mode 100644 index c4b5dcfd..00000000 --- a/.brightsec/tests/patch-rest-products-id-reviews.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PATCH /rest/products/:id/reviews', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['nosql', 'bopla', 'csrf'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PATCH, - url: `${baseUrl}/rest/products/507f1f77bcf86cd799439011/reviews`, - body: { - id: '507f1f77bcf86cd799439011', - message: 'This is an updated review message.' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/patch-rest-products-reviews.test.ts b/.brightsec/tests/patch-rest-products-reviews.test.ts deleted file mode 100644 index f1dd225d..00000000 --- a/.brightsec/tests/patch-rest-products-reviews.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PATCH /rest/products/reviews', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'nosql', 'xss'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PATCH, - url: `${baseUrl}/rest/products/reviews`, - body: { - id: '507f1f77bcf86cd799439011', - message: 'Updated review message' - }, - headers: { 'X-Recruiting': '', 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-addresses.test.ts b/.brightsec/tests/post-api-addresses.test.ts deleted file mode 100644 index c2bdca17..00000000 --- a/.brightsec/tests/post-api-addresses.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/addresses', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'sqli', 'xss', 'csrf', 'id_enumeration'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/Addresses`, - body: { - UserId: 1, - fullName: 'John Doe', - mobileNum: 1234567890, - zipCode: '12345', - streetAddress: '123 Main St', - city: 'Metropolis', - state: 'NY', - country: 'USA' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-basket-items.test.ts b/.brightsec/tests/post-api-basket-items.test.ts deleted file mode 100644 index 07ad83cd..00000000 --- a/.brightsec/tests/post-api-basket-items.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/basket-items', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'id_enumeration', 'sqli', 'xss', 'csrf', 'business_constraint_bypass'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/BasketItems`, - body: [{ "ProductId": 1, "BasketId": 1, "quantity": 2 }], - headers: { 'Content-Type': 'application/json', 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-cards.test.ts b/.brightsec/tests/post-api-cards.test.ts deleted file mode 100644 index b9fc14cd..00000000 --- a/.brightsec/tests/post-api-cards.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/cards', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'sqli', 'xss', 'csrf', 'date_manipulation'], - attackParamLocations: [AttackParamLocation.BODY], - skipStaticParams: false - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/Cards`, - body: { - UserId: 1, - fullName: 'John Doe', - cardNum: 1234567812345678, - expMonth: 12, - expYear: 2099 - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-challenges.test.ts b/.brightsec/tests/post-api-challenges.test.ts deleted file mode 100644 index f51d3aaf..00000000 --- a/.brightsec/tests/post-api-challenges.test.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/challenges', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['stored_xss', 'csrf', 'bopla', 'business_constraint_bypass', 'osi'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/Challenges`, - body: { - key: 'restfulXssChallenge', - name: 'Sample Challenge', - category: 'Security', - description: 'A challenge to test XSS vulnerabilities.', - difficulty: 3, - hint: 'Try injecting scripts.', - hintUrl: 'http://example.com/hint', - mitigationUrl: 'http://example.com/mitigation', - tags: 'xss,security', - solved: false, - codingChallengeStatus: 0, - hasCodingChallenge: true - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-complaints.test.ts b/.brightsec/tests/post-api-complaints.test.ts deleted file mode 100644 index 17dbbc05..00000000 --- a/.brightsec/tests/post-api-complaints.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/complaints', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['file_upload', 'bopla', 'xss', 'sqli', 'csrf', 'osi'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/Complaints`, - body: { - UserId: 123, - message: "This is a sample complaint message.", - file: "optional-file-path.jpg" - }, - headers: { 'Content-Type': 'application/json', 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-feedbacks.test.ts b/.brightsec/tests/post-api-feedbacks.test.ts deleted file mode 100644 index e1d632df..00000000 --- a/.brightsec/tests/post-api-feedbacks.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/feedbacks', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'xss', 'bopla', 'sqli', 'nosql'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/Feedbacks`, - body: { - UserId: 123, - comment: 'Great product!', - rating: 5 - }, - headers: { 'Content-Type': 'application/json', 'X-Recruiting': 'true' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-privacy-requests.test.ts b/.brightsec/tests/post-api-privacy-requests.test.ts deleted file mode 100644 index 4640a765..00000000 --- a/.brightsec/tests/post-api-privacy-requests.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/privacy-requests', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'sqli', 'ssti', 'xss', 'file_upload'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/PrivacyRequests`, - body: { - email: 'user@example.com', - securityAnswer: 'exampleAnswer', - layout: 'optionalLayout.hbs' - }, - headers: { 'Content-Type': 'application/json', 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-products.test.ts b/.brightsec/tests/post-api-products.test.ts deleted file mode 100644 index 8bad4324..00000000 --- a/.brightsec/tests/post-api-products.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/products', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'file_upload', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/Products`, - body: { - name: 'Apple Juice', - description: 'Freshly squeezed apple juice', - price: 3.99, - deluxePrice: 5.99, - image: 'apple-juice.png' - }, - headers: { 'Content-Type': 'application/json', 'X-Recruiting': 'We are hiring!' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-quantitys.test.ts b/.brightsec/tests/post-api-quantitys.test.ts deleted file mode 100644 index 8071ddca..00000000 --- a/.brightsec/tests/post-api-quantitys.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/quantitys', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'sqli', 'xss', 'id_enumeration'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/Quantitys`, - body: { - ProductId: 1, - quantity: 5 - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-recycles.test.ts b/.brightsec/tests/post-api-recycles.test.ts deleted file mode 100644 index 778e8e88..00000000 --- a/.brightsec/tests/post-api-recycles.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/recycles', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'business_constraint_bypass', 'date_manipulation', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.BODY], - skipStaticParams: false - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/Recycles`, - body: { - UserId: 1, - AddressId: 1, - quantity: 10, - isPickup: true, - date: '2023-10-01T10:00:00Z' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-security-questions.test.ts b/.brightsec/tests/post-api-security-questions.test.ts deleted file mode 100644 index 42a5c291..00000000 --- a/.brightsec/tests/post-api-security-questions.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/security-questions', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'sqli', 'xss', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/SecurityQuestions`, - body: { - question: 'What is your pet’s name?', - answer: 'Fluffy' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-users.test.ts b/.brightsec/tests/post-api-users.test.ts deleted file mode 100644 index 3ac8db0d..00000000 --- a/.brightsec/tests/post-api-users.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/users', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'xss', 'sqli', 'bopla', 'email_injection', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/Users`, - body: { - email: 'user@example.com', - password: 'securePassword123', - passwordRepeat: 'securePassword123' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-b2b-v2-orders.test.ts b/.brightsec/tests/post-b2b-v2-orders.test.ts deleted file mode 100644 index 99cd1718..00000000 --- a/.brightsec/tests/post-b2b-v2-orders.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /b2b/v2/orders', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['osi', 'business_constraint_bypass', 'csrf', 'xss', 'sqli'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/b2b/v2/orders`, - body: { - cid: 'exampleCID', - orderLinesData: 'exampleOrderLinesData' - }, - headers: { - 'Content-Type': 'application/json', - 'X-Recruiting': '' - }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-dataerasure.test.ts b/.brightsec/tests/post-dataerasure.test.ts deleted file mode 100644 index 0f45ddf5..00000000 --- a/.brightsec/tests/post-dataerasure.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /dataerasure', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['lfi', 'csrf', 'xss', 'osi'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/dataerasure`, - body: { - email: 'user@example.com', - securityAnswer: 'myAnswer', - layout: 'optionalLayout' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-file-upload.test.ts b/.brightsec/tests/post-file-upload.test.ts deleted file mode 100644 index f49ca602..00000000 --- a/.brightsec/tests/post-file-upload.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /file-upload', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['file_upload', 'xss', 'osi', 'ssrf', 'lfi'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/file-upload`, - headers: { 'Content-Type': 'multipart/form-data' }, - body: `--boundary\r\nContent-Disposition: form-data; name="file"; filename="example.zip"\r\nContent-Type: application/zip\r\n\r\n\r\n--boundary--`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-profile-image-file.test.ts b/.brightsec/tests/post-profile-image-file.test.ts deleted file mode 100644 index 6f05764c..00000000 --- a/.brightsec/tests/post-profile-image-file.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /profile/image/file', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['file_upload', 'ssrf', 'xss', 'csrf'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/profile/image/file`, - headers: { 'X-Recruiting': 'We are hiring! Visit our careers page for more information.' }, - body: { file: '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-profile-image-url.test.ts b/.brightsec/tests/post-profile-image-url.test.ts deleted file mode 100644 index aee59a27..00000000 --- a/.brightsec/tests/post-profile-image-url.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /profile/image/url', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['ssrf', 'file_upload', 'xss', 'unvalidated_redirect'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/profile/image/url`, - body: { - imageUrl: 'https://example.com/image.jpg' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-profile.test.ts b/.brightsec/tests/post-profile.test.ts deleted file mode 100644 index 6a445df8..00000000 --- a/.brightsec/tests/post-profile.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /profile', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'xss', 'sqli', 'proto_pollution'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/profile`, - body: { - username: 'newUsername' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-rest-2fa-disable.test.ts b/.brightsec/tests/post-rest-2fa-disable.test.ts deleted file mode 100644 index 1913a458..00000000 --- a/.brightsec/tests/post-rest-2fa-disable.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/2fa/disable', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'osi', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/2fa/disable`, - body: { - password: 'examplePassword123' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-rest-2fa-setup.test.ts b/.brightsec/tests/post-rest-2fa-setup.test.ts deleted file mode 100644 index eec835bb..00000000 --- a/.brightsec/tests/post-rest-2fa-setup.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/2fa/setup', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'osi', 'secret_tokens', 'stored_xss'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/2fa/setup`, - body: { - password: 'examplePassword123', - setupToken: 'exampleSetupToken', - initialToken: '123456' - }, - headers: { - 'Content-Type': 'application/json', - 'X-Recruiting': 'We are hiring! Check our careers page.' - }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-rest-2fa-verify.test.ts b/.brightsec/tests/post-rest-2fa-verify.test.ts deleted file mode 100644 index 4e6dcd9a..00000000 --- a/.brightsec/tests/post-rest-2fa-verify.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/2fa/verify', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['jwt', 'bopla', 'xss', 'sqli', 'csrf', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/2fa/verify`, - body: { - tmpToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', - totpToken: '123456' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-rest-basket-1-checkout.test.ts b/.brightsec/tests/post-rest-basket-1-checkout.test.ts deleted file mode 100644 index 705a83ab..00000000 --- a/.brightsec/tests/post-rest-basket-1-checkout.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/basket/1/checkout', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'business_constraint_bypass', 'csrf', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/basket/1/checkout`, - body: { - orderDetails: { - deliveryMethodId: 1, - paymentId: 'wallet', - addressId: 123 - }, - UserId: 456 - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/post-rest-deluxe-membership.test.ts b/.brightsec/tests/post-rest-deluxe-membership.test.ts deleted file mode 100644 index 04b61f43..00000000 --- a/.brightsec/tests/post-rest-deluxe-membership.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/deluxe-membership', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'sqli', 'xss', 'business_constraint_bypass', 'jwt'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/deluxe-membership`, - body: { - UserId: 123, - paymentMode: 'wallet' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-rest-memories.test.ts b/.brightsec/tests/post-rest-memories.test.ts deleted file mode 100644 index 967fd969..00000000 --- a/.brightsec/tests/post-rest-memories.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/memories', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['file_upload', 'stored_xss', 'bopla', 'csrf'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/memories`, - headers: { 'Content-Type': 'multipart/form-data' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-rest-products-123-reviews.test.ts b/.brightsec/tests/post-rest-products-123-reviews.test.ts deleted file mode 100644 index d8e0882d..00000000 --- a/.brightsec/tests/post-rest-products-123-reviews.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/products/123/reviews', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'xss', 'sqli', 'email_injection', 'bopla'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/products/123/reviews`, - body: { - message: 'Great product!', - author: 'user@example.com' - }, - headers: { - 'Content-Type': 'application/json', - 'X-Forwarded-For': '192.168.1.1' - }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-rest-user-data-export.test.ts b/.brightsec/tests/post-rest-user-data-export.test.ts deleted file mode 100644 index dfaf4dad..00000000 --- a/.brightsec/tests/post-rest-user-data-export.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/user/data-export', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'nosql', 'xss', 'csrf'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/user/data-export`, - body: { - UserId: '123' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/post-rest-user-login.test.ts b/.brightsec/tests/post-rest-user-login.test.ts deleted file mode 100644 index 5e85f436..00000000 --- a/.brightsec/tests/post-rest-user-login.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/user/login', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['sqli', 'csrf', 'xss', 'jwt', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/user/login`, - body: { - email: 'user@example.com', - password: 'securePassword123' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-rest-user-reset-password.test.ts b/.brightsec/tests/post-rest-user-reset-password.test.ts deleted file mode 100644 index 94a15382..00000000 --- a/.brightsec/tests/post-rest-user-reset-password.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/user/reset-password', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'email_injection', 'osi', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/user/reset-password`, - body: { - email: 'user@example.com', - answer: 'correct_answer', - new: 'new_password', - repeat: 'new_password' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-rest-web3-submit-key.test.ts b/.brightsec/tests/post-rest-web3-submit-key.test.ts deleted file mode 100644 index 3d844c65..00000000 --- a/.brightsec/tests/post-rest-web3-submit-key.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/web3/submitKey', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['secret_tokens', 'csrf', 'osi', 'xss', 'sqli'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/web3/submitKey`, - body: { - privateKey: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-rest-web3-wallet-exploit-address.test.ts b/.brightsec/tests/post-rest-web3-wallet-exploit-address.test.ts deleted file mode 100644 index 723306bd..00000000 --- a/.brightsec/tests/post-rest-web3-wallet-exploit-address.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/web3/walletExploitAddress', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['ssrf', 'osi', 'csrf', 'xss', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/web3/walletExploitAddress`, - body: { - walletAddress: '0x1234567890abcdef1234567890abcdef12345678' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-rest-web3-wallet-nft-verify.test.ts b/.brightsec/tests/post-rest-web3-wallet-nft-verify.test.ts deleted file mode 100644 index 574ddaf8..00000000 --- a/.brightsec/tests/post-rest-web3-wallet-nft-verify.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/web3/walletNFTVerify', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'xss', 'osi', 'nosql'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/web3/walletNFTVerify`, - body: { - walletAddress: '0x1234567890abcdef1234567890abcdef12345678' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-snippets-fixes.test.ts b/.brightsec/tests/post-snippets-fixes.test.ts deleted file mode 100644 index a4190c64..00000000 --- a/.brightsec/tests/post-snippets-fixes.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /snippets/fixes', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'xss', 'secret_tokens', 'sqli'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/snippets/fixes`, - body: { - key: 'exampleKey', - selectedFix: 1 - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-snippets-verdict.test.ts b/.brightsec/tests/post-snippets-verdict.test.ts deleted file mode 100644 index 4bcc685a..00000000 --- a/.brightsec/tests/post-snippets-verdict.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /snippets/verdict', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'xss', 'sqli', 'nosql', 'osi', 'ssti'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/snippets/verdict`, - body: { - selectedLines: [1, 2, 3], - key: 'exampleKey' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/put-api-addresses-1.test.ts b/.brightsec/tests/put-api-addresses-1.test.ts deleted file mode 100644 index 70a6d245..00000000 --- a/.brightsec/tests/put-api-addresses-1.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /api/addresses/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/api/Addresses/1`, - body: { - fullName: 'John Doe', - mobileNum: 1234567890, - zipCode: '12345', - streetAddress: '123 Main St', - city: 'Metropolis', - state: 'NY', - country: 'USA' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-addresss-1.test.ts b/.brightsec/tests/put-api-addresss-1.test.ts deleted file mode 100644 index ebf3ac9c..00000000 --- a/.brightsec/tests/put-api-addresss-1.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /api/addresss/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'sqli', 'xss', 'id_enumeration'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/api/Addresss/1`, - body: { - fullName: 'John Doe', - mobileNum: 1234567890, - zipCode: '12345', - streetAddress: '123 Main St', - city: 'Metropolis', - state: 'NY', - country: 'USA' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/put-api-basket-items-1.test.ts b/.brightsec/tests/put-api-basket-items-1.test.ts deleted file mode 100644 index 60269fdc..00000000 --- a/.brightsec/tests/put-api-basket-items-1.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /api/basket-items/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'business_constraint_bypass', 'csrf', 'id_enumeration', 'sqli'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/api/BasketItems/1`, - body: { - ProductId: 1, - BasketId: 1, - quantity: 2 - }, - headers: { 'Content-Type': 'application/json', 'X-Recruiting': 'true' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-cards-1.test.ts b/.brightsec/tests/put-api-cards-1.test.ts deleted file mode 100644 index 9fc54c22..00000000 --- a/.brightsec/tests/put-api-cards-1.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /api/cards/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'sqli', 'xss', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/api/Cards/1`, - body: { - UserId: 1, - fullName: 'John Doe', - cardNum: 1234567812345678, - expMonth: 12, - expYear: 2090 - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-challenges-1.test.ts b/.brightsec/tests/put-api-challenges-1.test.ts deleted file mode 100644 index 81e0da5e..00000000 --- a/.brightsec/tests/put-api-challenges-1.test.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /api/challenges/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'stored_xss', 'csrf', 'sqli', 'osi'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/api/Challenges/1`, - body: { - name: "New Challenge Name", - category: "Security", - description: "Solve the XSS challenge", - difficulty: 3, - hint: "Try looking at the source code", - hintUrl: "http://example.com/hint", - mitigationUrl: "http://example.com/mitigation", - key: "restfulXssChallenge", - tags: "xss,security", - solved: false, - codingChallengeStatus: 0, - hasCodingChallenge: true - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/put-api-feedbacks-1.test.ts b/.brightsec/tests/put-api-feedbacks-1.test.ts deleted file mode 100644 index 298cd3f8..00000000 --- a/.brightsec/tests/put-api-feedbacks-1.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /api/feedbacks/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'xss', 'sqli', 'id_enumeration'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/api/Feedbacks/1`, - body: { - UserId: 1, - comment: 'Great product!', - rating: 5 - }, - headers: { - 'Content-Type': 'application/json', - 'X-Recruiting': 'Your Company is Hiring!' - }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/put-api-privacy-requests-1.test.ts b/.brightsec/tests/put-api-privacy-requests-1.test.ts deleted file mode 100644 index 03dd1157..00000000 --- a/.brightsec/tests/put-api-privacy-requests-1.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /api/PrivacyRequests/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'id_enumeration', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/api/PrivacyRequests/1`, - body: { - UserId: 123, - deletionRequested: true - }, - headers: { - 'Content-Type': 'application/json', - 'X-Recruiting': 'We are hiring! Check out our careers page.' - }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-quantitys-1.test.ts b/.brightsec/tests/put-api-quantitys-1.test.ts deleted file mode 100644 index 1d37cef6..00000000 --- a/.brightsec/tests/put-api-quantitys-1.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /api/quantitys/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'business_constraint_bypass', 'sqli', 'csrf', 'xss'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/api/Quantitys/1`, - body: { - ProductId: 1, - quantity: 100, - limitPerUser: 5 - }, - headers: { 'X-Recruiting': 'true', 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-recycles-1.test.ts b/.brightsec/tests/put-api-recycles-1.test.ts deleted file mode 100644 index 72083a26..00000000 --- a/.brightsec/tests/put-api-recycles-1.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /api/recycles/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['sqli', 'bopla', 'csrf', 'id_enumeration', 'date_manipulation'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/api/Recycles/1`, - body: { - UserId: 1, - AddressId: 1, - quantity: 10, - isPickup: true, - date: '2023-10-01T00:00:00Z' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-security-answers-1.test.ts b/.brightsec/tests/put-api-security-answers-1.test.ts deleted file mode 100644 index 339720f2..00000000 --- a/.brightsec/tests/put-api-security-answers-1.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /api/security-answers/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'id_enumeration', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/api/SecurityAnswers/1`, - body: { - answer: 'Blurp' - }, - headers: { 'Authorization': `Bearer ${process.env.BRIGHT_AUTH_ID}` }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/put-api-security-questions-1.test.ts b/.brightsec/tests/put-api-security-questions-1.test.ts deleted file mode 100644 index 9b6251ed..00000000 --- a/.brightsec/tests/put-api-security-questions-1.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /api/security-questions/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'xss', 'sqli', 'id_enumeration'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/api/SecurityQuestions/1`, - body: { - question: 'Your own first name?' - }, - headers: { - 'Authorization': 'Bearer ', - 'Content-Type': 'application/json' - }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); \ No newline at end of file diff --git a/.brightsec/tests/put-api-users-123.test.ts b/.brightsec/tests/put-api-users-123.test.ts deleted file mode 100644 index f5b6e704..00000000 --- a/.brightsec/tests/put-api-users-123.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /api/users/123', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'xss', 'sqli', 'file_upload', 'secret_tokens'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/api/Users/123`, - body: { - username: 'new_username', - email: 'new_email@example.com', - password: 'new_password', - role: 'customer', - deluxeToken: '', - lastLoginIp: '192.168.1.1', - profileImage: '/assets/public/images/uploads/default.svg', - totpSecret: '', - isActive: true - }, - headers: { 'Content-Type': 'application/json', 'X-Recruiting': '' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/put-rest-basket-1-coupon-summer21.test.ts b/.brightsec/tests/put-rest-basket-1-coupon-summer21.test.ts deleted file mode 100644 index 32f51322..00000000 --- a/.brightsec/tests/put-rest-basket-1-coupon-summer21.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /rest/basket/1/coupon/SUMMER21', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'sqli', 'xss', 'business_constraint_bypass'], - attackParamLocations: [AttackParamLocation.PATH, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/rest/basket/1/coupon/SUMMER21`, - headers: { 'X-Recruiting': 'undefined' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/put-rest-continue-code-apply-continuecode.test.ts b/.brightsec/tests/put-rest-continue-code-apply-continuecode.test.ts deleted file mode 100644 index fac04b88..00000000 --- a/.brightsec/tests/put-rest-continue-code-apply-continuecode.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /rest/continue-code/apply/:continueCode', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'id_enumeration', 'xss', 'sqli', 'nosql', 'osi', 'xxe'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/rest/continue-code/apply/yXjv6Z5jWJnzD6a3YvmwPRXK7roAyzHDde2Og19yEN84plqxkMBbLVQrDeoY`, - headers: { 'X-Recruiting': 'We are hiring!' }, - body: { - continueCode: 'yXjv6Z5jWJnzD6a3YvmwPRXK7roAyzHDde2Og19yEN84plqxkMBbLVQrDeoY' - }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/put-rest-continue-code-findit-apply-examplecontinuecode123.test.ts b/.brightsec/tests/put-rest-continue-code-findit-apply-examplecontinuecode123.test.ts deleted file mode 100644 index 1230b7d4..00000000 --- a/.brightsec/tests/put-rest-continue-code-findit-apply-examplecontinuecode123.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /rest/continue-code-findIt/apply/exampleContinueCode123', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'http_method_fuzzing', 'sqli', 'xss'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/rest/continue-code-findIt/apply/exampleContinueCode123`, - body: { - continueCode: 'exampleContinueCode123' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/put-rest-continue-code-fixit-apply-example-continue-code-123.test.ts b/.brightsec/tests/put-rest-continue-code-fixit-apply-example-continue-code-123.test.ts deleted file mode 100644 index 54ea7d88..00000000 --- a/.brightsec/tests/put-rest-continue-code-fixit-apply-example-continue-code-123.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /rest/continue-code-fixIt/apply/exampleContinueCode123', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['csrf', 'bopla', 'sqli', 'xss', 'osi'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/rest/continue-code-fixIt/apply/exampleContinueCode123`, - body: { - continueCode: 'exampleContinueCode123' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/put-rest-order-history-1-delivery-status.test.ts b/.brightsec/tests/put-rest-order-history-1-delivery-status.test.ts deleted file mode 100644 index 58783bc3..00000000 --- a/.brightsec/tests/put-rest-order-history-1-delivery-status.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /rest/order-history/1/delivery-status', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'id_enumeration', 'jwt', 'xss'], - attackParamLocations: [AttackParamLocation.BODY, AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/rest/order-history/1/delivery-status`, - body: { delivered: false }, - headers: { 'Authorization': 'Bearer ', 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/put-rest-wallet-balance.test.ts b/.brightsec/tests/put-rest-wallet-balance.test.ts deleted file mode 100644 index dda947b8..00000000 --- a/.brightsec/tests/put-rest-wallet-balance.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('PUT /rest/wallet/balance', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['bopla', 'csrf', 'sqli', 'id_enumeration', 'xss'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.PUT, - url: `${baseUrl}/rest/wallet/balance`, - body: { - UserId: 1, - paymentId: 123, - balance: 100 - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); From b33e1929582d5d4536e6f158cb589f3a14baffdd Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 15:04:47 +0400 Subject: [PATCH 06/13] test: optimize security tests to focus on specific vulnerabilities skip-checks:true --- .brightsec/tests/get-api-users-1.test.ts | 2 +- .brightsec/tests/get-rest-chatbot-status.test.ts | 2 +- .brightsec/tests/get-rest-products-search.test.ts | 2 +- .brightsec/tests/post-api-addresss.test.ts | 2 +- .brightsec/tests/post-rest-chatbot-respond.test.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.brightsec/tests/get-api-users-1.test.ts b/.brightsec/tests/get-api-users-1.test.ts index 3f594257..93bf1ee5 100644 --- a/.brightsec/tests/get-api-users-1.test.ts +++ b/.brightsec/tests/get-api-users-1.test.ts @@ -21,7 +21,7 @@ after(() => runner.clear()); test('GET /api/users/1', { signal: AbortSignal.timeout(timeout) }, async () => { await runner .createScan({ - tests: ['id_enumeration', 'bopla', 'jwt', 'xss', 'sqli', 'csrf'], + tests: ['jwt'], attackParamLocations: [AttackParamLocation.PATH] }) .setFailFast(false) diff --git a/.brightsec/tests/get-rest-chatbot-status.test.ts b/.brightsec/tests/get-rest-chatbot-status.test.ts index ec66914c..097f6d83 100644 --- a/.brightsec/tests/get-rest-chatbot-status.test.ts +++ b/.brightsec/tests/get-rest-chatbot-status.test.ts @@ -21,7 +21,7 @@ after(() => runner.clear()); test('GET /rest/chatbot/status', { signal: AbortSignal.timeout(timeout) }, async () => { await runner .createScan({ - tests: ['csrf', 'jwt', 'xss', 'server_side_js_injection', 'secret_tokens'], + tests: ['jwt'], attackParamLocations: [AttackParamLocation.HEADER] }) .setFailFast(false) diff --git a/.brightsec/tests/get-rest-products-search.test.ts b/.brightsec/tests/get-rest-products-search.test.ts index 99d4c859..47ec46ce 100644 --- a/.brightsec/tests/get-rest-products-search.test.ts +++ b/.brightsec/tests/get-rest-products-search.test.ts @@ -21,7 +21,7 @@ after(() => runner.clear()); test('GET /rest/products/search?q=:query', { signal: AbortSignal.timeout(timeout) }, async () => { await runner .createScan({ - tests: ['sqli', 'xss', 'full_path_disclosure', 'business_constraint_bypass'], + tests: ['sqli'], attackParamLocations: [AttackParamLocation.QUERY] }) .setFailFast(false) diff --git a/.brightsec/tests/post-api-addresss.test.ts b/.brightsec/tests/post-api-addresss.test.ts index 70d6b2b4..70885f25 100644 --- a/.brightsec/tests/post-api-addresss.test.ts +++ b/.brightsec/tests/post-api-addresss.test.ts @@ -21,7 +21,7 @@ after(() => runner.clear()); test('POST /api/addresss', { signal: AbortSignal.timeout(timeout) }, async () => { await runner .createScan({ - tests: ['bopla', 'sqli', 'xss', 'csrf', 'id_enumeration'], + tests: ['id_enumeration'], attackParamLocations: [AttackParamLocation.BODY] }) .setFailFast(false) diff --git a/.brightsec/tests/post-rest-chatbot-respond.test.ts b/.brightsec/tests/post-rest-chatbot-respond.test.ts index c2d1f01c..5a8ce3eb 100644 --- a/.brightsec/tests/post-rest-chatbot-respond.test.ts +++ b/.brightsec/tests/post-rest-chatbot-respond.test.ts @@ -21,7 +21,7 @@ after(() => runner.clear()); test('POST /rest/chatbot/respond', { signal: AbortSignal.timeout(timeout) }, async () => { await runner .createScan({ - tests: ['jwt', 'xss', 'csrf', 'osi', 'nosql'], + tests: ['jwt'], attackParamLocations: [AttackParamLocation.BODY] }) .setFailFast(false) From df3bdba5f3f365800b2c30fd5c46390cbd6676e6 Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 15:07:46 +0400 Subject: [PATCH 07/13] fix: apply automated fixes for detected vulnerabilities --- lib/insecurity.ts | 2 +- routes/address.ts | 22 +++++++++++++++++----- routes/chatbot.ts | 2 +- routes/search.ts | 5 ++++- routes/verify.ts | 2 +- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/lib/insecurity.ts b/lib/insecurity.ts index 08ee8ad0..7d715533 100644 --- a/lib/insecurity.ts +++ b/lib/insecurity.ts @@ -54,7 +54,7 @@ export const cutOffPoisonNullByte = (str: string) => { export const isAuthorized = () => expressJwt(({ secret: publicKey }) as any) export const denyAll = () => expressJwt({ secret: '' + Math.random() } as any) export const authorize = (user = {}) => jwt.sign(user, privateKey, { expiresIn: '6h', algorithm: 'RS256' }) -export const verify = (token: string) => token ? (jws.verify as ((token: string, secret: string) => boolean))(token, publicKey) : false +export const verify = (token: string) => token ? jwt.verify(token, publicKey, { algorithms: ['RS256'] }) : false export const decode = (token: string) => { return jws.decode(token)?.payload } export const sanitizeHtml = (html: string) => sanitizeHtmlLib(html) diff --git a/routes/address.ts b/routes/address.ts index 9d552a60..aba91ac2 100644 --- a/routes/address.ts +++ b/routes/address.ts @@ -8,29 +8,41 @@ import { AddressModel } from '../models/address' export function getAddress () { return async (req: Request, res: Response) => { - const addresses = await AddressModel.findAll({ where: { UserId: req.body.UserId } }) + const userId = req.body.UserId + if (!userId) { + return res.status(401).json({ status: 'error', data: 'Unauthorized access.' }) + } + const addresses = await AddressModel.findAll({ where: { UserId: userId } }) res.status(200).json({ status: 'success', data: addresses }) } } export function getAddressById () { return async (req: Request, res: Response) => { - const address = await AddressModel.findOne({ where: { id: req.params.id, UserId: req.body.UserId } }) + const userId = req.body.UserId + if (!userId) { + return res.status(401).json({ status: 'error', data: 'Unauthorized access.' }) + } + const address = await AddressModel.findOne({ where: { id: req.params.id, UserId: userId } }) if (address != null) { res.status(200).json({ status: 'success', data: address }) } else { - res.status(400).json({ status: 'error', data: 'Malicious activity detected.' }) + res.status(404).json({ status: 'error', data: 'Address not found.' }) } } } export function delAddressById () { return async (req: Request, res: Response) => { - const address = await AddressModel.destroy({ where: { id: req.params.id, UserId: req.body.UserId } }) + const userId = req.body.UserId + if (!userId) { + return res.status(401).json({ status: 'error', data: 'Unauthorized access.' }) + } + const address = await AddressModel.destroy({ where: { id: req.params.id, UserId: userId } }) if (address) { res.status(200).json({ status: 'success', data: 'Address deleted successfully.' }) } else { - res.status(400).json({ status: 'error', data: 'Malicious activity detected.' }) + res.status(404).json({ status: 'error', data: 'Address not found.' }) } } } diff --git a/routes/chatbot.ts b/routes/chatbot.ts index ff12ea36..0c57d138 100644 --- a/routes/chatbot.ts +++ b/routes/chatbot.ts @@ -236,7 +236,7 @@ export function process () { async function getUserFromJwt (token: string): Promise { return await new Promise((resolve) => { - jwt.verify(token, security.publicKey, (err: VerifyErrors | null, decoded: JwtPayload | string | undefined) => { + jwt.verify(token, security.publicKey, { algorithms: ['RS256'] }, (err: VerifyErrors | null, decoded: JwtPayload | string | undefined) => { if (err !== null || !decoded || isString(decoded)) { resolve(null) } else { diff --git a/routes/search.ts b/routes/search.ts index e89922d1..cce21b76 100644 --- a/routes/search.ts +++ b/routes/search.ts @@ -20,7 +20,10 @@ export function searchProducts () { return (req: Request, res: Response, next: NextFunction) => { let criteria: any = req.query.q === 'undefined' ? '' : req.query.q ?? '' criteria = (criteria.length <= 200) ? criteria : criteria.substring(0, 200) - models.sequelize.query(`SELECT * FROM Products WHERE ((name LIKE '%${criteria}%' OR description LIKE '%${criteria}%') AND deletedAt IS NULL) ORDER BY name`) // vuln-code-snippet vuln-line unionSqlInjectionChallenge dbSchemaChallenge + models.sequelize.query('SELECT * FROM Products WHERE ((name LIKE :criteria OR description LIKE :criteria) AND deletedAt IS NULL) ORDER BY name', { + replacements: { criteria: `%${criteria}%` }, + type: models.sequelize.QueryTypes.SELECT + }) .then(([products]: any) => { const dataString = JSON.stringify(products) if (challengeUtils.notSolved(challenges.unionSqlInjectionChallenge)) { // vuln-code-snippet hide-start diff --git a/routes/verify.ts b/routes/verify.ts index 63388680..639f71c2 100644 --- a/routes/verify.ts +++ b/routes/verify.ts @@ -114,7 +114,7 @@ function jwtChallenge (challenge: Challenge, req: Request, algorithm: string, em return } - jwt.verify(token, security.publicKey, (err: jwt.VerifyErrors | null) => { + jwt.verify(token, security.publicKey, { algorithms: ['RS256', 'HS256'] }, (err: jwt.VerifyErrors | null) => { if (err === null) { challengeUtils.solveIf(challenge, () => { return hasAlgorithm(token, algorithm) && hasEmail(decoded as { data: { email: string } }, email) From ce17f3e55c959f450dad6147af3b958f14e97c7f Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 15:20:49 +0400 Subject: [PATCH 08/13] test: remove completed test files that are no longer relevant skip-checks:true --- .../tests/get-rest-products-search.test.ts | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 .brightsec/tests/get-rest-products-search.test.ts diff --git a/.brightsec/tests/get-rest-products-search.test.ts b/.brightsec/tests/get-rest-products-search.test.ts deleted file mode 100644 index 47ec46ce..00000000 --- a/.brightsec/tests/get-rest-products-search.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/products/search?q=:query', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['sqli'], - attackParamLocations: [AttackParamLocation.QUERY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/products/search?q=apple`, - headers: { 'X-Recruiting': 'We are hiring!' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); From 90c664436bca5788a4e6efc3caa5ae9d05a6fbe3 Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 15:24:19 +0400 Subject: [PATCH 09/13] fix: apply automated fixes for detected vulnerabilities --- lib/insecurity.ts | 2 +- routes/address.ts | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/insecurity.ts b/lib/insecurity.ts index 7d715533..b2f58894 100644 --- a/lib/insecurity.ts +++ b/lib/insecurity.ts @@ -188,7 +188,7 @@ export const appendUserId = () => { export const updateAuthenticatedUsers = () => (req: Request, res: Response, next: NextFunction) => { const token = req.cookies.token || utils.jwtFrom(req) if (token) { - jwt.verify(token, publicKey, (err: Error | null, decoded: any) => { + jwt.verify(token, publicKey, { algorithms: ['RS256', 'HS256'] }, (err: Error | null, decoded: any) => { if (err === null) { if (authenticatedUsers.get(token) === undefined) { authenticatedUsers.put(token, decoded) diff --git a/routes/address.ts b/routes/address.ts index aba91ac2..9712ad44 100644 --- a/routes/address.ts +++ b/routes/address.ts @@ -46,3 +46,28 @@ export function delAddressById () { } } } + +export function createAddress () { + return async (req: Request, res: Response) => { + const userId = req.body.UserId + if (!userId) { + return res.status(401).json({ status: 'error', data: 'Unauthorized access.' }) + } + const { fullName, mobileNum, zipCode, streetAddress, city, state, country } = req.body + try { + const newAddress = await AddressModel.create({ + UserId: userId, + fullName, + mobileNum, + zipCode, + streetAddress, + city, + state, + country + }) + res.status(201).json({ status: 'success', data: newAddress }) + } catch (error) { + res.status(500).json({ status: 'error', data: 'Could not create address.' }) + } + } +} From 01fb769a60b90d8797cbb99c405af10acd14ddcf Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 15:40:08 +0400 Subject: [PATCH 10/13] fix: apply automated fixes for detected vulnerabilities --- lib/insecurity.ts | 2 +- routes/address.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/insecurity.ts b/lib/insecurity.ts index b2f58894..8e0f791b 100644 --- a/lib/insecurity.ts +++ b/lib/insecurity.ts @@ -188,7 +188,7 @@ export const appendUserId = () => { export const updateAuthenticatedUsers = () => (req: Request, res: Response, next: NextFunction) => { const token = req.cookies.token || utils.jwtFrom(req) if (token) { - jwt.verify(token, publicKey, { algorithms: ['RS256', 'HS256'] }, (err: Error | null, decoded: any) => { + jwt.verify(token, publicKey, { algorithms: ['RS256'] }, (err: Error | null, decoded: any) => { if (err === null) { if (authenticatedUsers.get(token) === undefined) { authenticatedUsers.put(token, decoded) diff --git a/routes/address.ts b/routes/address.ts index 9712ad44..ec595ed5 100644 --- a/routes/address.ts +++ b/routes/address.ts @@ -53,6 +53,9 @@ export function createAddress () { if (!userId) { return res.status(401).json({ status: 'error', data: 'Unauthorized access.' }) } + if (userId !== req.authenticatedUser.id) { // Ensure the user is authorized to create an address + return res.status(403).json({ status: 'error', data: 'Forbidden: You cannot create an address for another user.' }) + } const { fullName, mobileNum, zipCode, streetAddress, city, state, country } = req.body try { const newAddress = await AddressModel.create({ From 8073f18060197070bbd5b9db6da1d9c591819ace Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 15:55:54 +0400 Subject: [PATCH 11/13] fix: apply automated fixes for detected vulnerabilities --- routes/address.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/routes/address.ts b/routes/address.ts index ec595ed5..c61c71e5 100644 --- a/routes/address.ts +++ b/routes/address.ts @@ -12,6 +12,9 @@ export function getAddress () { if (!userId) { return res.status(401).json({ status: 'error', data: 'Unauthorized access.' }) } + if (userId !== req.authenticatedUser.id) { // Ensure the user is authorized to access addresses + return res.status(403).json({ status: 'error', data: 'Forbidden: You cannot access addresses for another user.' }) + } const addresses = await AddressModel.findAll({ where: { UserId: userId } }) res.status(200).json({ status: 'success', data: addresses }) } @@ -23,6 +26,9 @@ export function getAddressById () { if (!userId) { return res.status(401).json({ status: 'error', data: 'Unauthorized access.' }) } + if (userId !== req.authenticatedUser.id) { // Ensure the user is authorized to access this address + return res.status(403).json({ status: 'error', data: 'Forbidden: You cannot access this address.' }) + } const address = await AddressModel.findOne({ where: { id: req.params.id, UserId: userId } }) if (address != null) { res.status(200).json({ status: 'success', data: address }) @@ -38,6 +44,9 @@ export function delAddressById () { if (!userId) { return res.status(401).json({ status: 'error', data: 'Unauthorized access.' }) } + if (userId !== req.authenticatedUser.id) { // Ensure the user is authorized to delete this address + return res.status(403).json({ status: 'error', data: 'Forbidden: You cannot delete this address.' }) + } const address = await AddressModel.destroy({ where: { id: req.params.id, UserId: userId } }) if (address) { res.status(200).json({ status: 'success', data: 'Address deleted successfully.' }) From 56dc76bac393fc35fe9b4c6726936a5b21fb1e54 Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 16:11:45 +0400 Subject: [PATCH 12/13] fix: apply automated fixes for detected vulnerabilities --- routes/address.ts | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/routes/address.ts b/routes/address.ts index c61c71e5..48a5abbf 100644 --- a/routes/address.ts +++ b/routes/address.ts @@ -8,13 +8,7 @@ import { AddressModel } from '../models/address' export function getAddress () { return async (req: Request, res: Response) => { - const userId = req.body.UserId - if (!userId) { - return res.status(401).json({ status: 'error', data: 'Unauthorized access.' }) - } - if (userId !== req.authenticatedUser.id) { // Ensure the user is authorized to access addresses - return res.status(403).json({ status: 'error', data: 'Forbidden: You cannot access addresses for another user.' }) - } + const userId = req.authenticatedUser.id; // Use authenticated user ID const addresses = await AddressModel.findAll({ where: { UserId: userId } }) res.status(200).json({ status: 'success', data: addresses }) } @@ -22,13 +16,7 @@ export function getAddress () { export function getAddressById () { return async (req: Request, res: Response) => { - const userId = req.body.UserId - if (!userId) { - return res.status(401).json({ status: 'error', data: 'Unauthorized access.' }) - } - if (userId !== req.authenticatedUser.id) { // Ensure the user is authorized to access this address - return res.status(403).json({ status: 'error', data: 'Forbidden: You cannot access this address.' }) - } + const userId = req.authenticatedUser.id; // Use authenticated user ID const address = await AddressModel.findOne({ where: { id: req.params.id, UserId: userId } }) if (address != null) { res.status(200).json({ status: 'success', data: address }) @@ -40,13 +28,7 @@ export function getAddressById () { export function delAddressById () { return async (req: Request, res: Response) => { - const userId = req.body.UserId - if (!userId) { - return res.status(401).json({ status: 'error', data: 'Unauthorized access.' }) - } - if (userId !== req.authenticatedUser.id) { // Ensure the user is authorized to delete this address - return res.status(403).json({ status: 'error', data: 'Forbidden: You cannot delete this address.' }) - } + const userId = req.authenticatedUser.id; // Use authenticated user ID const address = await AddressModel.destroy({ where: { id: req.params.id, UserId: userId } }) if (address) { res.status(200).json({ status: 'success', data: 'Address deleted successfully.' }) @@ -58,13 +40,7 @@ export function delAddressById () { export function createAddress () { return async (req: Request, res: Response) => { - const userId = req.body.UserId - if (!userId) { - return res.status(401).json({ status: 'error', data: 'Unauthorized access.' }) - } - if (userId !== req.authenticatedUser.id) { // Ensure the user is authorized to create an address - return res.status(403).json({ status: 'error', data: 'Forbidden: You cannot create an address for another user.' }) - } + const userId = req.authenticatedUser.id; // Use authenticated user ID const { fullName, mobileNum, zipCode, streetAddress, city, state, country } = req.body try { const newAddress = await AddressModel.create({ From 230c52c2a48e4c0238cc98fd09b75b259ced6ad9 Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Mon, 4 Aug 2025 16:25:15 +0400 Subject: [PATCH 13/13] revert: restore original workflow files and remove temporary one --- .brightsec/tests/get-api-users-1.test.ts | 34 ---------- .../tests/get-rest-chatbot-status.test.ts | 35 ---------- .brightsec/tests/post-api-addresss.test.ts | 45 ------------- .../tests/post-rest-chatbot-respond.test.ts | 39 ----------- .github/workflows/bright.yml | 66 ------------------- 5 files changed, 219 deletions(-) delete mode 100644 .brightsec/tests/get-api-users-1.test.ts delete mode 100644 .brightsec/tests/get-rest-chatbot-status.test.ts delete mode 100644 .brightsec/tests/post-api-addresss.test.ts delete mode 100644 .brightsec/tests/post-rest-chatbot-respond.test.ts delete mode 100644 .github/workflows/bright.yml diff --git a/.brightsec/tests/get-api-users-1.test.ts b/.brightsec/tests/get-api-users-1.test.ts deleted file mode 100644 index 93bf1ee5..00000000 --- a/.brightsec/tests/get-api-users-1.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /api/users/1', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['jwt'], - attackParamLocations: [AttackParamLocation.PATH] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/api/Users/1`, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/get-rest-chatbot-status.test.ts b/.brightsec/tests/get-rest-chatbot-status.test.ts deleted file mode 100644 index 097f6d83..00000000 --- a/.brightsec/tests/get-rest-chatbot-status.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('GET /rest/chatbot/status', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['jwt'], - attackParamLocations: [AttackParamLocation.HEADER] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.GET, - url: `${baseUrl}/rest/chatbot/status`, - headers: { 'X-Recruiting': "We're hiring! Visit our careers page for more information." }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-api-addresss.test.ts b/.brightsec/tests/post-api-addresss.test.ts deleted file mode 100644 index 70885f25..00000000 --- a/.brightsec/tests/post-api-addresss.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /api/addresss', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['id_enumeration'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/api/Addresss`, - body: { - UserId: 1, - fullName: 'John Doe', - mobileNum: 1234567890, - zipCode: '12345', - streetAddress: '123 Main St', - city: 'Metropolis', - state: 'NY', - country: 'USA' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.brightsec/tests/post-rest-chatbot-respond.test.ts b/.brightsec/tests/post-rest-chatbot-respond.test.ts deleted file mode 100644 index 5a8ce3eb..00000000 --- a/.brightsec/tests/post-rest-chatbot-respond.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { test, before, after } from 'node:test'; -import { SecRunner } from '@sectester/runner'; -import { AttackParamLocation, HttpMethod } from '@sectester/scan'; - -const timeout = 40 * 60 * 1000; -const baseUrl = process.env.BRIGHT_TARGET_URL!; - -let runner!: SecRunner; - -before(async () => { - runner = new SecRunner({ - hostname: process.env.BRIGHT_HOSTNAME!, - projectId: process.env.BRIGHT_PROJECT_ID! - }); - - await runner.init(); -}); - -after(() => runner.clear()); - -test('POST /rest/chatbot/respond', { signal: AbortSignal.timeout(timeout) }, async () => { - await runner - .createScan({ - tests: ['jwt'], - attackParamLocations: [AttackParamLocation.BODY] - }) - .setFailFast(false) - .timeout(timeout) - .run({ - method: HttpMethod.POST, - url: `${baseUrl}/rest/chatbot/respond`, - body: { - action: 'query', - query: 'Hello, how are you?' - }, - headers: { 'Content-Type': 'application/json' }, - auth: process.env.BRIGHT_AUTH_ID - }); -}); diff --git a/.github/workflows/bright.yml b/.github/workflows/bright.yml deleted file mode 100644 index 6043b348..00000000 --- a/.github/workflows/bright.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Bright - -on: - pull_request: - branches: - - '**' - -permissions: - checks: write - contents: read - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Node.js 22.x - uses: actions/setup-node@v4 - with: - node-version: 22.x - - - name: Install application dependencies - run: | - npm install - - - name: Build Docker image and start application - run: | - docker build -t juice-shop . - docker run -d -p 3000:3000 --name juice-shop-container juice-shop - - - name: Wait for application to be ready - run: | - for i in {1..30}; do - nc -zv 127.0.0.1 3000 && echo "Application is ready" && exit 0 - echo "Waiting for application..." - sleep 5 - done - echo "Application did not start in time" && exit 1 - - - name: Set up Node.js latest - uses: actions/setup-node@v4 - with: - node-version: '>=22' - - - name: Install SecTesterJS dependencies - run: | - npm i --save=false --prefix .brightsec @sectester/core @sectester/repeater @sectester/scan @sectester/runner @sectester/reporter - - - name: Run security tests - env: - BRIGHT_HOSTNAME: ${{ vars.BRIGHT_HOSTNAME }} - BRIGHT_PROJECT_ID: ${{ vars.BRIGHT_PROJECT_ID }} - BRIGHT_AUTH_ID: ${{ vars.BRIGHT_AUTH_ID }} - BRIGHT_TOKEN: ${{ secrets.BRIGHT_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRIGHT_TARGET_URL: http://127.0.0.1:3000 - run: | - node --experimental-transform-types --experimental-strip-types --experimental-detect-module --disable-warning=MODULE_TYPELESS_PACKAGE_JSON --disable-warning=ExperimentalWarning --test-force-exit --test-concurrency=4 --test .brightsec/tests/*.test.ts - - - name: Stop and remove Docker container - if: always() - run: | - docker stop juice-shop-container - docker rm juice-shop-container