Browse Source

Add Docker containers for ILSpyCmd (interactive & automation scenarios)

pull/3511/head
Christoph Wille 2 weeks ago
parent
commit
c561b197a4
  1. 12
      ICSharpCode.ILSpyCmd/AsContainer/Dockerfile
  2. 12
      ICSharpCode.ILSpyCmd/AsContainer/DockerfileForAutomation
  3. 20
      ICSharpCode.ILSpyCmd/AsContainer/README.md
  4. 6
      ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj

12
ICSharpCode.ILSpyCmd/AsContainer/Dockerfile

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0
RUN useradd -m -s /bin/bash ilspy
USER ilspy
WORKDIR /home/ilspy
RUN dotnet tool install -g ilspycmd --version 9.1.0.7988
RUN echo 'export PATH="$PATH:/home/ilspy/.dotnet/tools/"' >> /home/ilspy/.bashrc
ENTRYPOINT [ "/bin/bash" ]

12
ICSharpCode.ILSpyCmd/AsContainer/DockerfileForAutomation

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0
RUN useradd -m -s /bin/bash ilspy
USER ilspy
WORKDIR /home/ilspy
RUN dotnet tool install -g ilspycmd --version 9.1.0.7988
RUN echo 'export PATH="$PATH:/home/ilspy/.dotnet/tools/"' >> /home/ilspy/.bashrc
ENTRYPOINT [ "/bin/bash", "-l", "-c" ]

20
ICSharpCode.ILSpyCmd/AsContainer/README.md

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
# ILSpyCmd in Docker
Inspired by https://trustedsec.com/blog/hunting-deserialization-vulnerabilities-with-claude (and thus https://github.com/berdav/ilspycmd-docker)
## Building the Image
There are two dockerfiles available - one for interactive use of ilspycmd (exploration), and the other for driving it from the outside (automation)
### Interactive
`docker build -t ilspycmd:91interactive . -f Dockerfile`
`docker run --rm -it -v ./:/docker ilspycmd:91interactive`
### Automation
`docker build -t ilspycmd:91forautomation . -f DockerfileForAutomation`
`docker run --rm -v ./:/infolder -v ./out:/outfolder ilspycmd:91forautomation "/home/ilspy/.dotnet/tools/ilspycmd -p -o /outfolder /infolder/sample.dll"`

6
ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj

@ -28,6 +28,12 @@ @@ -28,6 +28,12 @@
<Authors>ILSpy Team</Authors>
</PropertyGroup>
<ItemGroup>
<Compile Remove="AsContainer\**" />
<EmbeddedResource Remove="AsContainer\**" />
<None Remove="AsContainer\**" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

Loading…
Cancel
Save