1How to Mount ISO Files for Scanning
2===================================
3
4Dependency-Check can be used as one of your tools for vetting software
5distributed via an [ISO image](https://en.wikipedia.org/wiki/ISO_image). (See
6[File Type Analyzers](../analyzers/) for a list of what types of artifacts
7Dependency-Check is capable of scanning.) These disk image files are not a standard archive format, however. Tools must be used that can interpret the contained file system. As will be shown below, Linux, Mac OS X, and recent versions of Windows can be used to mount the image's file system, which can
8then be scanned by Dependency-Check.
9
10ISO images are named for the fact that they nearly always contain one of a
11pair of international file system standards published by
12[ISO](http://www.iso.org/): [ISO 9660](https://en.wikipedia.org/wiki/ISO_9660)
13and ISO/IEC 13346, a.k.a. [UDF](https://en.wikipedia.org/wiki/Universal_Disk_Format). Other types of disk images (e.g.,
14[VHD](https://en.wikipedia.org/wiki/VHD_%28file_format%29)) are outside the
15scope of this article, though the ideas presented here may likely be
16successfully applied.
17
18Linux
19-----
20
21Assume you've downloaded an ISO image called `foo.iso`, and you want to mount
22it at /mnt/foo. (Why /mnt? See the
23[Filesystem Hierarchy Standard](http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s12.html).)
24First make sure that the mount point exists using `mkdir /mnt/foo`. Then, the
25[mount](http://linux.die.net/man/8/mount) command *must be run with root
26privileges*. On Debian and Ubuntu Linux, this is accomplished by prefacing the
27command with `sudo`.
28
29```sh
30$ sudo mount -o loop foo.iso /mnt/foo
31```
32
33Next, you can use Dependency-Check's [command line tool](dependency-check-cli/)
34to scan the mount point. When you are finished, run the
35[umount](http://linux.die.net/man/8/umount) command with root privileges:
36
37```sh
38$ sudo umount -d /mnt/foo
39```
40
41This will unmount the file system, and detach the loop device.
42
43Mac OS X
44--------
45
46### Using the GUI
47
48Simply double-click on the image file in Mac OS X Finder.
49
50### Using a Terminal Window
51
52Use the [hdiutil](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/hdiutil.1.html)
53command.
54
55```sh
56$ hdiutil attach foo.iso
57```
58
59The output will show the `/dev` entry assigned as well as the mount point,
60which is where you may now read the files in the image's file system.
61
62To detach:
63
64```sh
65$ hdiutil detach foo.iso
66```
67
68Windows
69-------
70
71Windows 8 and later versions support mounting ISO images as a virtual drive.
72
73### Using the GUI
74
751. In *File Explorer*, right-click on "foo.iso".
762. Select "Mount"
77
78File Explorer then redirects to showing the files on your virtual drive. You can then use the [command line tool](dependency-check-cli/) to scan the
79virtual drive. When finished, "Windows-E" will open File Explorer showing the various drives on your computer. To eject the virtual drive:
80
811. Right-click on the virtual drive.
822. Select "Eject"
83
84### Using PowerShell
85
86To mount, use the [Mount-DiskImage](https://technet.microsoft.com/en-us/%5Clibrary/Hh848706%28v=WPS.630%29.aspx)
87cmdlet:
88
89```posh
90$ Mount-DiskImage -ImagePath C:\Full\Path\to\foo.iso
91```
92
93To view all drives (and find your virtual drive), use the
94[Get-PSDrive](https://technet.microsoft.com/en-us/library/Hh849796.aspx)
95cmdlet:
96
97```posh
98$ Get-PSDrive -PSProvider 'FileSystem'
99```
100
101To dismount, use the [Dismount-DiskImage](https://technet.microsoft.com/en-us/library/hh848693%28v=wps.630%29.aspx)
102cmdlet:
103
104```posh
105$ Dismount-DiskImage -ImagePath C:\Full\Path\to\file.iso
106```
107
108### Windows 7
109
110Third-party tools exist that can be used to mount ISO images. Without such
111tools, it is still possible to burn the ISO image to physical media, and scan
112the media:
113
1141. Right-click on "foo.iso"
1152. Select "Windows Disc Image Burner"
1163. Follow the instructions to burn the image.
117
118### Windows Vista
119
120Just as with Windows 7, you will need a third-party tool to mount an ISO
121image. You will also need a third-party tool to burn the image to media.
122Many machines are shipped with such a tool included.