Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nettverk-oving5-fuzzing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ask Brandsnes Røsand
nettverk-oving5-fuzzing
Commits
b63f73e4
Commit
b63f73e4
authored
2 years ago
by
Ask Brandsnes Røsand
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
6f495d5c
No related branches found
No related tags found
No related merge requests found
Pipeline
#186367
passed
2 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+21
-20
21 additions, 20 deletions
README.md
with
21 additions
and
20 deletions
README.md
+
21
−
20
View file @
b63f73e4
#
Fuzzing example
#
Øving 5
## Prerequisites
Gitlab link til prosjektet: https://gitlab.stud.idi.ntnu.no/askbr/nettverk-oving5-fuzzing
-
Linux (preferably Arch Linux or an Arch Linux based distribution such as Manjaro) or MacOS
*Note: prosjektet er basert på eksempelet https://gitlab.com/ntnu-tdat3020/fuzzing-example*
##
Instructions using [juCi++](https://gitlab.com/cppit/jucipp)
##
Feil oppdaget
1.
Clone this repository
### Address Sanitizer
2.
Run juCi++ with the following arguments from a terminal:
-
Linux:
`CC=clang juci fuzzing-example`
-
MacOS:
`CC=/opt/homebrew/opt/llvm/bin/clang juci fuzzing-example`
3.
Open
`tests/utility_fuzzer_test.c`
and run using either:
-
Compile and Run in the Project menu
-
Start/Continue in the Debug menu
## Instructions using a terminal on Linux
Address sanitizer oppdaget en feil i funksjonen fra øving 4:
**"heap-buffer-overflow"**
.
```
sh
Denne ble fikset ved å legge til
`\0`
på slutten av en string, noe jeg hadde glemt.
git clone https://gitlab.com/ntnu-tdat3020/fuzzing-example
mkdir
fuzzing-example/build
### Fuzzing
cd
fuzzing-example/build
CC
=
clang cmake ..
En feil funnet i funksjonen fra øving 4 (spesifikt
`char* f(char* s, int n)`
i utility.h) gjennom fuzzing var
**"memory leak"**
.
make
./tests/utility_fuzzer_test
-max_total_time
=
60
# Cancel fuzzing after 60 seconds
Denne ble fikset ved å istedenfor å opprette stringen som returneres fra funksjonen på heap allokeres den på stack.
```
Altså
`char ret[n];`
framfor
`char* ret = malloc(n);`
.
## CI
Siste kjøring av CI kan finnes gjennom lenken:
https://gitlab.stud.idi.ntnu.no/askbr/nettverk-oving5-fuzzing/-/pipelines/186364
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment