Other Activities
Other exercises and tasks within the module.
Other exercises and tasks within the module.
What is ReDOS and what part do ‘Evil Regex’ play?
1)ReDoS (Regular expression Denial of Service) it is a type of algorithmic attact that causes denial-of-service by inputing a regular expression command that takes very long time to evaluate.
2)Evil Regex is a regular expression that uses repetitions ("+" or "*") to a very complicated sup-expression, that may overlap this repetitions.
What are the common problems associated with the use of regex?
1) Regular expressions may generate bugs, if they are worngly written by generating fals positive and fals negative matching.
2) Using regular expressions especially in web applications may lead to operating in an incorect way or even crash if bad regular expression are used, for example it is impossible to validate the querry (it takes too loong to execute or there is an out-of-memory exception).
Equivalence Testing is an example of testing in which the test checks in which partition the input is going to be placed.
in the example in equivalence.py there are four partitions:
([1, -3])
([2, -2])
([3. -1])
([0, 4])
and an input (in this case an intigrer in a range(-3, 5) i.e. -3, -2, -1, 0, 1, 2, 3 and 4) is going to placed in one of these partitions based on a equation: (x-y) % 4 == 0
for -3 it should be [1, -3] and that is correct because:
(1 - (-3))% == 4 which is 4 % 4 == 0
1) What are the two main security vulnerabilities with your shell?
basically based on the examples one of the most dangerous vulnerability is that a attacker can use a shell and execute a command line commands to get access to files on a disk, that he should not have. (COMMAND INJECTION)
2) What is one recommendation you would make to increase the security of the shell?
Be sure that a program cannot be backdoored and do not run in an invalid way.
Add a section to your e-portfolio that provides a (pseudo)code example of changes you would make to the shell to improve its security.
I provided a code that accepts only a certain format and analyze is and do actions securely, omitting potential execution of commands in command line interface.
The results of my approach to this subject can be found on my repository in GitHub:
https://github.com/grzegorzpikus/SSD/blob/master/main.py
I also wrote a shell using built-in library Cmd:
https://github.com/grzegorzpikus/SSD/blob/master/Interactive_shell.py