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
- Install dependencies:
sudo apt update sudo apt install build-essential git bison flex libgmp3-dev libmpfr-dev libmpc-dev texinfo
- Build the compiler (vendored in
movfuscator/):
cd movfuscator
./build.sh- Compile the server (low priority / single core friendly):
- Run the server:
- 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:
- Check if port 8080 is free:
- Use
sudo lsof -i -P -n | grep LISTENto see if another service is using the port.
- Use
- Try a different port:
- Edit
#define PORT 8080inserver_mov_compatible.c, rebuild, and run again.
- Edit
- Verify localhost configuration:
- Ensure that localhost or 127.0.0.1 is properly set up in your /etc/hosts file.
- Check firewall settings:
- Your firewall might be blocking connections to the port. Adjust the settings accordingly.
If compilation fails:
- Verify movcc path:
- Ensure you are using the correct path to movcc: movfuscator/build/movcc.
- Ensure all dependencies are installed:
- Revisit the installation step for dependencies to confirm everything is installed.
- 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.