WEBVTT - This file was automatically generated by VIMEO

0
00:00:06.300 --> 00:00:10.100
Okay, guys, welcome to the next module the

1
00:00:09.100 --> 00:00:11.800
 basics of SQL map.

2
00:00:12.600 --> 00:00:15.500
We are going to cover different subjects as

3
00:00:15.500 --> 00:00:19.300
 mentioned in in the previous module, but

4
00:00:18.300 --> 00:00:21.600
 we need to start with the basics.

5
00:00:22.200 --> 00:00:23.200
So let's do it.

6
00:00:24.400 --> 00:00:25.900
Let's assume that.

7
00:00:27.300 --> 00:00:30.200
We've got this URL right? This is this is

8
00:00:30.200 --> 00:00:33.300
 the URL we are going to talk about this is

9
00:00:33.300 --> 00:00:36.800
 the URL like https example.com items details

10
00:00:36.800 --> 00:00:39.400
 dot PHP question mark

11
00:00:39.400 --> 00:00:41.900
 ID equal sign 13

12
00:00:43.100 --> 00:00:46.700
So as you will see in the demo in a few minutes, I

13
00:00:46.700 --> 00:00:50.300
 have some online shopping platform and

14
00:00:49.300 --> 00:00:52.200
 when you go to this URL, you

15
00:00:52.200 --> 00:00:55.300
 can see just the details of a given product in

16
00:00:55.300 --> 00:00:58.300
 an online store. Right? What is important here is that

17
00:00:58.300 --> 00:01:02.000
 we've got a parameter ID and potentially this

18
00:01:01.500 --> 00:01:04.100
 parameter can be vulnerable.

19
00:01:04.800 --> 00:01:07.600
To SQL injection and we want to

20
00:01:07.600 --> 00:01:11.300
 find out if this is really the

21
00:01:10.300 --> 00:01:11.600
 case, right?

22
00:01:12.600 --> 00:01:16.200
So in the basics, I'm going to focus on the URLs

23
00:01:15.200 --> 00:01:17.600
 and get parameters.

24
00:01:18.600 --> 00:01:21.500
In the upcoming modules, I

25
00:01:21.500 --> 00:01:24.300
 will cover more like for example post parameters. Okay.

26
00:01:24.300 --> 00:01:27.600
 So now we've got URL we've got get parameter

27
00:01:27.600 --> 00:01:30.300
 named ID and we want

28
00:01:30.300 --> 00:01:33.700
 to use sqlmap to find out if this

29
00:01:33.700 --> 00:01:37.300
 parameter is vulnerable to SQL injection

30
00:01:36.300 --> 00:01:39.100
 or not. How can we do it?

31
00:01:39.900 --> 00:01:42.400
We can do it in a very simple way, of course,

32
00:01:42.400 --> 00:01:46.000
 assuming that you have installed this tool

33
00:01:45.200 --> 00:01:48.100
 right? Just put SQL map

34
00:01:48.100 --> 00:01:51.600
 Dash you then in between the quotes

35
00:01:51.600 --> 00:01:54.600
 put your url. So this

36
00:01:54.600 --> 00:01:55.800
 what I already discussed.

37
00:01:56.400 --> 00:01:58.800
And then you see dash dash Banner.

38
00:01:59.800 --> 00:02:02.400
So from the very beginning - u means

39
00:02:02.400 --> 00:02:03.400
 just put the URL.

40
00:02:04.200 --> 00:02:08.000
And that's it. The program will automatically detect the

41
00:02:07.600 --> 00:02:10.500
 parameters and it will start

42
00:02:10.500 --> 00:02:13.900
 the testing the SQL injection

43
00:02:13.900 --> 00:02:16.500
 detection for every single parameter in

44
00:02:16.500 --> 00:02:19.800
 this URL. So this is it you need to just

45
00:02:19.800 --> 00:02:22.300
 put the URL here and that's

46
00:02:22.300 --> 00:02:25.100
 it. And that's just Banner is

47
00:02:26.800 --> 00:02:29.500
What's gonna happen when the SQL injection

48
00:02:29.500 --> 00:02:32.600
 is detected? So this is related to

49
00:02:32.600 --> 00:02:35.900
 a kind of proof of concept or exploitation. So

50
00:02:35.900 --> 00:02:38.400
 the idea of this tool is to find out

51
00:02:38.400 --> 00:02:41.400
 whether SQL injection is present or not.

52
00:02:41.900 --> 00:02:44.300
And once it is present I'm saying -

53
00:02:44.300 --> 00:02:47.600
 Banner, please extract the banner.

54
00:02:48.600 --> 00:02:51.800
Of this database just to have a proof of

55
00:02:51.800 --> 00:02:54.500
 concept right that I am able to fetch something

56
00:02:54.500 --> 00:02:57.100
 from the database as a result

57
00:02:57.100 --> 00:03:00.600
 of SQL injection. This is of course proof of

58
00:03:00.600 --> 00:03:03.400
 concept because the banner is well, the

59
00:03:03.400 --> 00:03:06.500
 banner is not very sensitive piece of data, but this way

60
00:03:06.500 --> 00:03:09.100
 you can prove that you can do something with

61
00:03:09.100 --> 00:03:12.600
 your SQL injection right in the upcoming modules

62
00:03:12.600 --> 00:03:17.400
 owl tell you more about powerful exploitation

63
00:03:16.400 --> 00:03:19.600
 how you can you know, extract

64
00:03:19.600 --> 00:03:22.600
 passwords of user front database and and for

65
00:03:22.600 --> 00:03:25.200
 example, how you can go from how you

66
00:03:25.200 --> 00:03:28.200
 can go from SQL injection to remote code execution, but for now

67
00:03:28.200 --> 00:03:31.600
 proof of concept, so you see the structure is very

68
00:03:31.600 --> 00:03:32.100
 basic.

69
00:03:33.200 --> 00:03:36.500
Now you can go and you can find out.

70
00:03:36.500 --> 00:03:39.800
 How do Works in practice but one question

71
00:03:39.800 --> 00:03:41.900
 before we proceed in this course.

72
00:03:42.900 --> 00:03:45.400
What about a cookie with session ID?

73
00:03:45.400 --> 00:03:47.400
 This is a very right question.

74
00:03:48.400 --> 00:03:51.500
Because there is always a question whether you

75
00:03:51.500 --> 00:03:54.800
 are testing in an authenticated state

76
00:03:54.800 --> 00:03:58.200
 or non-authenticated state what

77
00:03:57.200 --> 00:03:59.600
 I mean here is something like this.

78
00:04:00.500 --> 00:04:01.900
When you've got an online shop.

79
00:04:02.800 --> 00:04:05.400
You can go and see different products. You don't have

80
00:04:05.400 --> 00:04:06.800
 to be authenticated.

81
00:04:07.700 --> 00:04:10.800
That's why you can just put sqlmap Dash

82
00:04:10.800 --> 00:04:13.100
 you the URL dash dash Banner.

83
00:04:13.700 --> 00:04:17.000
And that's it. It's gonna work. You don't have to be authenticated. So

84
00:04:16.200 --> 00:04:19.700
 you don't have to provide the cookie

85
00:04:19.700 --> 00:04:22.600
 with your session ID in order to do

86
00:04:22.600 --> 00:04:25.500
 this kind of testing, right? So as long as you are

87
00:04:25.500 --> 00:04:28.300
 not authenticated you can just use

88
00:04:28.300 --> 00:04:31.200
 what I have already told you

89
00:04:31.200 --> 00:04:35.100
 but it may happen that a

90
00:04:34.100 --> 00:04:37.300
 given resource, right? You've got

91
00:04:37.300 --> 00:04:40.400
 a URL you've got some get parameters. It may happen

92
00:04:40.400 --> 00:04:43.600
 that you can just access this resource only

93
00:04:43.600 --> 00:04:46.600
 in authenticated state. In other words. You have

94
00:04:46.600 --> 00:04:49.700
 to be authenticated right? Then you have to provide

95
00:04:49.700 --> 00:04:53.200
 the cookie with your session ID. Otherwise, you

96
00:04:52.200 --> 00:04:55.200
 know, the SQL map will not be

97
00:04:55.200 --> 00:04:57.600
 able to do this kind of testing.

98
00:04:58.400 --> 00:05:01.800
So let me give you a good example for example

99
00:05:01.800 --> 00:05:04.400
 profile. Let's imagine that you need

100
00:05:04.400 --> 00:05:07.700
 to do some kind of testing of a profile and

101
00:05:07.700 --> 00:05:10.700
 when you want to do testing of profile,

102
00:05:10.700 --> 00:05:13.400
 you have to be authenticated, right so then you have

103
00:05:13.400 --> 00:05:16.600
 to specify manually your

104
00:05:16.600 --> 00:05:18.600
 cookie with session ID.

105
00:05:19.300 --> 00:05:22.200
Now just to show you how it works how

106
00:05:22.200 --> 00:05:25.300
 to specify this cookie. Let me just just one example, right?

107
00:05:26.100 --> 00:05:29.500
The only difference between the previous command and the

108
00:05:29.500 --> 00:05:32.500
 new one with PHP Sid here is that

109
00:05:32.500 --> 00:05:35.500
 you've got dash dash cookie

110
00:05:35.500 --> 00:05:38.700
 equal sign and in between the quotes,

111
00:05:38.700 --> 00:05:41.500
 you've got your cookie with session ID. So

112
00:05:41.500 --> 00:05:44.400
 my cookware session ID here is just an example.

113
00:05:44.400 --> 00:05:47.300
 PHP says ID equal sign

114
00:05:47.300 --> 00:05:50.100
 and oh i k blah blah, right.

115
00:05:50.700 --> 00:05:54.300
This is it. So remember if you

116
00:05:53.300 --> 00:05:56.600
 are testing the web

117
00:05:56.600 --> 00:05:59.800
 application in authenticated State, then

118
00:05:59.800 --> 00:06:03.000
 you just need to provide dash dash

119
00:06:02.300 --> 00:06:03.800
 cookie equal sign.

120
00:06:04.500 --> 00:06:09.000
And in between the quotes you need to put your session

121
00:06:07.400 --> 00:06:10.300
 ID. So the name of

122
00:06:10.300 --> 00:06:13.900
 the QQ you if session ID and the value of

123
00:06:13.900 --> 00:06:16.600
 this cookie, so you've got here the example showing

124
00:06:16.600 --> 00:06:19.400
 how how you can do it. Okay. So

125
00:06:19.400 --> 00:06:22.800
 now I want to jump to the demo now,

126
00:06:22.800 --> 00:06:25.700
 we understand the basics and now

127
00:06:25.700 --> 00:06:28.300
 you know how to test urls.

128
00:06:29.300 --> 00:06:32.500
For SQL injection, and now you

129
00:06:32.500 --> 00:06:35.200
 are smart because you know how to

130
00:06:35.200 --> 00:06:38.900
 do this kind of testing in terms of authenticated State

131
00:06:38.900 --> 00:06:41.900
 and non-authenticated State now,

132
00:06:41.900 --> 00:06:44.500
 you know how to provide a cookie

133
00:06:44.500 --> 00:06:47.300
 authentication cookie or cookie recession

134
00:06:47.300 --> 00:06:50.500
 ID to the SQL map. So that's

135
00:06:50.500 --> 00:06:54.200
 cool, you know the basics now, let me show you how all

136
00:06:53.200 --> 00:06:56.700
 these things work in practice.

137
00:06:56.700 --> 00:06:58.700
 So let's jump to the demo.
