{"id":18715859,"url":"https://github.com/davidbuchanan314/pwn-mbr","last_synced_at":"2026-03-03T23:02:12.517Z","repository":{"id":49793158,"uuid":"69914503","full_name":"DavidBuchanan314/pwn-mbr","owner":"DavidBuchanan314","description":"A simple MBR hijack demonstration","archived":false,"fork":false,"pushed_at":"2022-10-22T17:20:33.000Z","size":932,"stargazers_count":181,"open_issues_count":0,"forks_count":38,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-01-21T05:43:21.056Z","etag":null,"topics":["bootloader","hooking","mbr"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavidBuchanan314.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-03T21:59:11.000Z","updated_at":"2026-01-18T14:45:03.000Z","dependencies_parsed_at":"2023-01-20T08:20:34.635Z","dependency_job_id":null,"html_url":"https://github.com/DavidBuchanan314/pwn-mbr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DavidBuchanan314/pwn-mbr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fpwn-mbr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fpwn-mbr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fpwn-mbr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fpwn-mbr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidBuchanan314","download_url":"https://codeload.github.com/DavidBuchanan314/pwn-mbr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fpwn-mbr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30064791,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootloader","hooking","mbr"],"created_at":"2024-11-07T13:10:30.032Z","updated_at":"2026-03-03T23:02:12.483Z","avatar_url":"https://github.com/DavidBuchanan314.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pwn-mbr\nA simple MBR hijack demonstration\n\n\n## Principles of operation:\n\n### Phase 1: Injection\n\n1. A malicious binary is run with root privileges.\n2. The original MBR is copied to the next \"free\" location (first sector found containing only zeroes) on the disk, before the first partition. A magic number is appended, so that it can be found later.\n3. The boot sector is overwritten with \"malicious\" code.\n\n### Phase 2: Execution\n\n1. Next time the machine is rebooted, the BIOS starts execution of the payload.\n2. In this example, the text \"MBR PWNED!\" is written to the screen a few hundred times.\n3. The payload locates the backup of the original boot sector (via the magic number) and copies it over to where it would normally reside in memory (`0x7C00`). However, this is where the payload is initially running from, so it copies itself elsewhere first.\n4. Finally, the payload jumps back to `0x7C00`, resuming normal boot operations.\n\n\n## Notes:\n\n- Only works on BIOS/legacy boot systems.\n- Although this demo doesn't do anything malicious, it is very possible that it corrupts your filesystem, so only run it on a dedicated VM unless you're very brave.\n\n\n## Demo:\n\n![Demo](https://github.com/DavidBuchanan314/pwn-mbr/raw/master/demo.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidbuchanan314%2Fpwn-mbr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidbuchanan314%2Fpwn-mbr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidbuchanan314%2Fpwn-mbr/lists"}