So called “Ethical Hacking” is a very complex beast: let’s slice it and approach one step a time. During the first episod, we’ll talk about code review.
by: Sandro Zaccarini
to the act of locating weaknesses and vulnerabilities of computer and information systems by duplicating the intent and actions of malicious hackers [cit. http://wiki.cas.mcmaster.ca/index.php/Ethical_Hacking]
to hack back ▸ Japanese survived to Fukushima incident ▸ but lives with nuclear plant compromised since years ▸ BigY fall in disgrace ▸ huge loads of "useless" info sold online ▸ refrigerators can't save us from rotten milk ▸ but takes down researchers' websites (and all the West Coast!) is there anybody out there?
or on-demand) ▸ great for coverage (even for non-security issue) ▸ based on pattern ▸ reproducible ▸ misses the context and the business logic ▸ tools are *pricy* (even if you save some devs-time) ▸ huge load of false positive
starts with threat modeling ▸ lateral think ▸ follow guides (ping OWASP) ▸ deep understanding of both language and application ▸ very high on time consuming
correct in failure cases? ▸ are sessions handled correctly? ▸ what functionality can be accessed without authentication? ▸ are inputs from external sources validated? ▸ are there any known weaknesses in third-part security controls?
risk for applications that have many users but provide a single execution context at the ap- plication and database level. In particular, users should not be able to become any other user or assume the attributes of another user. TAMPERING Users can potentially change data delivered to them, return it, and thereby potentially manipulate client-side valida- tion, GET and POST results, cookies, HTTP headers, and so forth. The application should also carefully check data re- ceived from the user and validate that it is sane and applicable before storing or using it. REPUDIATION Users may dispute transactions if there is insufficient auditing or recordkeeping of their activity. For example, if a user says they did not make a financial transfer, and the functionality cannot track his/her activities through the application, then it is extremely likely that the transaction will have to be written off as a loss. INFORMATION DICLOSURE Users are rightfully wary of submitting private details to a system. Is possible for an attacker to publicly reveal user data at large, whether anonymously or as an authorized user? DENIAL OF SERVICE Application designers should be aware that their applications may be subject to a denial of service attack. The use of expensive resources such as large files, complex calculations, heavy-duty searches, or long queries should be reserved for authenticated and authorized users, and not available to anonymous users. ELEVATION OF PRIVILEGE If an application provides distinct user and administrative roles, then it is vital to ensure that the user cannot elevate his/her role to a higher privilege one.
over and manipulate the system? Can an attacker crash the system? Can the attacker obtain access to sensitive information such as secrets, PII? How many data sources and systems can be impacted REPRODUCIBILITY How easy is it to reproduce an attack to work? Can the exploit be automated? EXPLOITABILITY How much time, effort, and expertise is needed to exploit the threat? Does the attacker need to be authenticated? AFFECTED USERS If a threat were exploited, what percentage of users would be affected? Can an attacker gain administrative access to the system? DISCOVERABILITY How easy is it for an attacker to discover this threat?
to security ▸ appendix: maybe they're even not interested ▸ fact2: devs and secs speak different languages ▸ appendix: and *know* different things ▸ appendix: secs mostly prefer to bash than to help ▸ therefore: apps works, but get hacked
$resolver = new Net_DNS2_Resolver(); $res = $resolver->query($ip, 'PTR'); /* no need to sanitize DNS response, RFC does */ $host = $res->answer[0]->rdata; $sql = "INSERT INTO tracking (usr,ip,host) value"; $sql .= "('".$user."','".$ip."','".$host."')"; return $sql; } function showLogged($id) { /* input from database already sanitized at updateLogged */ list ($user,$ip,$host) = getRecords($id); echo "User ".$user.", last login from ".$ip."(".$host.")\n"; }