Accessing parent document properties on tags
Regala opened this issue · comments
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!
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