Calculator for equations in the Reversed Polish Notation
$ ./main.py
//Your calculation goes here
//The output will be printed here
| FPS = 20 | |
| #ISIZE = 1280, 720 | |
| ISIZE = 1920, 1080 | |
| TRAIL_FADE = 0.93 # 1.0 - no fade, 0.0 - immediate fade | |
| GAMMA = 0.1 | |
| RADIUS_F = 30 | |
| DEVIATION = 45 |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <limits.h> | |
| static inline unsigned _max(unsigned values[], unsigned length) { | |
| unsigned max = 0; | |
| for(unsigned i = 0; i < length; i++) max = max > values[i] ? max : values[i]; | |
| return max; | |
| } |
This is a write-up of the 2018 STB challenge: https://github.com/securifybv/spotthebug/tree/master/STB_2018
When first opening the repository, I see two interesting files; a PHP file, and a C++ file.
The C++ has a BaseCGIClass (which has no functionality), and two children classes of the BaseCGIClass. I immediately notice the std::system call in the Executor class. The Logger class seems to not have any potential side effects. In the main function, I assume the Cgicc is an interface for the CGI protocol. This means formData("encryptedData") likely returns user input. We can control this.
| from contextlib import contextmanager | |
| import signal, sys, termios, atexit, tty | |
| class CTLSEQ: | |
| """ | |
| Condensed from https://github.com/wilfreddv/HB/blob/main/hbutil/hbutil/termctl.py | |
| Define common ANSI escape | |
| code control sequences |