-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fixed deprecated packages + GitHub action for script testing
- Loading branch information
1 parent
adbbaeb
commit 8133854
Showing
3 changed files
with
88 additions
and
12 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,56 @@ | ||
name: Docker Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build Docker image | ||
run: docker build -t cve-testing . | ||
|
||
- name: Run Docker container | ||
run: docker run --name cve-testing-container -d -p 8000:8000 cve-testing | ||
|
||
- name: Install Python dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Test Python script | ||
id: test_script | ||
run: | | ||
python3 CVE-2021-3129.py --host=127.0.0.1:8000 --force --chain laravel/rce12 --exec pwd > output.log | ||
cat output.log | ||
continue-on-error: true | ||
|
||
- name: Check Test Output | ||
if: steps.test_script.outcome == 'success' | ||
run: | | ||
if grep -q '/src/laravel/public' output.log; then | ||
echo "Test passed" | ||
else | ||
echo "Test failed" | ||
exit 1 | ||
fi | ||
- name: Stop and remove container | ||
if: always() | ||
run: | | ||
docker stop cve-testing-container | ||
docker rm cve-testing-container |
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 |
---|---|---|
@@ -1 +1,6 @@ | ||
requests~=2.27.1 | ||
certifi==2024.7.4 | ||
charset-normalizer==3.3.2 | ||
idna==3.7 | ||
packaging==24.1 | ||
requests==2.32.3 | ||
urllib3==2.2.2 |