Skip to content

Sometimes filter-condition doesn't work. #1519

Closed

Description

@ipsecc

Description

filter-condition has a bug, sometimes it doesn't work.

Scan target

└─# cat targets.txt 
lookup.api.bsb.baidu.com
openapi.baidu.com

Both expressions worked

└─# ./httpx -l targets.txt -fdc "contains(webserver,'Apache')||contains(title,'Welcome to nginx')"

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

                projectdiscovery.io

[INF] Current httpx version v1.3.7 (latest)
                                           

After reverse the expression, contains(webserver,'Apache') no longer works

└─# ./httpx -l targets.txt -fdc "contains(title,'Welcome to nginx')||contains(webserver,'Apache')"     

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

                projectdiscovery.io

[INF] Current httpx version v1.3.7 (latest)
https://openapi.baidu.com
                            

Activity

  1. added
    Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.
    on Jan 6, 2024
  2. self-assigned this
    on Jan 9, 2024
  3. RamanaReddy0M commented on Jan 9, 2024

    @RamanaReddy0M
    Contributor

    @ipsecc It fails due to a dsl evaluation error.
    you can enable dsl error logs by exporting SHOW_DSL_ERRORS env.

    ✗ export SHOW_DSL_ERRORS=true
    ✗ ./httpx -l targets.txt -fdc "contains(title,'Welcome to nginx')||contains(webserver,'Apache')"
    
        __    __  __       _  __
       / /_  / /_/ /_____ | |/ /
      / __ \/ __/ __/ __ \|   /
     / / / / /_/ /_/ /_/ /   |
    /_/ /_/\__/\__/ .___/_/|_|
                 /_/
    
                    projectdiscovery.io
    
    [INF] Current httpx version v1.3.7 (latest)
    [ERR] Could not evaluate DSL expression: No parameter 'title' found.
    https://openapi.baidu.com

    Since there's no title for https://openapi.baidu.com, The expression becomes invalid and fails to filter only this target.

    In the first case, The filter worked because it never got a chance to execute contains(title,'Welcome to nginx') part for this https://openapi.baidu.com target.

  4. added
    Type: QuestionA query or seeking clarification on parts of the spec. Probably doesn't need the attention of all.
    and removed
    Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.
    on Jan 9, 2024
  5. locked and limited conversation to collaborators on Jan 10, 2024
  6. converted this issue into a discussion #1530 on Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: QuestionA query or seeking clarification on parts of the spec. Probably doesn't need the attention of all.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions