Тэги:
#ethical_hacking ##ethical_hacking ##ethical_#hacking ##ethical ##hacking ##ethical_hacking_programming #programming #languages ##programming ##languages ##programming_languages_for_ethical_hacking ##python_for_hacking ##cpp_for_hacking ##javascript_for_hacking ##ruby_for_hacking ##programming_for_hacking ##sql_for_hacking ##cyber_security ##ethical_hackers ##top5 ##top10 #top_5_languages ##python #Python ##pythontips #turtle #library #html ##html ##javascript #css #HTML ##websecurity #websecurity #sqlКомментарии:
The code is vulnerable to SQL Injection due to the lack of validation of the user controlled parameter (i.e. $id).
So, the correct option is B) SQL Injection
PoC: id=-1337 OR '1'='1';# --
The above will return back results for all ids due to '1'='1' as always being TRUE.
Prevention:
It’s important to always sanitize and validate user inputs to prevent such vulnerabilities. For PHP, we can use prepared statements with parameter binding to prevent SQL Injection.
B
Ответить