Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce self-contained to headless #4322

Merged
merged 2 commits into from
Nov 2, 2023
Merged

Conversation

dogancanbakir
Copy link
Member

@dogancanbakir dogancanbakir commented Nov 1, 2023

Proposed changes

$ cat test.yaml 
id: piratebay

info:
  name: piratebay
  author: philippedelteil
  severity: info

self-contained: true

headless:
  - steps:
      - args:
          url: 'https://thepiratebay.org/search.php?q=user:{{user}}'
        action: navigate

      - action: waitload
    matchers:
      - type: dsl
        dsl:
          - "!contains(data,'No results returned')"

$ go run . -t test.yaml -headless -var user=zheega

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.0.2

                projectdiscovery.io

[INF] Current nuclei version: v3.0.2 (latest)
[INF] Current nuclei-templates version: v9.6.8 (latest)
[INF] New templates added in latest release: 79
[INF] Templates loaded for current scan: 1
[WRN] Executing 1 unsigned templates. Use with caution.
[piratebay] [headless] [info] https://thepiratebay.org

Closes #4057.

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@dogancanbakir dogancanbakir self-assigned this Nov 1, 2023
@dogancanbakir dogancanbakir linked an issue Nov 1, 2023 that may be closed by this pull request
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - I noticed in the matcher we return only the base url instead of the full one (I changed the url to http://localhost:8000 with simplehttpserver)

With self-contained:

$ go run . -t test.yaml -headless -var user=zheega
...
[piratebay] [headless] [info] http://localhost:8000

Without:

$ go run . -t test.yaml -headless -var user=zheega -u "http://localhost:8000/search.php?q=user:{{user}}"
...
[piratebay] [headless] [info] http://localhost:8000/search.php?q=user:{{user}}

@dogancanbakir
Copy link
Member Author

Fixed:

$ go run . -t test.yaml -headless -var user=zheega

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.0.2

                projectdiscovery.io

[INF] Current nuclei version: v3.0.2 (latest)
[INF] Current nuclei-templates version: v9.6.8 (latest)
[INF] New templates added in latest release: 79
[INF] Templates loaded for current scan: 1
[WRN] Executing 1 unsigned templates. Use with caution.
[piratebay] [headless] [info] https://thepiratebay.org/search.php?q=user:zheega

@ehsandeep ehsandeep merged commit 83abe09 into dev Nov 2, 2023
10 of 12 checks passed
@ehsandeep ehsandeep deleted the introduce_headless_selfcontained branch November 2, 2023 13:38
olearycrew pushed a commit to olearycrew/nuclei that referenced this pull request Nov 3, 2023
* introduce `self-contained` to headless

* fix matched url print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support self-contained flag using headless request
3 participants