k3nn3dy commited on
Commit
f9df4f6
·
verified ·
1 Parent(s): 7ea426f

Add Automating_Boolean_SQL_Injection_and_Evading_Filters.jsonl

Browse files
Automating_Boolean_SQL_Injection_and_Evading_Filters.jsonl ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"text": "what's going on YouTube this is IPC and this is a follow on video to my Advanced SQL Union injection where I told a story about myself pent testing a web application that had SQL injection in the URL but there were some strict filters that prevented me from just doing normal SQL injection and exfilling data in that video I said I came across a technique after come talking to Tiberius and used it to um xfill all the data well at the start of the day I didn't use uni injection I had a lot of trouble with uni injection if you couldn't tell from that video and I actually built a Boolean injection because I think Boolean injection is a bit more flexible because when it comes to Union injection there's two ways you could do it you could got to do it with commas like 1 Two Three or you can go this weird convoluted route but when you do the convoluted route you introduce the star Wild Card which is a bad", "start": 0.08, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
2
+ {"text": "character if you do it without the Stars you have commas which is a bad character you can do it with Boolean injections without either of those additionally I just like Boolean ejection a lot because you can xfill data when the web server doesn't send you data right like with Union injection you depend on the SQL Server sending you the output of that query but with Boolean injection you just need true or false so something like a forgot password thing that may just return a Boolean you can XO data out of as well and anytime you can do a union injection you can probably do a Boolean injection that is not the same vice versa right so I do like booleans um they're a bit more flexible easier to work with when the payload but you do have to do some scripting because it is a pain to just automate right so we're going to do all of that in this video", "start": 48.48, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
3
+ {"text": "but first uh let's look at the code um so I just built a simple app and I just extended it from the previous video um so if you watch that this is going to be very familiar I just added this forgot username endpoint where we do have a raw SQL query right here which in a Python program is definitely odd most of the time you'll be using SQL Alchemy so your queries look like this but if you wanted to write raw SQL you should use some type of Escape function or prepared statements prepared statements is probably the better way this is just passing raw input from the URL straight into the query so later in the video we'll just put a single quote here so we can modify the query where however we want right and then if you're also wondering what this little red squiggly Mark is this isn't telling me the code is invalid that's actually the sponsor", "start": 97.159, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
4
+ {"text": "of this video sneak telling me the code is vulnerable so if you don't know what sneak is well first off welcome to this channel because I use sneak all the time whenever I code things on this because it just makes it so easy to find vulnerabilities or not even when I code whenever I'm just doing a CTF challenge I load it up in sneak because it's a platform that scans your code dependencies containers all in real time to help you find and fix vulnerabilities if we go over to the sneak tab we see the open source security that's going to scan this requirements. text which is all my dependencies for vulnerabilities in this case there is none if I had like a vulnerable version of um what is it like python pickle it would go and highlight that then we have the code security this is scanning all the custom", "start": 151.959, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
5
+ {"text": "code and pointing out vulnerabilities it pointed out a um cross state scripting injection that it did not mean to introduce into this application and then we have some SQL injection here in the forgot user endpoint and this one in the just user endpoint as well this is covered in the advanced Union injection video we're mainly going to be focused on this endpoint but not only does it point out the vulnerabilities it will go and tell you how to fix them so this is using MySQL DB's Escape string functionality to fix it then if we wanted to there's another Library if you have trouble using that one this is recommending the pi MySQL Escape string function and then the third one probably the best way to fix this vulnerability and that is going to be using a prepared statement so if you want to get started with sneak it is completely free just go to a browser go to sneak", "start": 196.4, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
6
+ {"text": "doco and sign up I can't stress how cool this um software is so give a huge thank to sneak because without them I probably wouldn't be doing these videos where I just do deep Dives on specific things like Boolean injection so let's go and show what a Boolean ejection is if I go to Local Host 5,000 uh forg gopac we can see the application's not running so let us start up the app and I do have a CTF scripts repo on my GitHub if you just go to the Dockers you can spin up your own Docker of this environment if you wanted to um go along with me so the forgot password if I do ipsec is just telling me to result zero so IPC does exist if I do a user that doesn't exist let's say does not exist the result is one right so Boolean injection comes in when we can say IPC let's do a user that doesn't exist like", "start": 247.519, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
7
+ {"text": "if and then we can say or one is equal to one and then we can do a comment and we get a validation error um we have validation error for name model username because equal is a bad character well we can also use other statements um if we went to mySQL comparisons I want to say let's see if this works for me uh compare and equal functions and just reading a lot of the documentation we have other ways we can do it like we're trying the equal operator right here there is like there's also between there's in not like string compare there's a bunch of other things we could do so let us go back to our query instead of one equals one we can do one like one and now the result is zero because um while this user doesn't exist this is an or and this one is always going to be like one right if we change that like two we get result of one so this is the concept of Boolean", "start": 308.28, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
8
+ {"text": "injection we could do this in burp Suite so the font is a little bit bigger but bur Suite is going to have a weird Quirk I don't like so if we go in here we have this I can highlight everything do control shift U we go back to this um the whole concept of bulling injection is we can extract data from the database so we could say like select one this is going to be the same thing as like one because select one just outputs one if I highlight this press control U it puts them in spaces and spaces are not the same in URLs and we get bad syntax uh we could rightclick and convert selection URL all in characters and then we get this um let's see or select one that should be a valid thing let's see maybe that's not valid syntax um let's go with percent 20s it's also possible I didn't encode that space yeah there we go but because of", "start": 373.16, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
9
+ {"text": "this Quirk I'm going to get out of burp Suite because I built a small python command line client that I called um inject C.P all that's going to do is give us a terminal prompt and then replace anything we input with a space and send it over to the um request so if I do Python 3 SQL inject we can say IPC we get result one uh zero if result one and then we can copy and paste what we just did here and we get result zero we can say select one like two we get result one so this is the concept of Boolean injection leaking things one character at a time and by the end of this video you're going to find out how you can leak entire um columns and information out of it through this technique right so if we go select schema name this is going to be all the databases from information schema. schemata if you're familiar with SQL injection um this is like everyone's", "start": 440.639, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
10
+ {"text": "first step because this is going to tell us what database names exist in this database if you're not familiar go to ic. ro search SQL injection and watch some videos of me going through this um in the future I'll probably do a video specific on just enumerating my SQL but we have a validation error because this underscore is a bad character so unfortunate for us we can't enumerate information schema I don't think there's any any way you can cast this differently like if we converted this to hex and put it here it's still not going to work so I don't think there's any way we can avoid that underscore um I could just modify my bad characters to allow that but that's not fun right I've never really enumerated a database in videos where we couldn't show that so what we could do is we can just say select let's", "start": 513.64, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
11
+ {"text": "actually jump over to my SQL so I'll do stud my SQL uh use demo because that's the name of this database and if I do select star from users this is the valid um table right if I did select star from user I get an error so now the issue is I want to get rid of this star well I can do select one from user or users and it just returns all ones from me so that's what I'm going to do here I'm going to do select one from users and this limit one is key if I don't have limit one it's going to return multiple rows which is going to be error because this is going to be like an array because it has multiple items and this is a string and that's how it erors out but we can do this we get result zero or because that was success because we did a select one and everything here was one with that limit we're good if we wanted to we could even validate saying like two result one so", "start": 566.16, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
12
+ {"text": "this is how we can enumerate the users column or any column we want right if we put something that doesn't exist we get an error and the whole reason we did this select one is so we can only get we only have to guess one thing at a time right because if we didn't do select one let's say we did user here and users here it's going to error even though we got this one correct correct this name is wrong it's actually username right so by doing the select one it makes the query valid and we only have to guess this one parameter so we could go and throw this into fuff or something like that and fuzz for all the valid column names of the database we are in we can't easily pivot out of the database because we don't know other database names but we can get all the information out of our current database through just guessing", "start": 632.279, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
13
+ {"text": "right so uh let's see I typo that pretty badly so now we have this and again you can guess the um column name through guessing as well right now the next step is how do we xill data right we know this the first entry is equal to IPC so before that how do we go to the second one if I do limit two we get an error right so how do I get other entries out of this so let's just go over here username from users limit uh one is what we did we did two it returns two generally you do one comma one and that's how you can go through different things so this the first number here when you do limit with a comma it's going to be which entry you want so the offset and then the second one is going to be how many things you want if I just do two it's going to go give me two things it's going to give me three things right I want it to give me the third but only one and that's how we go", "start": 689.48, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
14
+ {"text": "through that and the reason why we got rocks is because this counts from zero so this is how we can switch this but if we went and did something like that we can't use a comma because that is a bad character so if we went back over to mySQL uh let's do the select statement and I'm going to take burp Suite off and we look at this and just start reading oh we actually want to go to the MySQL docs I always like just reading the developer documentation than what people try to teach you because it gives you a lot more information right so if I look here here we're at limit and it has this so we have the offset if it's in these brackets that is optional then row count and then pipe is an or so we have row count offet then the offset and this one syntax is a little bit confusing because you would think we can just say offset one and be done with it but it", "start": 767.079, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
15
+ {"text": "actually swaps where the offset is right when we spell out the word offset offset is at the tail end of the query when if we do it with the comma it's at the beginning so little bit weird there but if we do um limit one offset two that is the same thing as 2 comma 1 right so hopefully that small piece makes sense but that is how we can now move the um the cursor so limit zero offset one like IPC uh let's see Zero offset one that returns nothing one offset one let's see offset zero I am confusing myself so one one we get please subscribe 01 we get IPC so we're going to do one Z offset there we go like I said I get confused so there we go we have result is zero if I go one this one now was Please Subscribe and we could guess that and show it this way but you're not going to xill any data guessing complete words at a time we want to go to individual characters", "start": 833.56, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
16
+ {"text": "so the way we do that is through the substring command so we can do select username let's get this to IPC down here we can say substring usern name uh if we let's do comma one one that gets I we can do 21 that gets P if we did 1 three we get it so this is going to be be the number of characters and then this is going to be the offset and the tricky thing here when you do a substring it doesn't start with zero it starts with one but when we do a limit it starts with zero so that's going to be the confusing thing like to me is where it starts okay so now we know substring but we have commas again and commas we already know don't work in our payload so let's go back to um Google let's do my SQL sub string and let's see what it tells us if we go back to Strings and functions here's all the functions there", "start": 933.279, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
17
+ {"text": "are let's see substring a reg substring and we got substring here and it tells us we can do a from and a for so that is the same as the commas so let's try username from one for one and there we go that's just an I so we can go here and do substring username from one 14 one from users and then it's going to be like I and result zero like a is result one so we can now move this so we can say from two it's no longer I it is now a so this is how we can start enumerating data out of the dat database there is going to be one other trick that I like doing when it comes to programming is I hate treating things as characters I'd rather just convert it to a different format um I'm going to convert it to ordinal because it's easier for me to work with for my script um so I do man ask it we can see all the", "start": 998.72, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
18
+ {"text": "values So like um capital A if we convert it to hex would be 41 decimal would be 65 if we did J that' be 4 a decimal is 74 the reason why I'm going with decimal format is going to be I may have called it ordinal um I get things mixed up but we're going with decimal is because I don't have to deal with hex I'd rather just deal with numbers because um if we're doing less than greater than and it's treating it as an integer when we're really in HEX it's going to be a wrong number so it's easier if I just stay with integer which will be decimal um so let's see is it select one we have one if I do or one we get 49 so that's why I called it ordinal format um if we do ORD a 65 let's go back to the man page capital a decimal 65 so let's go here we can say um not burp sweet there we go so let's say select or substring to for", "start": 1068.44, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
19
+ {"text": "one like and what is this number uh we're doing P right now so let's look for p let's see where is it up here it's going to be 112 like 112 uh let's out of habit I always go to burp Suite there we go result zero 113 result one so why I like converting it to numbers is we can now do greater than or equal to however greater than is a bad character so what we want to do is the between um I know I saw it before on documentation I don't know there we go between and so we can do between two values so we can say um between 0 and 113 if we do this we get result zero if we did between 113 and 200 we get result one so by converting it to the number we have now just eliminated like uh what is this 807 possibilities and one query so that makes your thing so much faster when you can do ranges so we're going to do um when we code the script we're", "start": 1147.44, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
20
+ {"text": "going to use this functionality the only thing I haven't shown yet and I forgot to is you can get lengths of data so let's go all the way back let's remove the substring and I'm just going to say length um username limit was it one yeah one offset zero so this is IPC and then we can say like one uh length username that errored what is the error there I screwed something up um or select length username let's try this select length I noticed soon as I started typing typo there we go so it's not one two three four five six so IPC is six characters long which it is true so we're going to use all of what I just said and create a program to automate all this extraction um so hopefully it made sense if not it may make sense once we put the program together if it doesn't make sense after then definitely rewatch the video and", "start": 1232.84, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
21
+ {"text": "then you can also ask comments or ask questions in the comments and I generally do a good job at answering them if you were verbose and how you ask them just don't say this doesn't make sense say why or what time stamp you're at so let's go over into the coding but before I go in the coding I'm going to pause the video and take a quick drink starting to enumerate and we go through our entire key space which means we make all of our guesses and let's say we only guessed A through Z and the field was a uh a comma right then our function would probably return saying um the length like it returned nothing so we assume we got the entire row but if we knew the length of the row before if we enumerate or key space and don't get anything but we're not at the last spot in a row then we'll know that this is", "start": 1312.799, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
22
+ {"text": "just not in a keyspace and we can make adjustments um and then the final thing we want is um get the data right so let's start off with a function forgetting rows and columns so I'm going to do Define row count and all we want is the table and then we can say we default the max to be 64 different rows okay so let's create a payload real quick and the first payload like before I do any enumerating I'm going to validate a ma a good and bad request so we know everything is working um so we'll do um f and then a or select um count so the count is going to return how many things and I'm going to use one here because um we really don't care with um how much we're turning right so we can say count one from users and we just get five if we do all ones we get everything if we did user uh username from users we get the things but I'm just doing one so we don't have to know a valid column we could do star but that", "start": 1363.44, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
23
+ {"text": "would make a bad character right so that's why I do one um and then we can say from table let's see like this and then we can say not like zero and then this one can be matched is equal to requests.get URL plus payload and we need to Define URL so we can say URL is equal to http Local Host Port 5000 forgot like that there we go I forgot the a here and then we can change payload to to say like zero and I'll call this unmatched so let's just print matched.", "start": 1445.88, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
24
+ {"text": "text and unmatched. text and see what we get so I can just say um row count users and we can print oh we don't even return anything so let's just do this going to run it and let's see what data it gets come on Local Host 5000 so the Matched is going to be zero that's good unmatched is one which is good so here we can say um if the Matched is the same as unmatched then we're going to raise an exception and say cannot identify number of columns and we can say in table and then could put Match text unmatched text so what I'm doing here is just putting the exception so I do try we can do this and then we can put accept and then or we need accept exception as e print e there we go so if I made this does not equal which which we know it doesn't so we're just going to trigger this exception it's now going to come back and tell", "start": 1512.039, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
25
+ {"text": "me that everything like it couldn't identify a case right with Boolean you need to know um true or false and if you can't do that you can't extract data so at this point we can just exit but now we know um what a good query and a bad query looks like so we can say for I in range then 0o to Max and say the payload like this so a select one from table like I so now we're going to make a request it's going to start at zero it's going to get unmatched one unmatched two unmatched three four five then hit six and then it's going to be Su uh I think there's five users so it would get to five I think so we do that say R is equal to request get URL payload and then say if r. text does not equal the unmatched or we can say is equal to match.", "start": 1626.159, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
26
+ {"text": "text I would probably do unmatch just because I think it's if the page does return some data Maybe This is better I don't know um we can return I and then if we don't get anything we can raise an exception that looks good could not identify number of columns and table there we go okay so let us run this we run it hopefully tell me five or six we didn't print any data so we can try print row count we got five and that is right because we have 1 two 3 four five users so now we've identified the number of rows so going to copy this and we're going to use very similar Syntax for the length of the current row so let's see we do um let's see we can call this function column length we give it the table and the column and we also need to give an offset and the offset is going going to be what entry right so if it's zero it's", "start": 1700.2, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
27
+ {"text": "going to be ipac if it's one it's going to be please subscribe to Boolean that's how it's going to work so that's why we have offset okay so select length column from table and we can say limit let's go back here select users we did limit 0 offset one is it one offset zero that's probably it so one offset and then the offset okay and then not like zero that should be fine right here again we're just validating query work so here if we get unmatched it's probably going to be because like a column name doesn't exist or something like that right so this will be um cannot get column length and I'm going to take the match to unmatch piece off that should be good get this payload we can go here okay and now this like becomes I and I think this is all we have to do so we did select length column from", "start": 1800.0, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
28
+ {"text": "table is going to be limit the offset so I think that is good let us try this so we can say print um we called it column length then users username zero zero should be IPC which hopefully we get six hit F5 it's going to run and we get six if we change the offset to one which is Please Subscribe it's going to take a little bit longer to run but we're probably going to get 15 which is please subscribe so now we have a way to get the number of rows the length of each row now we actually have to get the data and this is where it's going to get a little bit complicated um because we're going to try to make this go a little bit quicker by using a binary search algorithm um technically probably not binary search because that requires the data set to be ordered this is going to be unordered um so it's probably a divide and conquer algorithm thank you space", "start": 1899.6, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
29
+ {"text": "Nomad for clarifying that in my dumping nosql data with python video that was also sponsored by sneak so essentially what I just said if you don't understand um the easy way to do this would just be hey is it a no that's annoying uh we could guess uh hey is it a no okay I'm going to guess B I'm going to guess C I'm G to guess D I'm going to guess e I'm going to guess all the characters right um so what we're going to say is um we're gonna take half and we're gonna say hey is it a through C no okay then it's going to be D through F okay then it's going to be e we're just going to keep pretty much having the data set until we get to what we want um it's going to make it go a lot quicker because instead of making like a 100 requests we make six and um it's going to make Boolean injection not so painful so let's start this out I can do uh defa", "start": 1972.96, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
30
+ {"text": "and then column data then table column offset and line is what we want want and then our key space because we're going to do the between statement because we want to avoid less than in greater than it makes this a little bit more hard to read I'm going to have a start and end um I don't know what those values are off top of my head so let's go to the man page of asky again I'm going to start with 32 I think 32 let's see yep that is decimal so we're going to start with 32 and then we're going to end with 126 okay so now we just want to do the same thing we've done in the past is make sure our request does work uh let's see here okay so now we're not going to do length we're going to do substring and then column and we can say um from0 for one if we did column for hold on one second let me see what happens so we", "start": 2030.12, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
31
+ {"text": "do select subring username zero was it from Yes uh username from zero for zero does this return anything it returns nothing that's probably how we want to do it so let's see um let's see hold on a second yeah that's exactly how we want to do it so this will never match anything so that is good so it's always going to be nothing the substring is done from table limit one the offset is good let's see oh I probably should clean up code up here this offset is going to be confusing we should say call this line real quick it's good there but when I'm thinking about this offset I want the offset to be in the column right so there we go so 0 one and this can be line there we go because up here in the Comm length I was using offset to get the offset which is row and down here offset is going to be within the string I'd rather not rename like you use that", "start": 2116.44, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
32
+ {"text": "same variable name twice because that confuses me I'd rather make them completely separate okay I think this is good we need to do substring here column from 04 Z these double froms are throwing me for a loop right here whenever I look at it offset like that I think that is going to be good um we could test this out real quick let us go to this and we'll say the column is username from users offset is zero for the first one and not like zero okay so that works so if we do not like on nothing we get a match if we do like then we do so this whole syntax does work if it doesn't well if we get matched this should be text I wonder if request just gives you text if you don't specify I'm surprised that didn't error earlier and let's see cannot uh perform substring I don't know what else to put there but that would be the error message that tells us it's in the column data field so here's where", "start": 2217.0, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
33
+ {"text": "we're going to start using the start and end so we can say while start does not equal and we're going to do end minus one because we're always going to divide in half I don't think end is ever going to equal start it's going to eventually be 33 I think or yeah I don't think it ever goes so I always think we want to do n minus one when we do this and then to start this off we can we want to get the difference so we can say difference is equal to the end minus start and let's see n minus dir we do want to divide it by two like that I'm doing int because if I did um let's see Python 3 uh let's do 32 / 2 we get a decimal so int is just going to make sure we just get 16 if we got a period that's going to be a bad character and potentially um screw up our SQL injection so that's why I did in there and this should get us the thing we", "start": 2327.76, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
34
+ {"text": "want difference is a bad word there so the guess is going to be start plus difference so what we're doing here is like I said we had uh three things and we wanted to only guess half right so we did the end minus the start so we get how many numbers there are in between those and then divide it by two so our start right now will be um halfway between the start and the end so maybe difference could be called halfway it's probably a better name okay so after that we want to start enumerating the actual payload so let's do payload like this and then here we're actually going to have to do the offset so um from I think this is going to be offset for one let's go back to our substring query to play with that so if we did one Zer this should be I right um liit one one one okay one one and we also have to convert this to", "start": 2408.4, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
35
+ {"text": "or so we get a number there we go and now the final thing is in instead of like we're actually going to use the between so we can say between the start and the guess okay so let's just send the request and check it so now we're sending it and then we can say if it is equal to the match so that means um we are within this so it matched the between instead of returning we're just going to say the end is now the guess okay and then else we're going to say the start is equal to the guess so what we're doing here is we go in this and we got is it between let's say 32 and 64 if it is between these two numbers then we're going to say okay the end is here if it's not between these numbers we're going to say the start is here and the end is going to default at 126 and I'm going to go between these", "start": 2506.8, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
36
+ {"text": "numbers right so that is what we are doing I'm G to do all those and statements um I guess we could print this real quick um between start and end so that'll be for debug purposes and let's see now once we get out of this Loop we only have two guesses left so let's copy the payload real quick so a offset like this that looks good so far limit want to get rid of the between and we're just going to say like start I'm going to make the request and say if r. text is equal to match.", "start": 2597.04, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
37
+ {"text": "text then we will return um the care start yep else the end okay so this Loop's going to get us down to where we just have two characters and then once we have two characters that's when we guess it's a lot of confidence I have in running this the first time but we're going to see how it works so let's do print then column data let's see the table is users the column is username the offset is going to be um I think one and the line can be zero I think I did that right let's run it and see what happens I'm curious where this fails uh cannot get subring we didn't even do anything so let's see this is probably going to be a SQL error issue if match is equal to that let's see request.get I'm just going to insert a breakpoint by clicking there we can run it and let's see what the debug says so debug console I can say match.", "start": 2671.76, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
38
+ {"text": "text internal server error so we likely have a SQL error so we did a let's just copy this go back here I swear we tested this so the column I had users name it's usernames I think that was it so this is why in all these functions I do put some type of Sanity check to make sure we are good um it's still errored so we can just grab this payload copy it paste it in and it does indeed error so let's see select substring it is username not usernames okay let us that is good there we go so we've passed that so now if I hit go there we go it works so we do between 32 and 126 um it was not so it did 79 and 126 then it was so it did 102 and 126 102 114 so it's doing testing like that um let's run it one more time and I can put characters there let's see car start maybe this will make more sense Maybe", "start": 2774.4, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
39
+ {"text": "but that is how the divide and conquer type of algorithm is going to work there so let us get rid of this print and we can put it all together and now I'm thinking about it this may be an ordered set of list so maybe it is binary search I am not an algorithm specialist this is just the intuitive way to speed up boing injection so we can get rid of all the prints so let's see we want to do the column count is equal to row count users and then we can say for I in range zero column count and then uh let's see so we're doing it for each column count we can say length is equal to this here is um the offset so this is going to allow us to dump all the columns let see if I just print this this would be Quick Print length right this should work we should get like six 15 um something else so that's the", "start": 2906.44, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
40
+ {"text": "length of all the columns if you haven't been folling around or following along that is going to be length of each of these strings okay so now we can do another loop so we'll do this one for x and range and then zero length and let's see we can print the column dat user users is this right so column data offset is going to be X so that's going to be where I am in the column that's correct line yep I'm just going to add a flush is equal to true the whole end is equal to um nothing does that to be Capital there we go um that's just going to make it so we don't print a line break after each one and then after the column we can do a print so let's see what this looks like we're going through and come on that is weird uh let's see why did we we lost one character and always have uh I guess that's a squiggly a tild I don't know what that is um oh that's because when we do", "start": 2993.68, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
41
+ {"text": "substring the um offset starts at one not zero so we just add one to each of those and that should work right we should get hipsack Please Subscribe yep that works you can see how fast this bulling injection is going it's making like it's guessing each character one at a time is able to go that quickly um I guess we should instead of just else return so we can say copy this so here is where we're returning the character we can say like end I hate how I have all those spaces at the end of that and then if our text return character end then else or we can just do a raise here raise exception um unable to get character let's see at offset online let's see if that works so let's change this to be zero like this how we had it I'm going to run it again and hopefully it will error and tell us yep there we go unable to get character at offset zero online", "start": 3095.52, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
42
+ {"text": "zero so our programs a little bit better now and let's see I guess we could show getting password hashers real quick so if we go here let's describe users password so if we did the password table or password column we can also get that data and you can see how quick it goes with special characters and all that um there's probably a lot of ways you can tweak this this is kind of just like a library for you now like you may want to code it so you can get um username like the user colon the password so it's a bit better like that I'll leave that up to you there is one thing I forgot to show that I'm shooting myself that I did not show earlier in this video and I hate that I put the webcam on so you can see whenever I do all the video cuts and that is I just want to show SQL map not working right", "start": 3213.799, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
43
+ {"text": "so if we do SQL map like this I'm going to give it all the help so we have a valid query here if we didn't do a valid query um it's going to 404 right away and error so I want to make sure the very first request it does is not a404 so I put a valid user here and then even when we run it will error out I'm trying to dump the data but it's erroring because even though we specify it's my SQL it is unable to fingerprint the backend database management system and still fails um the fingerprint it's using is just a command that is unique to um what is it uh I should blanking on the word unique to my SQL so if I look at this I'm just going to clear my screen rerun the app we'll rerun the SQL map and there's probably Flags to ignore this but it's trying to run geography area if we looked at like all the databases this is unique to my SQL", "start": 3284.92, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
44
+ {"text": "so that's why it's just putting in here because if this command succeeds then we know it is indeed myql um if it was a union injection uh it would just use the version Command right because um where is that pain it would just do version because it can read this right but we don't do that in bulling injection because if we did we'd have to go through this whole thing we don't just get data so with Boolean injection that's why is using that weird uh geography area because it's either going to fail or succeed where Union it can do version version exist on many databases but the output it gives is unique um so SQL map is going to fail there even if I think we bypass this fingerprint check since it can't talk to information schema I still think it's going to be a bit of a pain to get working because of all the bad characters and things like that so um I", "start": 3354.0, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
45
+ {"text": "really think having just the ability to script this out is instrumental right so I guess at the end of the video we can just go over exactly what is doing add a few more comments so let's see let's start with the program um I guess we should do what is it if name is equal to main like that then we can do a try accept so the first thing is going to be get the total number of rows to dump I guess that should be row count not column count there we go so we got this and then get the length of the current row and I guess I if I want to we can call that row that's a bit better and then I can call this offset there we go that's a bit more clean if you're trying to understand this so we get the current length of the row then we Loop over the um each character in the row and Export the data okay so let's go to", "start": 3413.559, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
46
+ {"text": "exactly what row count was so first off we're going to start um is our Boolean logic good so that's going to be all of this we're just testing is a Boolean logic good can we enumerate what is a success and a fail okay we can so now we're going to um guess the total numbers and you could also do the binary search algorithm in this as well right there's no reason we did 1 through 65 we could do is it between 1 and 32 okay it is 1 and 16 okay it is 1 and 8 1 and four and do it that way right so you could also put binary search in this piece okay okay so that's how this works we just get the um number of rows now we're going to get the columns so is a Boolean logic good okay and now guess the um length of column so again here we're selecting the length of the current column we know the current column because of offset and we're", "start": 3510.92, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
47
+ {"text": "saying like and that's going to be the guess I guess I could have put um guess as this so that makes some more sense right and then we raise exception and then um see test if our logic is good for guessing a character substring uh ver from zero for zero always returns null we can move this down here and we can say weird algorithm to speed things up okay so I think that's going to be it for the video um hopefully this all makes sense for you this query um we're going to do a select get a number the substring so where we are in the column from table limit offset start I'm running out of steam so that's going to be the video uh hope you enjoyed it leave comments uh this video is too confusing maybe I will redo it for a bit more Noob friendly I will definitely do one on just en numerating the information scheme at table so it's not hidden away in a big video also big", "start": 3599.68, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}
48
+ {"text": "thanks for sneak as a sponsor so take care guys and I'll see you all next time", "start": 3706.039, "duration": 0.0, "meta": {"video_id": "mF8Q1FhnU70", "title": "Automating Boolean SQL Injection and Evading Filters", "url": "https://www.youtube.com/watch?v=mF8Q1FhnU70"}}