Skip to content

This is a script to host a HTTP server under UEFI for remote testing purpose.

Notifications You must be signed in to change notification settings

nikeasyanzi/http_uefi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP-UEFI

This is a Python script to host an HTTP server under UEFI for remote testing purposes.

It is built against Python 3.6.8 provided on EDK II.

It supports operations such as file upload, test utility run, and log read to facilitate the testing process.

Need to know before using it

Manual run

  • Due to the limitation of the UEFI environment,

    • Once the server is up and running, the user can only interact with UEFI from HTTP, and UEFI shell interface is override.

    • The HTTP server communication is synchronous.

    • There is no I/O redirection. The EFI utilities must output test logs on the UEFI filesystem for later read commands to access the test result.

  • Security The communication protocol is HTTP not HTTPS and no authentication is implemented. That makes it vulnerable to man-in-the-middle attacks, so PLEASE stop the service once your task is completed

  • It only accepts operations for testing purposes and I have no plan to support UEFI shell commands embedded in HTTP requests at this point.

Auto run the HTTP server when enter UEFI

  • Work with the startup.nsh, we can make UEFI to execute the HTTP binary once it enters the shell envoriment.
  • If you want to stop the HTTP server and return the shell environment, please emit exit command to the HTTP server

How to use

Files

  • http_uefi.py

    socurce file to host a http server on UEFI

  • install_python_env.nsh

    installation file to install Python environment on UEFI

  • startup.nsh

    start up file to auto-run the HTTP server when the server boots up

  • curl_test.sh

    A simple example demonstrating how to write up your test suit logic

  • misc

    others....

Operation supported and Usage

Assume we set TARGETURL=http://192.168.100.108:8080. The following commands demonstrate a simple test scenario from a test utility upload to the test result retrieval.

  • Upload where it creates an uploads folder automatically and place the uploaded files

    curl -X POST -H "Content-Type: multipart/form-data" -F "file=@my_wake_test.efi" ${TARGETURL}

  • List list dir with the custom path

    curl -H "Content-Type: application/json" -X POST --data '{"operation":"listdir","path":"FS0:\uploads"}' ${TARGETURLi}/listdir

    curl ${TARGETURL}/getfilelist

  • Run run the efi test utility

    curl ${TARGETURL}/run/my_wake_test.efi

  • ReadLog with the customized path

    curl -H "Content-Type: application/json" -X POST --data '{path":"FS0:\efi\tools\my_wake_test.LOG"}' ${TARGETURL}/readlog

  • Exit the HTTP server and return ownership to UEFI Shell

    curl ${TARGETURL}/byehttpuefi

About

This is a script to host a HTTP server under UEFI for remote testing purpose.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published