4 ms·
This is pretty fascinating! It's a shame subclass numbers do change from version to version, so there is no "one-size-catch-all" injection string. Someone in
by tryauuum 6y ago
This is pretty fascinating!
It's a shame subclass numbers do change from version to version, so there is no "one-size-catch-all" injection string.
Someone in this thread posted a solution with next() that iterates over subclasses to find the correct one. But an injection with spaces won't work as well when injected in jinja2 (something that original injection accomplishes in python2).
- masklinn 6y ago> It's a shame subclass numbers do change from version to version, so there is no "one-size-catch-all" injection string. Yeah going through subclasses is not trivial, but that's the way exploits work really. And usually once you find a target the version is going to be reliable. An other big injection sources in Python is when modules are available in the evaluation context, that's way more risky than exposing classes, functions, and objects due to Python's transitive import nature: anything you import becomes an attribute of your module, meaning if your module is visible so are its module. And very often there's a point at which `sys` is imported somewhere within transitive reach. Once `sys` is available they're out of the interpreter.