GitHub - Mockapapella/mov-http-server: This repo implements an http server using only MOV instructions

2 min read Original article ↗

M/o/Vfuscator HTTP Server

This repo builds an i386 ELF HTTP server where the code generated from server_mov_compatible.c is mov-only (verified by make check-mov-bin / make check-mov-o).

Setup

  1. Install dependencies:
sudo apt update
sudo apt install build-essential git bison flex libgmp3-dev libmpfr-dev libmpc-dev texinfo
  1. Build the compiler (vendored in movfuscator/):
cd movfuscator
./build.sh
  1. Compile the server (low priority / single core friendly):
  1. Run the server:
  1. Test it:
curl http://localhost:8080/

You should see: <html>hello, world</html>

Verify mov-only disassembly

Check the built binary (.text section):

Check the object file (.text section):

If you want to see all instructions (including the non-mov bootstrap), use:

objdump -D -Mintel server_mov_compatible

Technical Details

server_mov_compatible.c is intentionally freestanding (no libc headers) to keep movcc happy: it declares only the minimal types, socket structs/constants, and syscall wrappers it needs.

Troubleshooting

If the server won't start:

  1. Check if port 8080 is free:
    • Use sudo lsof -i -P -n | grep LISTEN to see if another service is using the port.
  2. Try a different port:
    • Edit #define PORT 8080 in server_mov_compatible.c, rebuild, and run again.
  3. Verify localhost configuration:
    • Ensure that localhost or 127.0.0.1 is properly set up in your /etc/hosts file.
  4. Check firewall settings:
    • Your firewall might be blocking connections to the port. Adjust the settings accordingly.

If compilation fails:

  1. Verify movcc path:
    • Ensure you are using the correct path to movcc: movfuscator/build/movcc.
  2. Ensure all dependencies are installed:
    • Revisit the installation step for dependencies to confirm everything is installed.
  3. Avoid external headers:
    • Do not include additional headers that may introduce incompatibilities.

Additional Notes

make build invokes movcc via scripts/lowprio.sh (nice + ionice + optional CPU pinning) to reduce impact while you have other stuff running.

Credit

Huge credit to both Bruins Slot for his tutorial on implementing an http server from scratch and Christopher Domas who created the original movfuscator.