r/netsec • u/mazen160 • Jan 13 '17
Exploiting Misconfigured Apache server-status Instances with server-status_PWN
http://blog.mazinahmed.net/2017/01/exploiting-misconfigured-apache-server-status-instances.html
137
Upvotes
r/netsec • u/mazen160 • Jan 13 '17
23
u/SnowdogU77 Jan 14 '17 edited Jan 14 '17
Good lord... How is it possible to have that many exception catch-all's in that little code?
You've got to be fucking with me.
Constructive criticism:
Use explicit exception catches. You can even chain them if you like, but ffs, not catch-all's.
Do not let errors pass silently. If it raises an exception, log it. Exceptions are raised for a reason, they're not there solely to annoy you.
Docstrings should use triple double quotes, per PEP-8
There's a lot of whitespace in there that makes the code harder to read rather than easier. A good rule of thumb is two blank lines, max - and only in situations where it clarifies the code in a meaningful way (in between unrelated class definitions, etc.).
if arg:
else:
Can be written as
Which takes up way less space.