Skip to content

Commit c561b19

Browse files
Add Docker containers for ILSpyCmd (interactive & automation scenarios)
1 parent 96cba4a commit c561b19

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0
2+
3+
RUN useradd -m -s /bin/bash ilspy
4+
USER ilspy
5+
6+
WORKDIR /home/ilspy
7+
8+
RUN dotnet tool install -g ilspycmd --version 9.1.0.7988
9+
10+
RUN echo 'export PATH="$PATH:/home/ilspy/.dotnet/tools/"' >> /home/ilspy/.bashrc
11+
12+
ENTRYPOINT [ "/bin/bash" ]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0
2+
3+
RUN useradd -m -s /bin/bash ilspy
4+
USER ilspy
5+
6+
WORKDIR /home/ilspy
7+
8+
RUN dotnet tool install -g ilspycmd --version 9.1.0.7988
9+
10+
RUN echo 'export PATH="$PATH:/home/ilspy/.dotnet/tools/"' >> /home/ilspy/.bashrc
11+
12+
ENTRYPOINT [ "/bin/bash", "-l", "-c" ]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ILSpyCmd in Docker
2+
3+
Inspired by https://trustedsec.com/blog/hunting-deserialization-vulnerabilities-with-claude (and thus https://github.com/berdav/ilspycmd-docker)
4+
5+
## Building the Image
6+
7+
There are two dockerfiles available - one for interactive use of ilspycmd (exploration), and the other for driving it from the outside (automation)
8+
9+
### Interactive
10+
11+
`docker build -t ilspycmd:91interactive . -f Dockerfile`
12+
13+
`docker run --rm -it -v ./:/docker ilspycmd:91interactive`
14+
15+
### Automation
16+
17+
`docker build -t ilspycmd:91forautomation . -f DockerfileForAutomation`
18+
19+
`docker run --rm -v ./:/infolder -v ./out:/outfolder ilspycmd:91forautomation "/home/ilspy/.dotnet/tools/ilspycmd -p -o /outfolder /infolder/sample.dll"`
20+

ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
<Authors>ILSpy Team</Authors>
2929
</PropertyGroup>
3030

31+
<ItemGroup>
32+
<Compile Remove="AsContainer\**" />
33+
<EmbeddedResource Remove="AsContainer\**" />
34+
<None Remove="AsContainer\**" />
35+
</ItemGroup>
36+
3137
<ItemGroup>
3238
<None Include="README.md" Pack="true" PackagePath="\" />
3339
</ItemGroup>

0 commit comments

Comments
 (0)