Comments (5)
I found out that instrumenting bin/Debug/net6.0/Jil.dll
solves the issue.
Instrumenting ./jil.2.16.0/lib/netstandard2.0/Jil.dll
, putting it to the root of the project and adding <ItemGroup>...</ItemGroup>
doesn't work in my case.
dotnet build
downloads fresh dll to bin/Debug/net6.0/Jil.dll
.
from sharpfuzz.
Did you see the part in https://github.com/Metalnem/sharpfuzz#installation about patching afl-fuzz
?
I use export AFL_SKIP_BIN_CHECK=1
from sharpfuzz.
Did you see the part in https://github.com/Metalnem/sharpfuzz#installation about patching
afl-fuzz
?I use
export AFL_SKIP_BIN_CHECK=1
Hello! Yes, I followed the instruction and patched AFL.
export AFL_SKIP_BIN_CHECK=1
didn't help.
from sharpfuzz.
Here is my container:
FROM ubuntu:22.04
RUN apt update && apt dist-upgrade -y
RUN DEBIAN_FRONTEND="noninteractive" apt -y install \
build-essential \
clang \
git \
libtool \
m4 \
cmake \
automake \
llvm \
gcc-9-plugin-dev \
golang \
python3-pip
# sharpfuzz
RUN apt install -y \
dotnet6 \
unzip \
wget && \
cd /opt && \
wget http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz && \
tar -xvf afl-latest.tgz && \
rm afl-latest.tgz && \
cd afl-2.52b && \
wget https://github.com/Metalnem/sharpfuzz/raw/master/patches/RemoveInstrumentationCheck.diff && \
patch < RemoveInstrumentationCheck.diff && \
make install && \
cd .. && rm -rf afl-2.52b/ && \
dotnet tool install --global SharpFuzz.CommandLine
ENV PATH=$PATH:/root/.dotnet/tools
ENV JIL_ZIP=jil.2.16.0.zip
ENV JIL_DLL=jil.2.16.0/lib/netstandard2.0/Jil.dll
RUN cd /opt && \
mkdir json-example && \
cd json-example && \
wget -O $JIL_ZIP https://www.nuget.org/api/v2/package/Jil/2.16.0 && \
unzip $JIL_ZIP -d jil.2.16.0 && \
sharpfuzz jil.2.16.0/lib/netstandard2.0/Jil.dll && \
cp $JIL_DLL . && \
dotnet new console
WORKDIR /opt/json-example
RUN echo 'using System;\n\
using System.IO;\n\
using SharpFuzz;\n\
namespace Jil.Fuzz\n\
{\n\
public class Program\n\
{\n\
public static void Main(string[] args)\n\
{\n\
Fuzzer.Run(stream =>\n\
{\n\
try\n\
{\n\
using (var reader = new StreamReader(stream))\n\
{\n\
JSON.DeserializeDynamic(reader);\n\
}\n\
}\n\
catch (DeserializationException) { }\n\
});\n\
}\n\
}\n\
}' > Program.cs
RUN echo '<Project Sdk="Microsoft.NET.Sdk">\n\
<PropertyGroup>\n\
<OutputType>Exe</OutputType>\n\
<TargetFramework>net6.0</TargetFramework>\n\
<ImplicitUsings>enable</ImplicitUsings>\n\
<Nullable>enable</Nullable>\n\
</PropertyGroup>\n\
<ItemGroup>\n\
<Reference Include="Jil">\n\
<HintPath>Jil.dll</HintPath>\n\
</Reference>\n\
</ItemGroup>\n\
</Project>' > json-example.csproj
RUN dotnet add package Sigil --version 4.7.0 && \
dotnet add package SharpFuzz && \
dotnet build
CMD mkdir -p corpus && \
echo '{"a": 123}' > corpus/123 && \
AFL_SKIP_BIN_CHECK=1 \
afl-fuzz \
-i corpus \
-o findings \
-t 5000 \
-m 10000 \
dotnet bin/Debug/net6.0/json-example.dll
To launch:
$ docker build -t sharp .
$ echo core | sudo tee /proc/sys/kernel/core_pattern
$ echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
$ docker run sharp
afl-fuzz 2.52b by <[email protected]>
[+] Looks like we're not running on a tty, so I'll be a bit less verbose.
[+] You have 12 CPU cores and 2 runnable tasks (utilization: 17%).
[+] Try parallel jobs - see /usr/local/share/doc/afl/parallel_fuzzing.txt.
[*] Checking CPU core loadout...
[+] Found a free CPU core, binding to #0.
[*] Checking core_pattern...
[*] Checking CPU scaling governor...
[*] Setting up output directories...
[*] Scanning 'corpus'...
[+] No auto-generated dictionary tokens to reuse.
[*] Creating hard links for all input files...
[*] Validating target binary...
[*] Attempting dry run with 'id:000000,orig:123'...
[*] Spinning up the fork server...
[+] All right - fork server is up.
[-] PROGRAM ABORT : No instrumentation detected
Location : perform_dry_run(), afl-fuzz.c:2860
from sharpfuzz.
I "solved" that by running sharpfuzz
as part of the building process by adding this target to the csproj
file.
<Target Name="Fuzz" AfterTargets="build">
<Message Text="sharpfuzz $(OutDir)Jil.dll" Importance="high" />
<Exec Command="sharpfuzz $(OutDir)Jil.dll" />
</Target>
from sharpfuzz.
Related Issues (20)
- afl-showmap - No instrumentation detected HOT 3
- Run sharpfuzz with function contained yield return failed HOT 1
- Use AFL++ instead of AFL HOT 1
- Timeout proccesing HOT 4
- Windows support HOT 5
- Publish new release with LibFuzzer updates HOT 1
- Question about excuting action sharpfuzz/src/SharpFuzz/Fuzzer.LibFuzzer.cs HOT 1
- Question regarding plans for SharpFuzz with libFuzzer on macOS HOT 2
- Test .net Application Console program HOT 1
- Parallel fuzzing with libfuzzer on windows
- Fork server handshake failed HOT 3
- AccessViolationException in class constructors HOT 3
- document hidden env variables and features HOT 3
- After installing sharpfuzz: "sharpfuzz: command not found"
- AFL failed to run: "No instrumentation detected" HOT 3
- Fuzzer hangs without logs.
- I'm curious about how SharpFuzz measures coverage HOT 1
- "Error Calculating Max stack value."
- How to instrument native C++ code to fuzz with Sharpfuzz HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharpfuzz.