Keep only the crash function call and remove the version detection

This commit is contained in:
Sofian Brabez 2020-11-23 18:30:16 +00:00
parent bad51a7e3a
commit 04b00308f2
1 changed files with 2 additions and 13 deletions

View File

@ -1,23 +1,12 @@
import platform
"""
This execute a payload code object which crashes the interpeter for different
python versions. Currently there is no bytecode verifier to prevent those
crashes related to malformed bytecode
"""
def crash_38():
exec((lambda f: f).__code__.__class__(0,0,0,0,0,0,b"\x01",(),(),(),"","",0,b""))
def crash():
locals()['crash_38'] = crash_38
locals()['crash_39'] = crash_38
locals()['crash_310'] = crash_38
py_ver = "".join(platform.python_version_tuple()[0:2])
crash_func = "crash_{}".format(py_ver)
locals()[crash_func]()
exec((lambda f: f).__code__.__class__(
0,0,0,0,0,0,b"\x01",(),(),(),"","",0,b""))
if __name__ == '__main__':