-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfuzzer.ps1
More file actions
42 lines (27 loc) · 1.09 KB
/
fuzzer.ps1
File metadata and controls
42 lines (27 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
param (
[string] $FileName = $( Read-Host "Enter path to fuzz:" ),
[Int32] $FuzzMax = 1000
)
Write-Host "`nBuilding dev binary"
Start-Process -FilePath "cargo.exe" -Wait -NoNewWindow -ArgumentList "build"
Write-Host "`nBuilding release binary"
Start-Process -FilePath "cargo.exe" -Wait -NoNewWindow -ArgumentList "build", "--release"
Write-Host "`nFuzzing...`n"
$StartTime = $(get-date)
$options = @{
PassThru = $true
NoNewWindow = $true
RedirectStandardError = "Errors.txt"
ErrorAction = "Stop"
}
for ($counter = 1; $counter -le $FuzzMax ; $counter += 1) {
Start-Process @options -FilePath "mscript.exe" -ArgumentList "run", "$FileName", "--quick" | Out-Null
Write-Host -NoNewline "`r$counter"
Start-Process @options -FilePath "cargo.exe" -ArgumentList "run", "--", "run", "$FileName", "--quick" | Out-Null
Write-Host -NoNewline "`r$counter"
if ($counter % 100 -eq 0) {
$elapsedTime = $(get-date) - $StartTime
$totalTime = "{0:HH:mm:ss}" -f ([datetime] $elapsedTime.Ticks)
Write-Host "`n[elapsed $totalTime] Progress Check: $($counter / $FuzzMax * 100)% ($counter/$FuzzMax)"
}
}