diff --git a/README b/README deleted file mode 100644 index e4a69265..00000000 --- a/README +++ /dev/null @@ -1,16 +0,0 @@ -README for LuaJIT 2.1 ---------------------- - -LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. - -Project Homepage: https://luajit.org/ - -LuaJIT is Copyright (C) 2005-2023 Mike Pall. -LuaJIT is free software, released under the MIT license. -See full Copyright Notice in the COPYRIGHT file or in luajit.h. - -Documentation for LuaJIT is available in HTML format. -Please point your favorite browser to: - - doc/luajit.html - diff --git a/README.md b/README.md new file mode 100644 index 00000000..c0815c9d --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +LuaJIT 2.1 - exploitation challenge +----------------------------------- + +LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. + +- [LuaJIT Project Homepage](https://luajit.org/) + +## A few resources / hints for the challenge: + +- See our commits to understand what has been modified +- [Programming in Lua](https://www.lua.org/pil/contents.html) + > You need no more than basic language constructs. No fancy language feature. (The authors of this challenge had previously never written a single line of Lua) +- [Just-in-time compilation (Wikipedia)](https://en.wikipedia.org/wiki/Just-in-time_compilation) + > Worth reading if you have never heard of Just-in-time compilation before. +- [Introducing LuaJIT ](https://staff.fnwi.uva.nl/h.vandermeer/docs/lua/luajit/luajit_intro.html) + > Explains concepts but it is slightly outdated (eg. `jit.compile()` does not exist anymore) + +- [LuaJIT web inspector](https://luajit.me/) + > Compile and inspect LuaJIT bytecode / generated Assembly +- [Online Assembler and Disassembler](https://disasm.pro/) + > x86_64 assembler/disassembler +- You are in a sandbox + - flag is in memory + - seccomp syscall filter prevents you from just running `os.execute("/bin/get_flag")` + - anyway, we deleted almost every global variable + +- Heavy workload is required to trigger JIT compilation. + +This code will not be JIT-compiled: +```lua +f = function() + for i=0, 10, 1 do + end +end +f() +``` +But this code will (notice loop boundaries): +```lua +f = function() + for i=0, 100, 1 do + end +end +f() +``` \ No newline at end of file