-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from codeFather2/alex-fixes-1
add fixes from meeting
- Loading branch information
Showing
6 changed files
with
103 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Test Case - DotNet App | ||
|
||
on: | ||
# push: | ||
workflow_dispatch: | ||
|
||
env: | ||
#### SHOULD RUN IN DEBUG MODE FOR BETTER OUTPUT | ||
# nightvision app create -n dvcsa | ||
# nightvision target create -n dvcsa -u http://localhost:8999 --type api | ||
# nightvision swagger extract ./ -t dvcsa --lang dotnet | ||
# nightvision scan -t dvcsa -a dvcsa | ||
NIGHTVISION_TOKEN: ${{ secrets.NIGHTVISION_TOKEN }} | ||
NIGHTVISION_TARGET: dvcsa | ||
NIGHTVISION_APP: dvcsa | ||
|
||
jobs: | ||
test: | ||
permissions: | ||
security-events: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: (1) Clone Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: (2) Install NightVision | ||
run: | | ||
wget -c https://downloads.nightvision.net/binaries/latest/nightvision_latest_linux_amd64.tar.gz -O - \ | ||
| tar -xz; sudo mv nightvision /usr/local/bin/ | ||
- name: (3) Extract API documentation from code | ||
run: nightvision swagger extract ./ -t ${NIGHTVISION_TARGET} --lang dotnet | ||
|
||
- name: (4) Start the app | ||
run: docker-compose up -d; sleep 10 | ||
|
||
- name: (5) Scan the API | ||
run: | | ||
nightvision scan -t ${NIGHTVISION_TARGET} -a ${NIGHTVISION_APP} > scan-results.txt | ||
nightvision export sarif -s "$(head -n 1 scan-results.txt)" --swagger-file openapi-spec.yml | ||
- name: (5.5) Upload sarif documentation artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: results.sarif | ||
path: results.sarif | ||
retention-days: 30 | ||
|
||
- name: (6) Upload SARIF file to GitHub Security Alerts if vulnerabilities are found | ||
uses: github/codeql-action/upload-sarif@v2 | ||
if: success() | ||
with: | ||
sarif_file: results.sarif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
echo "===========================================" | ||
echo "SQL INJECTION" | ||
echo "http://127.0.0.1:8999/Users?name='%20OR%20'1'='1" | ||
echo | ||
curl "http://127.0.0.1:8999/Users?name='%20OR%20'1'='1" | ||
echo | ||
echo "===========================================" | ||
echo "Laravel - Sensitive Information Disclosure" | ||
echo 'curl http://127.0.0.1:8999/.env' | ||
echo | ||
curl "http://127.0.0.1:8999/.env" | ||
echo "===========================================" | ||
echo "XSS REFLECTION" | ||
echo "http://127.0.0.1:8999/Users/search?name=<script>alert()</script>" | ||
echo | ||
curl "http://127.0.0.1:8999/Users/search?name=<script>alert()</script>" | ||
echo | ||
read | ||
open -a Google\ Chrome "http://127.0.0.1:8999/.env" & | ||
open -a Google\ Chrome "http://127.0.0.1:8999/Users?name='%20OR%20'1'='1" & | ||
open -a Google\ Chrome "http://127.0.0.1:8999/Users/search?name=<script>alert()</script>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters