text
stringlengths
0
1.49k
**Brian Ketelsen:** Speaking of the background thing - one of the things that stands out when you were talking about how you got into this is just the breadth of your background. Do you feel like there's room for somebody to just come in and start learning about InfoSec and security, or do you feel like having that rea...
**Aaron Hnatiw:** There's no doubt that it's helpful. The way I look at it -- I get asked all the time, "How do you learn to hack?", it's kind of the most common question that I get, and the answer I always give is hacking is really understanding a technology or understanding how something works so well that you can fi...
**Erik St. Martin:** And I thinks sometimes it comes down to -- you know, you fuzz things a little bit and then understanding why it broke. If you can reproduce it breaking, then you can usually exploit that, but you have to understand why it broke, so that you can use that to your benefit.
It's really for people who love deep diving into stuff, and "Why does this work?" and things like that. It's a lot of fun, though.
**Aaron Hnatiw:** Yeah, and that's why I think developers love it, or developers could be really good at it, because I think every developer I know who's really, really into it, you have to keep learning, you have to dive deep into a technology all the time, and that's really the same basis for InfoSec.
**Erik St. Martin:** I think it takes a creative mind, too. When you understand alll the pieces and how they fit -- it's almost like solving an engineering problem or troubleshooting some issues... If you understand how it's supposed to work, you can figure out the points of attack and how you can sneak around, using i...
I'm trying to think if you wanna get into reverse engineering, there's a few sites for crack means and stuff, too. But I think everybody should try their hand at it, just to kind of understand the perspective an attacker comes from.
**Aaron Hnatiw:** Yeah, and you're totally right when you say it's just like an engineering problem, or an engineering challenge. The way I look at it a lot of the time is it's a game, it's a really fun, deep, technical puzzle that you have to solve, and there's a ton of resources out there to practice it. That's reall...
\[16:17\] Way back in the day, people started learning by essentially doing criminal activities, where you're hacking into things you're not supposed to be hacking into, but you don't have to do that anymore.
The way I learned was I basically set up a virtual lab using a VM or a virtual box, and I would have three VMs going at once. I would run an old version of Ubuntu, I'd run maybe an old version of XP, and then -- there's also a few other virtual machines that you can use... There's one called Metasploitable, there's one...
If you want more of a collaborative environment, there's essentially games called "Capture the flags." I can get into that more, but it's essentially a hacking game, or a hacking competition, and they're held all over the world; you can access them online. There's a website called [ctftime.org](https://ctftime.org/), a...
Those competitions are good because they teach you how to think like an attacker, they don't necessarily teach you as many real -- some of them teach you the real applicable attacks you can use, but a lot of them are about really tough challenges that force you to think the way an attacker would have to think. So there...
**Erik St. Martin:** I think it's interesting though too, because there's a lot of similar aspects when you think about learning engineering, where you go down these avenues, and maybe it doesn't get you to what you're trying to build, but you've learned a lot in the process. I think information security is the same wa...
I kind of have a question too, because you border these two worlds, right? You've got an information security background and a development background, and I'm really interested on your perspective about how those two worlds meet. From my standpoint, the way I see it is there's a lot of information security people talki...
In the security world they wear their programming abilities like a badge of honor. The first thing almost every security person says when they get up on stage is "I know my code is crap, but..."
**Aaron Hnatiw:** Yeah, so bridging the two worlds - I mean, do you have another two hours to talk about this? \[laughter\] It's an issue that I think a lot of us have seen. I'm fortunate in that I have that background to be able to speak to developers and not be intimidated. I think part of it may be an intimidation t...
\[19:58\] Stepping back, part of my role and part of what I do is I go to conferences and I speak about security, but a lot of the conferences that I go to are security conferences and I'm not alone in doing this. A lot of us are going to the echo chamber that is the security world and saying "Hey, these things are bro...
So as far as how to approach that - it's a tough challenge. What I found in work with a lot of clients has been the most effective thing I can do is have conversations with individual people, individual developers about security and just answer their questions and get them a little bit interested in one little area of ...
**Brian Ketelsen:** I kind of wanna argue a different point of view on that just a little bit. I agree that developers are really smart people, but I also think that developers are overloaded with all of the things that they already need to know, like how databases work and how to index things, and how networks work......
I keep looking at these news articles about all these compromised machines across the globe, and thinking that that's a failure on our part as developers in whole, or as companies, as businesses even, to secure software.
**Erik St. Martin:** I think that that's also a management problem too though, right? Because it's not part of the lifecycle, and I think that engineering and security are two different hats. Even if you possess both skills, it's very hard to look at the problem in both ways, right? I think there's time developing feat...
**Carlisia Thompson:** Before Aaron answers, I wanna throw one perspective... I've been sitting here and thinking about security and thinking "Oh my god, if I had to learn enough about security to make an application thoroughly secure, it is so much..." Like Brian was saying, we have to know so many different things. A...
\[24:09\] I was sitting here, thinking I am surely glad the place where I work now, they have a security team (like many companies do) and there is an audit process. So at some point in the software development, once it gets close to being ready for production, it goes through this audit. For me, it's like "Yeah, great...
**Erik St. Martin:** Security is a really broad world, and I'll let Aaron speak to this as far as _Red Teams_ and how involved that is, how many people there are with specialized skills when they do that... But I think when we talk about engineers, I think we're talking about a surface level of security. The better maj...
**Aaron Hnatiw:** I think the point that you bring up about having the basics covered is really important. It is intimidating to think about all of the things you need to think about to be an expert in security, to know what different kind of vulnerabilities there are out there... And I'm gonna let you know a little se...
A good security person will look at something and understand the business risks and understand really what it's trying to do, and find the best way to put the most security measures in place. But some of the basics -- I mean, I can go over some of the basics you should probably know, as a reference, to cover the basics...
I think three main things stand out that you can easily do and keep in mind when you're developing something, and then you're covering a substantial amount of vulnerabilities. The first one is the patch. Just make sure your libraries are up to date as much as possible, especially if there's a security vulnerability. So...
The second thing - and probably the most important thing - is input validation. Understanding that the input that you're getting from a user is what you think it is, and checking that on the server, rather than on the client. Because client-side control can be bypassed very easily.
\[28:01\] In a browser, if you use a proxy like [Burp](https://en.wikipedia.org/wiki/Burp_suite) or [ZAP](https://github.com/zaproxy/zaproxy) you can intercept the request, change the data after it's left the browser, and then send it on and it completely by-passes any kind of client-side input validation. So checking ...
The difference between a whitelist and a blacklist means -- a whitelist is looking for a set number of things that are allowed, whereas a blacklist is looking for a set number of things that are not allowed. The number of inputs that can be allowed through is significantly less when you use a whitelist, so you are much...
So input validation is probably the most important, because really any vulnerability, any exploit comes from user input. If you can control that, if you can find some way of mitigating that, you could probably reduce at least 50% of the vulnerabilities that you may have in place, which is huge.
The third one is output encoding, and this is more of a preventative measure. When you're outputting data onto a web application, for example, if you encode it with HTML encoding, for example, by doing that you will then reduce the likelihood of something like cross-site scripting, which is essentially when an attacker...
So doing patching, input validation and output encoding are three of the biggest things. There's a few other things that I can just briefly mention, in case you're taking notes and you want some more depth... One is hardcoded credentials in API keys. I think probably like four months ago it showed up on Hacker News tha...
Then two other key things is authentication and authorization, so making sure that people are doing the things that they should be doing, and they're allowed to do that and they're gated from doing things they shouldn't be doing. Then the last key point is encrypting data arrested in transit; making sure that you're us...
I know that was a lot to take in, and I'm sure that a lot of people are probably gonna go back and review over that... But if you can just cover those things, just keep those in mind as you're developing, I guarantee you'll reduce at least 90% of the vulnerabilities that can be introduced in your application just from ...
**Brian Ketelsen:** How about my favorite one, which is "Don't roll your own Crypto!" \[laughter\]
**Aaron Hnatiw:** Number one rule in crypto: Don't roll your own Crypto!
**Brian Ketelsen:** Yeah... Please.
**Carlisia Thompson:** I was gonna say, what you just said, that list, it will make a great blog post.
**Aaron Hnatiw:** Absolutely. I might do that.
**Carlisia Thompson:** Yeah, if you do it, make sure to share it with us, and we'll share it with everybody.
**Erik St. Martin:** \[32:00\] These are kind of generic from any programming language. How about - since you've had some time in Go, how about Go? What are some attack factors that exist in Go, or what are some areas where Go saves you from yourself?
**Aaron Hnatiw:** So Go is pretty good at saving you from yourself, especially on the web side. The number one thing that I've seen that makes it a lot easier to defend against attacks - and I had my students go through using this as well - is HTML templating in the standard library. It provides automatic _output encod...
One other thing that Go does for you, if you're using a lot of the SQL packages that you can use -- they have the concept (actually, they all should have this) of parameterized queries. What that means is when you're passing data into your database connection, when you're sending a SQL query, you're not just simply pas...
**Erik St. Martin:** You know, one of my favorite things learned in SQL injection was for years I understood SQL injection and getting content back on the page or inserting data, logging in using SQL injection, but the one that really blew my mind when we talk about the creativity of a hacker is [blind SQL injection](h...
**Aaron Hnatiw:** Yeah, so blind SQL injection is like a whole other level of SQL injection attacks, and it's more common nowadays because there's even better SQL protections in place by default in most languages. So a blind SQL injection, like you referred to, is using ways -- so when you don't have immediate feedback...
A perfect example is people use timing attacks. So if you make a SQL request where you pass in data that results in a SQL injection, it will return back in a certain amount of time fairly consistently, on a normal request. But if you were to inject a SLEEP() command, and then suddenly the application takes ten seconds ...
There's a really useful tool -- I don't know how many people actually do manual SQL injection anymore, because it's so complex and there's so many good defenses in place now, but there's a tool called [SQLmap](http://sqlmap.org/) that does this automatically for you. It's got a lot of really good options, but it essent...
**Erik St. Martin:** \[36:12\] There's also a newer tool called [NoSQLmap](https://github.com/codingo/NoSQLMap) that is for like MongoDB and things like that, too.
**Aaron Hnatiw:** Oh, nice.