k3nn3dy commited on
Commit
51bd314
·
verified ·
1 Parent(s): 6dee13b

Add Golang_for_Hackers__LDAP_Injector_-_Episode_03_-_Error_Handling.jsonl

Browse files
Golang_for_Hackers__LDAP_Injector_-_Episode_03_-_Error_Handling.jsonl ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"text": "What's going on YouTube? This is Ipsac and welcome to episode three of the Golink for hacker series where we are diving into error handling. This is a pretty hot topic in the Go community because people love to hate the whole if error does not equal nil pattern as it can feel repetitive especially if you're coming from languages like Python, PHP, Java, JavaScript, etc. where you just wrap things in a try catch block and let the exception bubble up. Go does not do exceptions. Instead, it makes you handle errors explicitly right after each operation that can fail. At first, it may feel a little tedious, but honestly, I've come to prefer it because it forces you to think through what happens when things break right there in the moment. Another popular language that doesn't have exception-based error handling is", "start": 0.08, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
2
+ {"text": "Rust, which uses a more resultbased approach, and it also gives you the shortand that I'm very envious of, that is the question mark that you can just tack onto a function call, and if there's an error, it will automatically bubble it up, kind of like an early return, keeping your code clean while still being explicit. So, Rust, a little bit more structure than Go. And from what I hear, people really love how clean and powerful it feels once you get used to it. That said, the reason I chose Go over Rust is because, well, I just don't trust myself to make fancy design decisions. I enjoy how Go simplicity forces consistency. And this may be a hot take, but I actually like how Go pushes you to do things the Go way because if you're coming from another language, it'll definitely challenge how you think about structure.", "start": 41.04, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
3
+ {"text": "And if Go is your first language, then I would imagine a lot of the example code is just better quality. So there's less chances you'll just pick up bad habits as you learn. So before we jump into the LDAP injector, let us compare how Python and Go handle errors just so you can really see the difference in mindset.", "start": 85.84, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
4
+ {"text": "And I have a Python application already loaded in Z. And this code may not be the prettiest. I don't even know if it runs. I just made this to kind of highlight error handling. Um, looking at it, I actually noticed I have a unused import. Go really doesn't like things like this. Uh, Python, it's fine. I just had SQL light there because I was trying to show like um a duplicate error type, but um I thought that was too complex.", "start": 105.6, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
5
+ {"text": "So, let's just get to what this function does. We have fetch user data. We're going to make sure it's an integer. We're going to get data off an API server. We're going to decode the JSON data. Extract username and role. and then return. It's pretty simple. If you're thinking about error handling, the place you'd probably put it would be around this uh request. Because you could have a connection error, right? But there's a lot more places this script can error. If we look at all of them, we may have a value error if we're trying to um like pass in the user ID of Z because we're saying it has to be an integer. Of course, the request can have a connection error. There's a bunch of other HTTP errors. Maybe it returned a 500. Um, anytime we try to decode JSON, it may not be JSON data. So, it could throw an error. We're just blindly going ahead, right? And we don't know if this", "start": 130.8, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
6
+ {"text": "fails. What happens to data? Do we keep going down? What happens? It's not explicit in how we're doing the error handling there. Um, we have username and RO. Of course, we can get key errors if either of those fields are not in the JSON. So, there's a lot of places this script could error out. And if we go over to the Go code, um, it's very explicit. We're putting the error handling right after each call. So, we have the string convert asky to integer. And then, right here, we're just saying if error does not equal nil, we return with a wrapped error message. Right? Same thing with HTTP get, we have an API request failure. If we fail to decode it, we're putting that in here as well. right here we're doing um checking that username is in the JSON and it's also a string and we're returning that. That's also something Python probably wouldn't", "start": 182.319, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
7
+ {"text": "do because it's dynamic typing. So variables can be whatever type they want. They can even change in Golang.", "start": 234.799, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
8
+ {"text": "It's a statically typed language. So you can't really just magically change the type of a variable between like an int and a string. Um you have to create a new variable for that. Right? So we also have roll make sure it's a string and then we return. So go a lot more explicit. And that's not to say you couldn't do something like this in Python, right? Uh we could put like try catches here. So we could do like a try and then indent this except um we'll do maybe it's like request.exceptions connection error, right? And then we could raise um I'll just do connection error. This is probably a bad way to do it, but you could do a bunch of try excepts and stuff in your Python code, but when you do that, it's looking very much like the Go code. I would argue it's even looking a little bit worse. So when people say they don't like Go's error handling, um the question I normally have is what are", "start": 241.12, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
9
+ {"text": "they comparing it to? If they're comparing it to a language like Python where they're just not really caring about errors, of course it's going to have a lot more lines of code because you're just not thinking about the errors in Python. And if you write this Python script and decide you want to do error handling later, you'd probably have to rearchitecture a lot more of the code in your refactor just because it was built very quickly without thinking about errors. If I wanted to add better like logic here and how to handle the errors because I'm coding them as I go, it becomes very easy to just go back and then refactor that small piece of code to handle a little bit better. I don't have to move things around just because in Go I'm almost always thinking about how things can fail. Right? So, now that", "start": 298.4, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
10
+ {"text": "we went over all of this, I'm going to uh close out of zed and then we're going to go into a quick demo of some error handling and then we're going to go modify the LDAP injector. So, let's go ahead and open Whoops. I should have main.go. I don't know why that's not opening. There we go. Main.go. There we go. So, this should be relatively self-explanatory. We just have a function throw error that's going to throw an error. And then right here, we're just handling all error messages, right? So if I do a go run, it's just going to panic. So what we want to do is have a different type of error that we're just not going to panic from. So the easiest way to do this, and this isn't how I normally do it, but I think like I want to show the logical progression. You could just have a bunch of errors hardcoded. So we'll do like error. We'll call this", "start": 343.12, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
11
+ {"text": "um business logic error, I guess. or we do error business logic and then that can be errors new um do not panic save that and then here in this throw error we can um return the error business logic. So now if we run this the same thing's going to happen we have the panic that says do not panic right because we did not handle that error we did not um change it. So in this if error does not equal nil we can then say like um if errors pass in the error and then say error business logic then we can do a um fmt we'll do print f um error like this maybe sure this will be fine and then pulse panic. And then if we go run, we see this. And I have it wrapped as um an error because I may want to add things in later. But if you wanted to, you could just say that's a string. And then go will call um that as a string. And we", "start": 397.4, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
12
+ {"text": "have uh what? I thought that would call it as a string. Maybe not. I thought I would just see do not panic. We'll make sure that's written. Go run. There we go.", "start": 472.72, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
13
+ {"text": "Maybe I did not save it last time, but that's what I expected. So, this is one way to do it. Um, you can also use a switch statement, and that's not really like normal in Go, but there's nothing that stops you. So, you could do uh let's see if I can get it right real quick. Switch. Then, this would turn into a um case like this, right? And we put that this goes indented. And then we have a default case. Move that here. I think that'll work. Go run. And then we have do not panic. And of course if we change the um return to now be a error. So we'll just do fmt error f um panic. Right. Go run. It's no longer that error. So, panics out. I'm going to undo to get back to my if then because that's generally how Go programs work. I just wanted to show you the switch because there are some cases where the switch will make it look much prettier, right?", "start": 484.639, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
14
+ {"text": "But now, how I would normally do errors is I wouldn't put them hardcoded like this because we'll have a long list of just strings. I like creating more of a class and then I can just um like do it that way. It's hard to explain but I'm gonna do my best. Um and this all starts with looking at what error is and go. So if I peek at this definitions, error is really just an interface and all the interface has is one function or method called error and that's going to return a string. We can put other things in this, but as long as we have a um strct or implementation, whatever you want to call that, that has a function called error and only returns a string, then we can override what type of error it is. So, I'm going to make a new file. We're going to call it errors.go. And then let's open this up. Uh before first, I'm going to delete", "start": 556.519, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
15
+ {"text": "that. And now we can open up errors.go. We'll do a package main. And to start things off, we're going to create a new strct called application. Oh, we'll call it um password error because in LDAP injector, we're going to deal with password errors. So, we're just going to copy and paste this code. So, it's going to be called password error, which will act as a wrapper around the built-in error type and go. And this will allow us to add context to categorize certain errors like distinguishing the business logic errors from system or validation errors. Right? So first let's create our password error. So we'll do type password error strruct and then all we have to do is give it a variable. We could add other things here and before we get into the ODAP injector I'll show that but for now let's just keep it as simple as possible. Now what we have to", "start": 615.8, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
16
+ {"text": "do is um satisfy that condition of this having a um error function. So it would do funk e password error and then call error no arguments in it. We're going to output a string and then all we're going to return is error error um wait it would be e do error and then e dot there we go this is it. Um, so we're returning inside of our strruct, we're going to the error, which is what we defined here. And then we're just going to call the error function in that because that's going to return a string. So we have that. And then the last thing I'm going to do is create a function new um password error. And then what we're going to pass in will be a error. And then we're going to also return an error. So we can just do return and then password error error error right um there. So now we have this function. So", "start": 666.88, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
17
+ {"text": "if we go back to our code uh we can return a new password error and then we're just going to say fmt error f um invalid password. And we can also put um this and do please subscribe. Uh maybe we to make it clear we should do password is equal to please subscribe. Uh that may be a bit easier to read because I'm using the print f in a way you're used to seeing it. Right? Okay. So if error is it's no longer an is. We do if error as and then uh let's see I think we will do is it like this uh it doesn't seem to like that. Go run undefined error business logic. Save. Okay. Yeah, it did not like that.", "start": 740.8, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
18
+ {"text": "Uh let's see how do we do this? Um normally we would declare an error before. So I'm just going to do that. I'll do pwd error is a pointer to password error and then pwd error. This should be fine. Um, the reason why we do this because normally when you're doing this, you may be going into a loop and you don't want to create this object every time. It'll make more sense when we get into the program, but um, this should work. There we go.", "start": 808.32, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
19
+ {"text": "Um, why is it W? Oh, because I put a W here. Awesome. So, if I do this as a string and then we run it, we see invalid password. Please subscribe. Right. So if we wanted to, we could keep this as a W. And then if we had like a code, so I'm going to do a code as an integer. And then let's just return this as code one, right? And then we're going to rerun this. And we also have to update that, I think. Yes, we do. But we also um have to put the code here. There we go. Run this. Go run. And we can see the code is here. We have that one. Um, it may be a bit more handy if we print this out better.", "start": 847.21, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
20
+ {"text": "So, we could do error. Uh, let's do back slashn um message percent s back slashn code. That's a digit. So, we can say error then error dot I wonder if I can't go into this because I'm not declaring it as that yet. Okay. So, if we want to do what I'm showing is we have to um I forget what it's called. maybe type possession, but we'll do something like um let's do if uh we'll do pwd error.", "start": 906.0, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
21
+ {"text": "Okay, let's see. And then was it any error dot password error?", "start": 954.04, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
22
+ {"text": "Okay. Is this going to be right? So, we're passing in pwd error and pwd error. I think that's right. Go run. There we go. Yes. So, we have the message invalid password. Please subscribe. And then we added extra detail in that error as the code.", "start": 969.959, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
23
+ {"text": "Right. So what we did here is um this okay means we are able to take this error and convert it into a password error and that will then give us this object which is a pwd error and then that lets us go down into it and use the other parameters like code. So hopefully this makes sense. I don't think we're going to be using this in our code, but it's something I did want to show because maybe um you don't want to code a bunch of messages like uh you don't want your if then to be like if error is invalid password and go through that wrapping. Instead, you may just want to do like if error code is um less than 100, that's going to be a system error. If it's greater than a thousand, maybe those are just um minor errors that you don't want to panic or something like that, right? And I keep saying panic. you should only ever panic in Maine.", "start": 996.639, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
24
+ {"text": "Never have a panic outside of Maine because that'll cause your whole program to die. Um, but yeah, so hopefully this error handling makes sense. So now let's go and um we're going to delete the code and then I'm going to copy all this into our LDAP injector and we're going to start updating that code. So let's save all that. Awesome. And then I'm going to uh do ACP errors.go. I'll go up three directories I think and LDAP injector. There we go. And now let's open up zed yet again. And the main thing we're going to focus on or probably the only thing really is changing this do from bull error to just be error. Right? Because right here this is going to be um currently all HTTP error. So, if we get a a connection refused, we want to halt the program. And then the boolean, we're just dealing with this as the password was valid or not, but we're going to take this out. And then we're just going to have both", "start": 1051.2, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
25
+ {"text": "password errors and HTTP errors be part of the do. And I'm actually going to um not use fast HTTP at all. So, I'm just going to um rename this to fast http uh till day. So, that gets out of a project. If you want to convert fast http yourself, uh, feel free. But let's go focus on this. And all we have to do is change the boolean. Let's remove that. And now that's only going to return errors. So the first one, this is going to be the request. Of course, we can just return error. Go down here on this do. That's going to be all the HTTP stuff. And now this is the piece we want to modify, right? because we're returning if the status code is the expected one and nil. So all we want to do here is say if response.status code is not equal to the expected then we will return a new password error and this will be", "start": 1115.12, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
26
+ {"text": "um let's do fmt error f and we'll say invalid password and we'll put in the password here. So what is the password variable?", "start": 1182.12, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
27
+ {"text": "Uh that's probably near the top of this. Um just password simple. Okay. And then here we just want to return nil. And it's as simple as that. If we wanted to, um, we may like, uh, add a code here because I probably would put the actual status code. Um, we could say invalid password, um, status code and we'll do percent D like this. And let's see, we'll do C dot or response status code. Do something like that. But in real uh reality, we probably should edit our errors.go and then have a status code um be part of that. But this is fine as well. So let's go ahead and um edit everything else. So let's go down here. And this is going to be where we change a little bit of the logic around, right? Because we have if okay errors and um we're looping through every character in the character set. So", "start": 1197.12, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
28
+ {"text": "um what we want to do is declare password error up here. So we do that password error because we don't want to um instantiate password error every character in the character set. Right? So we just do it once at the top and then that will allow us to use the um errors as easier and we no longer return a boolean and error. So I'm just going to delete that. uh we definitely want to keep that return string and I'm going to say if the error is nil then we're going to return that and then we'll say else if and we're going to say not errors as pass in the error and then say if it's not a password error then that's when we want to return because that's going to be a like um error within the transport the HTTP or something like that we're expecting a password And we're just saying nope, that's fine. Just ignore it. Um, and let's see, we have test", "start": 1275.76, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
29
+ {"text": "character also returning string like this. Um, we can now also have this be a error. So we can do um what is it? New password error.", "start": 1340.32, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
30
+ {"text": "And this can be FMT error F. And let's just say um exhausted character set. So what we're doing here is if the character is valid then we're going to return that immediately and that's not going to error at all. Then if the error is not a password error, we're just going to um continue. And if it is um if it's not a password error, then we're going to um terminate the program essentially. But if it is a password error, we're just going to skip over it and go to the next character. And then if we have exhausted everything in this licar set and we never got a successful character, that's when we're going to return an error that just says exhausted character set. And that's also going to be part of the new password error. So hopefully that kind of makes sense. And this brute loop force logic. Let's see how is this working. So we're creating a result", "start": 1356.24, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
31
+ {"text": "string first. Then we're going to do this for loop. So this is going to loop over until um it thinks we're done, right? So this is kind of like an infinite loop. And then we have some logic in that says we're done.", "start": 1428.4, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
32
+ {"text": "So we're going to test the character and then if the error is not nil we're going to immediately return. So this is going to be where we have to start doing the logic, right?", "start": 1441.2, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
33
+ {"text": "Because if we get this blank string, which is how we used to identify exhausted character set, then um it would do it again and that would identify if it's a partial password because if we do a test character and we return nothing, it either means we reach the end of the password or the character in the password wasn't in our character set. So that's why we wanted to make that request again. So we have to change quite a bit in this function, right? So we'll say if error does not equal nil, um we'll say uh if errors as error is a password error and we're going to pretty much copy the code we did here. So, we'll yank that, put it here, and we'll do a and there. So, if we're a password error, uh, this should be pass error lowerase P. There we go.", "start": 1454.64, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
34
+ {"text": "So this is going to be if we're a password error, we want to do the request again. So let's get rid of this. Okay. And then if the request is successful, then we're going to break out of this. And then we'll say else if errors as and pass error. Then this is going to be um let's see we will return the result and then fmt error f we'll say partial password percent s result. Uh what save? There we go.", "start": 1526.48, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
35
+ {"text": "else return error. I think that may be fine. That's delete. That's gone. That's gone. That's gone. That's gone.", "start": 1585.4, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
36
+ {"text": "Let's see else error is not nil. Why is that erroring? Uh one string error.", "start": 1609.12, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
37
+ {"text": "Okay. So it did not need this twice. That's fine.", "start": 1629.559, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
38
+ {"text": "Okay. So, what we're going to do here is we're going to um run test character for every character in the string. And if test character passes no error messages, we're just going to append the result and then run it again. If it does have an error message, then we're going to check if that error message is a password error. And if it is a password error, then we're going to um do the result again. And if we get um the result as success, we're just going to break because we have the full password. Otherwise, we're going to um return the partial password because test character failed and we got invalid password after that. And then we're going to return here. Let's see. We probably need a there. Return air. That should be fine. Do I need that? Let's see. There's as No, I don't. I don't need this one.", "start": 1637.559, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
39
+ {"text": "I'm trying to think if I need this or not. Um, I'm pretty sure I do need it because this is part of this. So, this is saying if it's not a password error and this one is saying if we test the password and the um server responds with like a connection refused. So, I think that's all good. And I think there's going to be one more place we have to update. There is. That's going to be the prune car set functionality. And this is pretty much the same test we did on the test character, right? So, we're going to get rid of this. Okay. We're going to say if error is nil, then we're going to pass this in. And then we can do else and then return nil. And I think that's going to be the program. Uh, let's change this to just be HTTP brute implementation. And yeah, I think we are good. Um, I should leave that open. And let's see. I'm just going to reconnect", "start": 1713.44, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
40
+ {"text": "to my VPN just to make sure I'm connected. I'm going to do gor run dot. And we're going to wait uh probably a minute to two minutes for this to run. and hopefully we get a result back. So, I'm going to pause the video. Awesome. The program still works as we expected. Now, the last thing I wanted to do real quick is um I'm going to go in my errors.go file and we're going to do a new password error. I'll do with code. So, we do with code and I'm going to do code in. And I don't think we're actually going to use this yet, but it's just going to um help us when we go into a future video if we have a code set up. So, we'll do code there. Um, specifically, I think we'll use this a lot in the logging maybe.", "start": 1786.64, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
41
+ {"text": "Um, I think this would just be handy. So, we have that. And here we'll do new password error with code. We'll do invalid password like that. And then I think that's good. Let's see. We close that out. There we go. So that should be fine. Um what I also want to test is the partial password is working. So we can test that really quickly. Um let's see. We create this. We can do C. Set is equal to um SZ because I know those characters are in the password. We can do go run. And this will probably only take 10 seconds hopefully. There we go. Press password.", "start": 1843.48, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}
42
+ {"text": "So it is working as we expected, right? Um we remove that. We can save it. We can do a time on this. And it'll probably take somewhere between one and two minutes. And once we see this result, I'm going to um call it a wrap and that'll be the video. So, um hope you guys enjoyed this. Take care and I will see you next time. And leave a comment if any piece doesn't make sense to you. I'll do my best to answer it. And if I did a lot of mistakes in this video, then I'll probably just end up having to re-record this entire episode. Um because, well, I'm not perfect. I'm not positive if I'm handling errors the correct way. I change my approach on how to do things um every couple months. So um we'll see if how this video sticks. Hopefully it all made sense. And yeah, take care. I will see you all next", "start": 1895.039, "duration": 0.0, "meta": {"video_id": "9_aJN3-mOFw", "title": "Golang for Hackers: LDAP Injector - Episode 03 - Error Handling", "url": "https://www.youtube.com/watch?v=9_aJN3-mOFw"}}