text stringlengths 4 952 | start float64 0 9.37k | duration float64 0 0 | meta dict |
|---|---|---|---|
When we go into error handling and understand how to differentiate different errors, we'll only return error, right? But if we go into error handling, that's going to be a little bit much for this video. Ideally, we just return error. And then if it's an application error, we know, okay, that um password was incorrect.... | 649.36 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
we're going to copy this, paste this in, and then where there is input, so the username, we're going to put a percent s. And then for the password, we're going to do the same thing. And then we'll top it off by ending the sprint f with the username and password. So those get put into the payload. So now we can start ma... | 698.8 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
It's going to go to the URL. And this looks mostly right. Right. | 729.44 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
So post URL and we have the payload is putting it in the body. We're going to set the header as x dubdubdub url form encoded. And then we also will have to set one more header because this is a nextjs app. Um and that is going to be the next action. So we'll set that and then put this here. And if we wanted to support ... | 736.24 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
follow redirects because the Golink HTTP client by default will follow a redirect and the valid password is a 303. So it follow it to be a 200 and then we could probably parse either the cookie or the body or something else in the request to identify if it was valid or not. | 790.16 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
However, that makes two requests per attempt. We want to make one request. So, we're going to tell it not to follow the redirect because we can depend on the status code. So, we'll do a comment that says do not follow redirect because Golang does it a bit weird. So, I'm going to start typing and hope Copilot takes the ... | 808.56 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
you're from Python, it's very similar to the width statement. Uh, PHP now has defers. A lot of languages do have it. | 870.16 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Um, another case instead of just like cleaning things up would be I like doing it for my structured logging. So, at the start of a function, I would write a start of a log and then I would defer and send that log event. And what that enables me to do is update that log uh object throughout the function. And then whenev... | 876.48 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
So that way I just get one log line that's very detailed versus if I put a bunch of different logs in the function. | 901.12 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Then when you go to just look at the log, it just becomes a mess because you have five lines where you could have just had one good line, right? So that's generally what I do. The other thing we want to do is change this to be 300, right? Because this is saying um exit this boolean. So when the response status code is ... | 907.519 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
go run dot to run it again and we get true. So our function to test password works. Now the next thing I'm going to do is create a character set because we're going to need that in the future. So um I'm going to do funk and I'm just going to say create care set and we're not going to pass in any variables. Um, when we ... | 956.16 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
um we'll say for result string or maybe I should call that carouset. We'll do carouset string. We can say um this actually probably be what is see a rune this can be just a list of bytes like that. Okay. So now we can say carouset is equal to append carouset and c right uh we have to convert this to a bite I'm not sure... | 1,017.839 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
string. So we'll do C is equal to string convert uh dot integer to ASI like that. And then we can probably just append C. There we go. Go run uh C variable type of string. Uh how do we get this back into a bite? | 1,132.72 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Um, you know what? Let's just do this as a string. We won't do it properly. Um, carouset plus equals string C. That's fine. And then this can be carouset plus equals string C. | 1,161.16 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
It's always um tough to do things while talking and everything, but this is not optimal memory management. When we talk about runes and what they are and how gerling handle strings, uh we'll probably fix all this up, but um for now that should be fine. There we go. Now we have the character set. So what we want to do i... | 1,184.16 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
return both a string and an error. And for this, we have to do two loops. And I always hate doing two loops because we have to loop over every single character. And then we also have to do a loop for each of those characters, right? And whenever you do that, it it's just not pretty code because you have to break out. Y... | 1,253.28 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Um, so we'll do okay error li.est password and then we need to do fmt.sprintf and we'll do percent s because that's going to be prefix. That's going to be the character and then we need a wild card. So that looks better. Um, this is currently a rune. We probably should make this a string. | 1,317.28 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
And then we can return this as a string. And the whole reason behind that is every string is essentially like a bite buffer, right? And a rune um will except uni code. So that can be two bytes. And if you do a string against uni code, it's not going to work. I think I think strings are just for asy. | 1,346.88 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Maybe wrong there, but um we'll definitely do a video where we dive into runes more in depth. But we're going to do here is test the P password with that character or take every character loop over each one test it. If that character is in the password, then we're going to um return that. And then if that character is ... | 1,365.679 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
So, let's just comment this out real quick and then we're going to test our program. So, now we can do the C new LDAP injector. Um, we'll do okay error C do test character and we're going to pass in nothing for the prefix and print that out. So when we go run this, hopefully it says um S. Yeah. | 1,402 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
And I should have said okay here. Um this should have been uh what is it? Response probably. Whoops. That was not rename variable, right? Because that's not a boolean. We should have done response. But there we go. And if we passed in S to this, we should get back the second character of the password. And hopefully the... | 1,433.039 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
result and then if error is not nil return error. That looks good. | 1,496.84 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
And I think this is good. So let's look at this function. So we start out with an empty string. It runs through. It's going to test the character. It's going to get s. This is not equal to nothing. So it's going to keep going. And we do this. That is right. Goes the second. And soon as we hit that, we could return. We ... | 1,508.559 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
doesn't really matter, but I always like having the last line have be a return, so that's why I did the break. So, this looks like it works. Um, I guess the moment of truth. Well, before we get to that, we have to code the brute force. So, if error is nil, let's do password. And this will be brute. And at the end of th... | 1,536.88 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
that would be like lower upper numeric symbols. So there's 80 and let's say the password is um first this we're talking about no optimization. So no optimization, right? And the password's 10 characters long. So at max we have 800 requests, right? If we go and do binary search, whoops, binary search, then it starts out... | 1,600.08 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
then we can get a maximum of 10 characters back. We can't get like 12 characters or in a 10 character password, right? So, at max 10. So, we do 80 + 10 * 8 and that's going to equal 180 requests at max. And really, that's lower than um that because like once we guess that character, we remove it from the possibility. S... | 1,674.12 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
funk and we'll say um lidep injector and I'll say prune carouset. And I guess we can return an error if things go horribly wrong. Uh yeah, we'll just do that. So what do we want to do? Um we have to loop over the entire word list. So we'll do four care and range this. So range li.care set and then we want to test the p... | 1,732.88 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
erroring wrong type rune? Let's do string here just to keep that happy. | 1,847 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Okay, so now we can do C. prune carouset and we're going to do fmt uh we'll do print ln carouset and then we will say pruned carouset and then brute force the password and print it. So we're hoping to beat 1 minute and 12 seconds. So I'm going to do go run. we get the character set and then it's going to prune it and t... | 1,856.6 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Um, before we return nil, we have to do li.caret is equal to new to set it. Save that. Now we can run. Okay. So, let's see. We probably should start going over the program while that runs. Um, I'm guessing it's going to take 39 seconds. So, what function do we want to start with? Um, test password. So, this we build th... | 1,906.6 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
character is just going to loop over the character set that we have which is lower alpha numeric. It's going to test for the password. And I want to say I did not do this well. | 1,974.559 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Um this really isn't a good way to do things in Golang like the if then loop like this. We probably should do it. Um, if okay error is equal to that then if error let's see error does not equal nil return nothing error then else. | 1,990.12 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Okay. Or else if Okay, this would be a more golangy way to do that. I think um and I'm showing you this because I don't know what it's having me accept. Um, the difference what I just did is again I said Golang really cares about like variable scopes or at least I think I've said that before. But if we left it this way... | 2,029.399 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
If we go here, undefined, right? But if we comment this block out, I wish I remember the hotkey off the top of my head to comment all these, but I don't. | 2,077.76 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Um, now, okay, is going to be defined. Uh, we have to get rid of that slash. What are you? | 2,092.839 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
it's a boolean. So, it's all about scope when you do it that way. Um, hopefully that makes sense. I know that confuses a lot of people when they start with Golang is why does everyone write if then this way? It's so different than the other ways I'm used to seeing it. But that's why. So, let's just make sure that still... | 2,106.48 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
password putting star um character star and then appending and again we should probably use that same um logic. So if like this then error is not nil return nil else if okay put this up here. Whoops. I don't know what I just did. Move that there. There we go. So that's a little bit cleaner. And then we just set the cha... | 2,161.2 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
And then finally the brute force. We're going to define the result here and um loop through. Right. And we probably could update our if then logic here as well if we wanted to, but I think right here is fine. I normally only do that for like booleans. We may want to use that um single character later on, maybe test som... | 2,217.28 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Right? If this was no SQL, then my final character would be a dollar that I test for. Actually, it would be in the character set. The final one would be a dollar because that means end of line. | 2,279.599 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
So, that would confirm we got through all the um passwords, right? Or the characters. This does have the issue if um there's a character not in a character set, we won't get the complete password because it's just going to assume it got it. So, um, you may want to put some type of logic into the brute force that just t... | 2,292.079 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Um, partial password found like that. And then if it's okay, that should be fine. So that would be one way to do it. And let's see where do we do um rune carouset. Let's just actually scroll up. We're going to take this character set. We're going to copy it and we're going to say c.car set is equal to Whoops. | 2,370.839 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
C. Set is equal to. Let's make sure we have this copied. We can paste it. And let's remove the sec. Uh, where's the password? It was CZ. Uh, where is it? | 2,419.96 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
SZ. We could remove the C. | 2,442.44 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Okay. So now when we run the program, hopefully it's going to error, right? | 2,448.359 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Because we removed one of the possible characters. It's going to go to test the password and it's going to come back. | 2,454.4 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
Hey, this password is not okay. And then error out. Um that is my hope. I'm surprised it's taking this long. Uh partial password found. There we go. So we did error. um it knows it did not get the full thing. So with that being said, I hope you guys enjoyed the video. Let me know in the comments if you enjoy this um fo... | 2,460.88 | 0 | {
"video_id": "uJFW4c4QE0U",
"title": "Golang For Hackers: LDAP Injector - Episode 01",
"url": "https://www.youtube.com/watch?v=uJFW4c4QE0U"
} |
What's going on, YouTube? This is IPSC and welcome to episode two of our Golang for hacker series where we're building an LDAP injector. This episode's all about dependency injection, which is definitely one of the more technical topics we'll cover. So, you may be thinking, why are we diving into something so technical... | 0.08 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
in a video game without understanding their mechanics. It's really easy to quit the game or go in this case if you don't understand how it expects you to solve the challenge. So, let's get to the point. Dependency injection is just passing objects, not just simple variables, into our functions, which helps us decouple ... | 40.239 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
In Golink for Hackers episode 2, we're going to start with Python. Why? because I know that's where a lot of you are coming from. So hopefully it helps make this concept stick. Additionally, Go doesn't have optional arguments or function overloading. So it's really easy to hit a wall if you're trying to write Go the sa... | 74.72 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Nothing fancy, just a quick function passing some arguments and call it a day. But over time, we want to support more destinations. Maybe S3, Azure, Webdave, a binary protocol. Who knows what we need to add? So you start adding flags, conditionals, and optional parameters. And this is when things get messy. The functio... | 110.079 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
conflicting logic? Well, S3 and SFTP are transports, and the upload is an action. | 156.48 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
All the unique variables are coming from the transport, not the action. So, ideally, we'd have an upload function that just takes a source and destination path. Then, we can inject the transport dependency into that function. So, the logic on how to transport data isn't actually in the upload function. So, let's take a... | 162.56 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
S3 and then we have the upload of course that's just taking it in we have this upload data function that takes in the storage handler because all these objects are based off of this. So the only real requirement is we have the upload function that's shared with the I guess child classes and it just takes in the same pa... | 212.44 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
have to have a little bit complexity there, right? Maybe we need a number two. Um and then if we wanted to use this all we do is call upload data and then um data and then pass in our object which is going to be con and then the source and destination which is going to be let's do data set.json because we're going to u... | 261.199 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
There's no conditionals, no optional optional flags, just clean, predictable behavior. Not only does it make it easier to use the library, but the function tells you exactly what it needs. So it's easier to write unit tests for additional transports and maintain. So let's go back to this function, right? If we wanted t... | 297.12 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
But if we're just calling it like weeks later when we don't really know what it is, we call upload peak at the like definitions and it's just giving us so many parameters. How do we use this? | 331.12 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
It's not very clear. If we're doing AWS, do we need the username password? I don't know. So, I have to go look at the code and see exactly what it is. It's just so much cleaner to do it with dependency injection. If we wanted to do um S3 again, we do con is equal to S3 handler and then we can just look at exactly what ... | 342.08 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
upload data, and that's very easy. We can just easily create a mock or something like that. And then testing each S3 and SFTP becomes easy because we just have to think about how to connect to this service and how to upload specifically to this service. The testing logic here would just be all over the place because th... | 389.44 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Um there's one last thing I wanted to talk about, but um oh um if we wanted to add like Azure handlers to this, like we just create a new object and there's no way that can cause an error because our upload data doesn't really have any additional logic. So if we just added a new class here, it's not changing the code f... | 412 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
So it's a much more reliable way to be able to edit this code without risking breaking something else. So, um, hopefully I've convinced you that dependency injection's a good thing. So, now let's go take a look at it in our LDAP injector. Opening up zed, we can get to where we left off in the last episode. Now, think a... | 434.96 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
And then afterwards, we're going to create another one and use a different way to um talk to HTTP, probably the fast HTTP thing to see if um it goes any quicker. Right? So let's do a new type and I'm going to call this net http brute imple for implementation. That's of course going to be a strct and I'm going to get a ... | 478.479 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
I would approach this. But we haven't gone over like vetic functions and things like that to make this really easy. Um, what I'm talking about there would be if we had let's just create a new function real quick. Um, I'll call it print lines. And then we can say lines dot dot dot string or maybe we'll do line, right? A... | 533.2 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
thing as this. Hold on. Like this because that's what the line gets treated as. But if we had it as a slice, then we don't have all like these commas. So we'd have to specify it by defining a slice of string. So it' kind of look like this, which makes calling the argument more messy. I say this because I'd like the pay... | 598.16 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
It's actually going to be somewhat challenging to code in a good way to make it really flexible. So, I'm going to hold that for a future episode. Um, so let's get rid of the payload. We'll just hardcode the username, keep the logic kind of the same how we have been. | 649.92 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Um, if you want to try to make it flexible, that can be a challenge for you to do on your own and maybe I'll um create that episode. Um, let me know in the comments. So, we have the username. | 663.519 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
What else do we need? Oh, we need the headers because I don't want to hard code all the headers. And this is going to be a little bit um different if you're not used to like how to define things and just depend on Python's dynamic typing. We're going to do a map of a slice of string of string. And this is looking confu... | 672.56 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Let's do expected um status code. And that'll be an integer because in this case, uh 303 is what we have for valid password. But maybe in the future like 200's a valid password and 500's invalid or something like that. So I definitely want to have like expected status code. | 706.72 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
And once we go into like functional option patterns, we may have more things like expected string, expected status code. But since we don't know how to do optional arguments yet, um it would be really messy to call this function. So now that we have that, let's go ahead and create our new object to create this. So I'm ... | 725.279 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Right? This is how it's passing. We have method URL and username as a string. | 753.12 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Expected status code as an int and headers looks fine. Now the only thing I'm going to change here is the method. | 757.44 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
I'm going to call strings.2 upper on the method because I'm used to HTTP verbs always being uppercase. Um I'm not sure if that's the case, but it just makes sense in my mind to do that there. So that way if we passed in post as lowerase, it still will be uppercase there. And now we have to add this to the Ljap injector... | 764.72 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
password of a string. And then I really wish we could just pass in error, but we haven't gone over error handling yet. So we're going to do um bull error as the return. So what this interface allows us to do is use any implementation as long as it contains all the methods in the interface. So for this LDAP injector, we... | 816.399 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
don't have a URL anymore. We just have the client which is going to be an injector. And then we can do um client is equal to client here. And that should be good. And the function we're going to play with is this test password. So I'm going to rename this to do. And then this is also going to be part of the injector. S... | 876.88 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
It's actually not the interface. we have to do one for each implementation because all this logic is unique to the net http client. So this new request um this is no longer lil. This is now um curl. Uh payload looks fine. This is going to be C do username. Let's just do C do username like that. And then we also have th... | 905.839 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Maybe I should code that verb, but I think method makes sense as well. Um the headers, I'm going to just move these down at the bottom of the code so we can deal with them later. But we want to make our code dynamic. So let's go back to do and we're going to do a for key value and range of C do headers. And then we wou... | 943.6 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
to leave the redirect there. That's making the request. And then this is going to be um we have now expected status code. There we go. So now we can easily change the status code that we're looking for. | 999.199 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
And now we just have to update these functions. And this um ldap injector.test password is now like what? | 1,012.079 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
LDAP.client.do, right? Yep. That's how we now reference this. So now the test character doesn't have any like HTTP logic. LDAP injector overall has no HTTP logic. All it knows how to do is send payloads. So it knows, oh, I'm going to do first like a star to see if a password begins with a star. It doesn't know the whol... | 1,022.68 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
something like get file and then etsy pass WD right that's all the agent needs to read. you'd have a dependency injection that does HTTP and that makes it easier to add other transports to your C2, right? So, if we wanted our C2 to magically instead of doing HTTP to pull it from Slack, Discord, uh, Google Drive documen... | 1,077.44 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
think we have it in a few other places. | 1,128.64 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
I'm just going to quickly do um a search and replace to replace this. So we'll do li.est past password and we'll replace it with what was it? | 1,130.799 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
LII.client.do like this. And there we go. It's been replaced. And I think that is pretty much it. So let's go ahead and use this function now. So I'm going to create HTTP client and that's going to be a new HTTP brute implementation. And then the method is going to be a post request. The URL this is going to be HTTP in... | 1,140.039 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
The username of course is gett temp principle. And then what else do we need? I'm going to delete everything here. Um I'm just going to peek at the definition real quick. Uh let's see. We did method URL username expected status code. So that's going to be a 303. And then the headers. This is going to be where it gets a... | 1,169.36 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
There we go. And we don't need this. We change this to be a colon, comma, like that. Let's go back to this and again change that to be a colon. So it's just key value and then we close that out and I think do a parenthesy, right? Yes, that is good. Um, yeah, that looks fine. So now in our LDAP injector, we don't want t... | 1,212.72 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Um, let's see. I just want to peek at LDAP injector here because we did not change the username. So let's delete that because we no longer have that in our function. And I think this is good. So let's test this out. So, I'm going to save this. We can do a gor run dot and just see if it works. It's probably going to tak... | 1,255.039 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Maybe it's a little quicker. I guess while it runs, we can start um changing things up because what I want to do is put all this logic in its own file. Um we'll wait for this to run and then start Oh, there we go. It's done. So, we found a partial password because um we limited the character set and removed one of the ... | 1,283.28 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Um so, uh let's make a new file. I'll call it net http.go. And then we're going to start moving all the unique logic in that file. It's going to make it easier to have other implementations. So, let's uh let's see. | 1,307 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
We need to move this first. | 1,323.76 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
So let's open the file net http that's package main. We'll put that line there. | 1,327.12 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
There we go. Let's go back to main and let's see the next thing we have is this implementation. So we can move this go to net http put that and then the final piece is going to be the do. So let's take this Yank that out. Put it down. Save. And I think everything should still work. I'm just going to do save. There we g... | 1,334.559 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Everything looks like it's working. So now we have the implementation isolated into this net http file, which is going to let me cheat a little bit. I'm going to go over to AI. I'm gonna give it the file of net http.go and I'm gonna say um can you replace the net http with fast http which is just another um golen http ... | 1,371.44 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
So, I'm going to go up here. Uh, let's see. Package main. Yank all that. Let's go here. Touch fast http.go. Uh, we can close the AI out. | 1,411.84 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Close that. Fast http put. And let's see. Uh, we probably have to rename this. It's no longer new http brute. | 1,427.039 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
It's probably new fat h fast http brute. | 1,436.88 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
And I don't see any syntax errors. Let's see. Are we still doing things? Yep, we're using fast HTTP now. We can see the code's a little bit different than net HTTP. We're setting up pools and stuff. Uh setting the method, the payload, setting Yep, everything looks good. So, what do we need to do here? Um Oh, we need to... | 1,442.12 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
right? I just um changed the client and we're now injecting the fast HTTP client in a LDAP injector. So that's um super easy to now be changing things out. I know that was not a good explanation. So let's do a echo net http run that and then echo fast http and run that. So um normally we probably wouldn't have to port ... | 1,508.4 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Also, um, thinking about it like if this wasn't LDAP, think about like if we wanted to send notifications, right? If you wanted to send notifications, you could have a giant if then logic saying if it's a text message, if it's SMTP, if it's Mailchimp, if it's a push message. | 1,557.44 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
You don't want to go through and have all the logic there. It would be just nice having all the transports as objects and then injecting them into your notification function. So it just decides how to send that message. It's just a lot more um cleaner way to deal with it. So I'm going to pause the video and we'll come ... | 1,574.48 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
the um other dependencies is if we had other HTB machines, right? It's very easy to just add different ways to do the payload and then inject that in. So all our functions here doesn't really change because all the um LDAP injector needs to know is how to perform the LDAP injection. It doesn't need to know how to get t... | 1,620.64 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
um have to change the transport or like change how the HTTP request is formatted. Additionally, when we write unit testing, we can just test this logic individually. We don't have to test the logic along with the transport. | 1,672.48 | 0 | {
"video_id": "BhLpqRev80s",
"title": "Golang For Hackers: LDAP Injector - Episode 02 - Dependency Injection",
"url": "https://www.youtube.com/watch?v=BhLpqRev80s"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.