Skip to content

Commit

Permalink
Improve expr example
Browse files Browse the repository at this point in the history
  • Loading branch information
nikola-jokic committed Jun 25, 2024
1 parent 80523c2 commit 54bcdd5
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions content/1.workflows/1.syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,50 +112,59 @@ Expressions are to describe the scan that should run after some other scan has f
scans:
assetfinder:
on:
cron: 0 0 0/12 * * * # at 00:00 and at 12:00, run this scan
cron: 0 1 0/12 * * *
uploads:
- assetfinder.out # Specifies the file to be uploaded as a result for this scan
- output.txt
steps:
- run: assetfinder ${{ vars.DOMAIN }} > assetfinder.out
shell: bash
- run: assetfinder ${{ vars.DOMAIN }} > output.txt
shell: bash
- run: sort -o output.txt -u output.txt
shell: bash
subfinder:
on:
cron: 0 5 0/12 * * * # At 00:05 and 12:05, run this scan
cron: 0 15 0/12 * * *
uploads:
- subfinder.out
- output.txt
steps:
- run: subfinder -d ${{ vars.DOMAIN }} > subfinder.out
shell: bash
probe-subdomains:
- run: subfinder -d ${{ vars.DOMAIN }} > output.txt
shell: bash
- run: sort -o output.txt -u output.txt
shell: bash
probe:
on:
expr: |
size(scans.assetfinder) > 0
size(scans.assetfinder) > 0
&& size(scans.subfinder) > 0
&& scans.assetfinder[0].status == 'succeeded'
&& scans.subfinder[0].status == 'succeeded'
&& scans.subfinder[0].status == 'succeeded'
uploads:
- output.txt
steps:
# Prepare a list of subdomains
- run: |
mkdir assetfinder
cd assetfinder
bh job download -p ${{ project.id }} -w ${{ workflow.id }} -r ${{ revision.is }} -i ${{ scans.assetfiner[0].id }} -o output.zip
bh job download -p ${{ project.id }} -w ${{ workflow.id }} -r ${{ revision.id }} -i ${{ scans.assetfinder[0].id }} -o output.zip
unzip output.zip
rm output.zip
shell: bash
- run:
- run: |
mkdir subfinder
cd subfinder
bh job download -p ${{ project.id }} -w ${{ workflow.id }} -r ${{ revision.is }} -i ${{ scans.subfiner[0].id }} -o output.zip
bh job download -p ${{ project.id }} -w ${{ workflow.id }} -r ${{ revision.id }} -i ${{ scans.subfinder[0].id }} -o output.zip
unzip output.zip
rm output.zip
shell: bash
- run: |
cat assetfiner/assetfinder.out > subdomains.txt
cat assetfinder/assetfinder.out > subdomains.txt
cat subfinder/subfinder.out >> subdomains.txt
sort -o subdomains.txt -u subdomains.txt
shell: bash
# Run httprobe on unique subdomains
- run: cat subdomains.txt | httprobe
- run: cat subdomains.txt | httprobe > output.txt
shell: bash
- run: sort -o output.txt -u output.txt
shell: bash
```

Expand Down

0 comments on commit 54bcdd5

Please sign in to comment.