menzow / sn1per-docker

Dockerized version of Sn1per (https://github.com/1N3/Sn1per)
60 stars 30 forks source link

loot is not stored in mounted "loot" volume #4

Closed khast3x closed 5 years ago

khast3x commented 6 years ago

Hello,

It seems that sniper does not write to the described volume.

Reproduction

Possible hint: some tools report XDG_RUNTIME_DIR not being set ?

docker built -t sn1per .
docker run --rm -ti sn1per:latest sniper example.com
docker volume inspect loot
cd /var/lib/docker/volumes/loot/_data
ls -Rla
.:
total 40
drwxr-xr-x 9 root root 4096 Nov 23 01:39 .
drwxr-xr-x 3 root root 4096 Nov 23 01:39 ..
drwxr-xr-x 2 root root 4096 Nov 23 01:32 domains
drwxr-xr-x 2 root root 4096 Nov 23 01:32 nmap
drwxr-xr-x 2 root root 4096 Nov 23 01:32 osint
drwxr-xr-x 2 root root 4096 Nov 23 01:32 output
-rw-r--r-- 1 root root  113 Nov 23 01:32 README.md
drwxr-xr-x 2 root root 4096 Nov 23 01:32 reports
drwxr-xr-x 2 root root 4096 Nov 23 01:32 screenshots
drwxr-xr-x 2 root root 4096 Nov 23 01:37 {screenshots,nmap,domains,reports,imports,notes,web}

./domains:
total 8
drwxr-xr-x 2 root root 4096 Nov 23 01:32 .
drwxr-xr-x 9 root root 4096 Nov 23 01:39 ..

./nmap:
total 8
drwxr-xr-x 2 root root 4096 Nov 23 01:32 .
drwxr-xr-x 9 root root 4096 Nov 23 01:39 ..

./osint:
total 8
drwxr-xr-x 2 root root 4096 Nov 23 01:32 .
drwxr-xr-x 9 root root 4096 Nov 23 01:39 ..

./output:
total 8
drwxr-xr-x 2 root root 4096 Nov 23 01:32 .
drwxr-xr-x 9 root root 4096 Nov 23 01:39 ..

./reports:
total 8
drwxr-xr-x 2 root root 4096 Nov 23 01:32 .
drwxr-xr-x 9 root root 4096 Nov 23 01:39 ..

./screenshots:
total 8
drwxr-xr-x 2 root root 4096 Nov 23 01:32 .
drwxr-xr-x 9 root root 4096 Nov 23 01:39 ..

./{screenshots,nmap,domains,reports,imports,notes,web}:
total 8
drwxr-xr-x 2 root root 4096 Nov 23 01:37 .
drwxr-xr-x 9 root root 4096 Nov 23 01:39 ..
menzow commented 6 years ago

Hey @khast3x ,

Thanks for the report. I'm not sure that I understand the full scope of your issue. Based on your commands I'd say you're removing the volume after the container is done running. (--rm).

What you want to do is create a volume using docker volume create. Use this volume reference when running your image.

Your final commands should look something like this:

docker volume create sniper-volume
docker run --ti --rm -v --mount source=sniper-volume,target=/usr/share/sniper/loot sn1per-docker sniper example.com
docker volume inspect sniper-volume

(can't test right now, will update tomorrow)

There's various ways to achieve persistence with docker. This blog post contains a great overview: https://thenewstack.io/methods-dealing-container-storage/