learning-it by example

Back to the video

Air-Gapped Python Install: Offline Wheels and Hashes

A swapped package installed with no error. With hash checking on, it was refused.

Video #312 ยท Forward deployed engineer interviews

Steps in the video

  1. 0:00 A swapped file installed without a single error, until I checked the hash
  2. 0:32 The idea
  3. 1:10 Setup
  4. 1:42 The wheelhouse
  5. 2:05 The attack
  6. 2:27 Install with no network
  7. 2:50 Four installs
  8. 3:41 What this does not show
  9. 4:12 Mistakes to avoid
  10. 4:42 My take and next steps
  11. 5:09 Recap

Files

  • install.py (32 lines)
  • run.py (38 lines)
  • wheelhouse.py (37 lines)

Download the code (zip)

Tested with

Python 3.12.15 | pip==26.2.2

What this does not show

A simulated air gap (pip settings and a dead proxy; the proxy is never reached in this run), one small package with no dependencies, one laptop. The download step needs internet. Hash checking shows a file is the one you downloaded, not that it is safe.

Sources

Learning IT by Example.