2

For a given Windows release published by Microsoft, how can I cryptographically verify the authenticity and integrity of the .iso file that I downloaded before I copy it onto a USB drive and attempt to install it on my laptop?

Today I wanted to download Microsoft Windows 10, but the download page said nothing about how to cryptographically verify the integrity and authenticity of their release after download.

https://www.microsoft.com/en-us/software-download/windows10ISO

Note: I don't have Windows, and the page above will dynamically vary depending on if it detects you're running Windows or not. In my case, it instructs me to download the .iso from the following link because I'm running Linux

I expected to see a message on the download page telling me:

  1. The fingerprint of their PGP release signing key,
  2. A link to further documentation, and
  3. Links to [a] a manifest file (eg SHA256SUMS) and [b] a detached signature of that manifest file (eg SHA256SUMS.asc, SHA256SUMS.sig, SHA256SUMS.gpg, etc)

Unfortunately, the only information I found on the download page was how to verify the integrity of the image using a SHA256SUM found in a table on the same page. Obviously, this checks integrity but not authenticity. And it provides no security because it's not out-of-band from the .iso itself.

How can I preform cryptographic integrity and authenticity verification with Microsoft Windows .iso releases?

7
  • 2
    You don’t; Microsoft doesn’t publish a manifest information for ISO files. The Media Creation Tool would provide the necessary authenticity checks I would imagine since that’s written by Microsoft and distributed by Microsoft and you could verify the integrity of the file based on the hash of the executable itself
    – Ramhound
    Commented Feb 3, 2021 at 15:44
  • 1
    Please note that I do not yet have Windows, so I can't run the Media Creation Tool. Unless that tool is available for linux and it is signed? Commented Feb 3, 2021 at 16:25
  • 2
    @gregg: The question isn't about stopping anything bad coming from Microsoft; it's about making sure the ISO does in fact come from Microsoft (autenticity) and that it wasn't tampered with during the download (integrity). And Microsoft do always provide at least SHA-1 hashes for integrity-checking their provided ISO images, both on the public Windows 10 site and on the customer download (MSDN and VLCS) sites. Commented Feb 3, 2021 at 16:25
  • 2
    @user1686 By 'stop anything bad' I mean web server hacks, supply chain attacks, etc. I didn't mean BY Microsoft. Even if MS did everything they could I guess nothing stops a MiM or ISP attack during download so I do think its a valid concern as I said. You mention they have SHA1 hashs which is what the user wants, why didn't you link it?
    – gregg
    Commented Feb 3, 2021 at 17:25
  • 1
    @gregg: OP already mentioned that they're useless because they're on the same page as the download link. Commented Feb 3, 2021 at 19:12

2 Answers 2

2

The best way of verifying an ISO is to download it from Microsoft in the first place (twice if you want to be really sure, although that's somewhat too much).

Otherwise, you need to depend on the SHA1 hashes. Unfortunately, Microsoft has removed public access from the MSDN Subscriber Downloads area where it was possible in the past to look up SHA1 hashes.

If you don't know an MSDN Subscriber that can get for you the SHA1 hash, you need to depend on third-party websites that list these hashes for you. Below are two such websites:

Have also a look at the post ISO image integrity check.

4
  • Pitiful they locked/paywalled the hashes :( Guessing they were locking other content & overlooked that element
    – gregg
    Commented Feb 3, 2021 at 17:27
  • This answer does not provide any info about verifying authenticity or cryptographic integrity. The whole point of this question is to figure out how to make sure that my .iso did in-fact come from Microsoft. Also, SHA1 is not secure. I believe the checksums provided by Microsoft are SHA256 hashes. That gives you integrity, but not authenticity. Commented Feb 3, 2021 at 20:47
  • 2
    Excuse me, but if your disk is identical to the one from Microsoft, what do you care? Files don't come with attached history saying where they were originally. Don't you think your downvote was exaggerated?
    – harrymc
    Commented Feb 3, 2021 at 20:51
  • 2
    Has been stated Microsoft doesn’t provide a method to verify the authenticity of a Windows ISO.
    – Ramhound
    Commented Feb 3, 2021 at 22:58
0

Unfortunately, it is not possible to verify the authenticity of Windows .iso files because Microsoft does not sign their releases.

Besides opening a bug report with Microsoft, the best way to minimize the risk of obtaining a maliciously-altered copy of Windows is to obtain the .iso file via the 3TOFU harm-reduction process: download the file multiple times, from multiple networks (eg Tor, VPN, ISP), on multiple days. If the hash of all three downloads matches, then the file is trusted to be likely authentic.

⚠ NOTE: 3TOFU is a process in harm reduction.

It is dangerous to download software whose authenticity you cannot verify (using a cryptographic signature from a key stored offline). However, since Microsoft provides no means to verify their software cryptographically after download, using 3TOFU may reduce your risk.

Note also that verifying the .iso with the hashes provided by Microsoft provide no security, since they're obtained from the same place as the .iso. If an attacker modified the .iso that you're downloading, then it's trivial for them to modify the hash too.

3TOFU Process

To best mitigate targeted attacks, 3TOFU should be done:

  1. On three distinct days
  2. On three distinct machines (or VMs)
  3. Exiting from three distinct countries
  4. Exiting using three distinct networks

For example, I'll usually execute

  • TOFU #1/3 in TAILS (via Tor)
  • TOFU #2/3 in a Debian VM (via VPN)
  • TOFU #3/3 on my daily laptop (via ISP)

The possibility of an attacker maliciously modifying something you download over your ISP's network are quite high, depending on which country you live-in.

The possibility of an attacker maliciously modifying something you download onto a VM with a freshly installed OS over an encrypted VPN connection (routed internationally and exiting from another country) is much less likely, but still possible -- especially for a well-funded adversary.

The possibility of an attacker maliciously modifying something you download onto a VM running a hardened OS (like Whonix or TAILS) using a hardened browser (like Tor Browser) over an anonymizing network (like Tor) is quite unlikely.

The possibility for someone to execute a network attack on all three downloads is very near-zero -- especially if the downloads were spread-out over days or weeks. 3TOFU bash Script

For example, you can execute the following bash script for each 3TOFU of the Windows .iso file.

REMOTE_FILES="https://software-download.microsoft.com/db/Win10_20H2_v2_English_x64.iso?t=678f5b15-082a-4efb-8190-adc59cdcea87&e=1612452261&h=3ec44f5c20d933fbf28ffeea4fbfbe0a"

CURL="/usr/bin/curl"
WGET="/usr/bin/wget --retry-on-host-error --retry-connrefused"
PYTHON="/usr/bin/python3"

# in tails, we must torify
if [[ "`whoami`" == "amnesia" ]] ; then
    CURL="/usr/bin/torify ${CURL}"
    WGET="/usr/bin/torify ${WGET}"
    PYTHON="/usr/bin/torify ${PYTHON}"
fi

tmpDir=`mktemp -d`
pushd "${tmpDir}"

# first get some info about our internet connection
${CURL} -s https://ifconfig.co/country | head -n1
${CURL} -s https://check.torproject.org | grep Congratulations | head -n1

# and today's date
date -u +"%Y-%m-%d"

# get the file
for file in ${REMOTE_FILES}; do
    wget ${file}
done

# checksum
date -u +"%Y-%m-%d"
sha256sum *

Here's one example execution of the above script (on a debian DispVM, executed with a VPN).

/tmp/tmp.xT9HCeTY0y ~
Canada
2024-05-04
...
2024-05-04
b284afcc298cc6f5da6ab4d483318c453b2074485974b71b16fdfc7256527cb1  Win10_20H2_v2_English_x64.iso

The TOFU output above shows that the Windows .iso file has a sha256 hash of "b284afcc298cc6f5da6ab4d483318c453b2074485974b71b16fdfc7256527cb1".

When doing a 3TOFU, save the output of each execution. After collecting output from all 3 executions (intentionally spread-out over 3 days or more), diff the output.

If the output of all three TOFUs match, then the confidence of the file's authenticity is very high.

Attribution

The code snippet above was copied from the following website, licensed CC BY-SA.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .