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

Accessing parent document properties on tags #85

Open
Regala opened this issue Oct 26, 2021 · 2 comments
Open

Accessing parent document properties on tags #85

Regala opened this issue Oct 26, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@Regala
Copy link

Regala commented Oct 26, 2021

When working with tags you are restricted to the ones of the document type you're querying, e.g. urls. However, there are many types where you'd want to work with the parent properties. e.g.

bbrf urls where program.disabled is false
or
bbrf urls where program.bounties is true

Let me know if this makes sense. Thanks!

@pdelteil
Copy link
Contributor

It's a good idea. By now I do it this way:

All urls from Bugcrowd programs
IFS=$'\n'; for i in $(bbrf programs where site is bugcrowd); do bbrf urls -p "$i" >> urls.bugcrowd.txt; done ;

Also this function to get urls from only disabled programs:

# getData only from disabled programs 
# Use getOnlyDisabledPrograms urls/domains
getOnlyDisabledPrograms()
{
    INPUT="$1" 
    COND="$2"
    if [ -z "$INPUT" ] 
    then
        echo "Use ${FUNCNAME[0]} urls/domains"
        return 1;
    fi
    IFS=$'\n'
    if [[  "$INPUT" != "urls"  &&  "$INPUT" != "domains" ]]
    then
        echo "Use ${FUNCNAME[0]} urls/domains"
        return 1;
    fi
    if [[  "$INPUT" == "urls" ]] | [[  "$INPUT" == "domains" ]]
    then
        all=$(bbrf programs --show-disabled $COND)
        enabled=$(bbrf programs $COND)
        listr=$(comm -3 <(echo "$enabled"|sort) <(echo "$all"|sort)|tr -d '\t')
    fi
    if [[  "$INPUT" == "urls" ]] 
    then
        for program in $(echo "$listr");
        do 
            bbrf urls -p "$program"
        done

    fi
    if [[  "$INPUT" == "domains" ]] 
    then
        for program in $(echo "$listr");
        do 
            bbrf domains -p "$program"
        done
    fi

}

I have written from functions to use BBRF in a more flexible way.

https://github.com/pdelteil/BugBountyHuntingScripts/blob/main/bbrf_helper.sh

@Regala
Copy link
Author

Regala commented Oct 26, 2021 via email

@honoki honoki changed the title [Feature Request] Accessing parent document properties on tags Accessing parent document properties on tags Jan 2, 2022
@honoki honoki added the enhancement New feature or request label Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants