SYP 2018 - Porto Edition
miguel regala, full time freelancer, security researcher, part time traveler, half hacker, half mercenary, casabranca, noob surfer, gamer, bitcoin owner (rip savings)
Hacker - hack·er
"I'll create a GUI interface using VBA to track the IP address"
Taken at H1-4420 London
@Hoover Dam, US
Somewhere @Iran..
Not critical but.. 😅
$ sudo give me your password
In a nutshell:
<html>
<head> <title> Simple Vulnerable Page </title> </head>
<body>
<p> Your text is: hello </p>
</body>
</html>
$_GET['text']
GET https://vulnerable-website.com/home.php?text=hello
GET https://vulnerable-website.com/home.php?text=<script>prompt('hello')</prompt>
<html>
<head> <title> Simple Vulnerable Page </title> </head>
<body>
<p> Your text is: <script>prompt('hello')</script> </p>
</body>
</html>
$_GET['text']
How:
<script>prompt(document.cookie)</script>
Stealthier:
Fixing:
Always treat input as malicious
GET https://vulnerable-website.com/home.php?text=<script>prompt('hello')</prompt>
<html>
<head> <title> Simple Vulnerable Page </title> </head>
<body>
<p> Your text is: <script>prompt('hello')</script> </p>
</body>
</html>
htmlspecialchars($_GET['text'])
In a nutshell:
200 - OK
Successful transfer!
GET https://vulnerable-bank.com/transfer.php?from=me&to=alice&amount=10
200 - OK
Successful transfer!
GET https://vulnerable-bank.com/transfer.php?from=me&to=alice&amount=10
Cookie: logged=1; auth=PHNjcmlwdD5wcm9tcHQoZG9jdW1lb=
200 - OK
Successful transfer!
GET https://vulnerable-bank.com/transfer.php?from=me&to=attacker&amount=9000
https://goo.gl/cute-kittens
Solution:
200 - Login OK
Here's your CSRF token:
YXNwZG9ramFwb3NkazkwMzQ4eTRybmZta2ws52huamtv==
GET https://vulnerable-bank.com/login.php
200 - OK
Successful transfer!
GET https://vulnerable-bank.com/transfer.php?from=me&to=alice&amount=10&csrf=YXNwZG9ramFwb3NkazkwMzQ4eTRybmZta2ws52huamtv==
200 - OK
Invalid CSRF token, transfer aborted.
GET https://vulnerable-bank.com/transfer.php?from=me&to=attacker&amount=9999&csrf=??????????
https://goo.gl/cute-kittens2
Solution:
Oh. And it pays off too.
500$
500$
500$
1000$
500$
15000$
meetup.com/0xOPOSEC
CSIRT (Computer Security Incident Response Team)
CERT (Computer Emergency Response Team)
Questions?