-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
651 lines (605 loc) · 34.3 KB
/
index.html
File metadata and controls
651 lines (605 loc) · 34.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>App Sec Secure Coding</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.7.2/build/styles/arta.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav class="navbar navbar-dark bg-dark" aria-label="First navbar example">
<div class="container-fluid">
<a class="navbar-brand" href="#">App Sec Secure Coding</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar_main" aria-controls="navbar_main" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar_main">
<ul class="navbar-nav me-auto mb-2">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Some Link</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="p-5 mb-4 bg-light rounded-3">
<div class="container-fluid py-5">
<h1 class="display-5 fw-bold">Hello Coders!</h1>
<p class="col-md-8 fs-4">Welcome to the Secure Coding Principles CTF! This is geared towards beginners to both App Sec and CTFs. People on a more professional level may find this easier to do, but perhaps you can still learn something new. There's a catch with this category of CTF, however. Unlike traditional categories. You only have *one* chance to enter a flag. Guessing will not help you here. Regardless of what answer you select, you will receive a flag. So be sure to analyze before selecting. If you happen to mess up, no worries! Refreshing the page should help when looking for a new flag, but remember you can only enter one flag, per challenge, per team! To explain more in-depth of what you're looking at here, we will provide some background information on what the question is asking, so if you don't know what the question is asking, it will explain and define it to help solidify your knowledge, and guide you to the answer. This category was inspired by OWASP's Secure Coding Dojo.</p>
<a href="#getstarted" class="btn btn-primary btn-lg" type="button">Get started</a>
</div>
</div>
<div class="container-fluid">
<div class="row" id="getstarted">
<!-- Section -->
<div class="col-lg-12 mb-3">
<div class="card mr-2 ml-2">
<div class="card-header">
<h5>Input Validation (Freebie)</h5>
</div>
<div class="card-body">
<p class="w-75">
Select the text best describing proper input validation.<br/>Click on the text/code block best describing the description. In this case the first answer is correct.
</p>
<hr>
<!-- Question block -->
<div class="question-block">
<p class="w-75 fw-bold">Q1:The question would normally go here, about input validation, or any topic, but this is a freebie, enjoy!</p>
<div class="row">
<div class="col-sm-6">
<a href="#!" class="block-link" flag="ASV{Y0u_4R3_Luck4y}" >
<div>
<pre>
<code class="javascript">
Using PHP to check that an order quantity is numeric and not a negative number
</code>
</pre>
</div>
</a>
</div>
<div class="col-sm-6 mr-3">
<a href="#!" class="block-link" flag="ASV{PHP_1s_H4rd}">
<div>
<pre>
<code class="javascript">
Displaying a text box informing the user that only numeric values should be used
</code>
</pre>
</div>
</a>
</div>
</div>
<div class="alert alert-primary collapse" role="alert">
<strong>Your flag: </strong>: <span class="AlertMsg"></span>
</div>
<hr>
</div>
<!-- Question block end -->
</div>
</div>
</div>
<!-- Section end -->
<div class="col-lg-12 mb-3">
<div class="card mr-2 ml-2">
<div class="card-header">
<h5>Deserialization</h5>
</div>
<div class="card-body">
<p class="w-75">
Serialization is the process of turning an object into a data format or byte stream that can be restored at a later time. Deserialization takes this serialized data and transforms it back into a data object. Unsafe deserialization of un-trusted data, such as that provided by the user, can lead to arbitrary code execution. This could then be used as an entry point into a system, and is bad news for you. </p>
<hr>
<!-- Question block -->
<div class="question-block">
<p class="w-75 fw-bold">Q2: Which code block handles un-trusted data in a safe manner.</p>
<div class="row">
<div class="col-sm-6">
<a href="#!" class="block-link" flag="ASV{th4nk_y0u_4_pl4y1nG}" >
<div>
<pre>
<code class="javascript">
@app.route('/', methods=['GET'])
def index():
user_obj = request.cookies.get('uuid')
if user_obj == None:
msg = "Invalid user. You're all set now!"
response = make_response(msg)
user_obj = str(uuid.uuid4())
response.set_cookie('uuid', b64encode(json.dumps(user_obj)))
return response
else:
return make_response("Hey there! {}!".format(json.loads(b64decode(user_obj))))
</code>
</pre>
</div>
</a>
</div>
<div class="col-sm-6 mr-3">
<a href="#!" class="block-link" flag="ASV{4M_1_C0rr3ct}">
<div>
<pre>
<code class="javascript">
@app.route('/', methods=['GET'])
def index():
user_obj = request.cookies.get('uuid')
if user_obj == None:
msg = "Invalid user. You're all set now!"
response = make_response(msg)
user_obj = str(uuid.uuid4())
response.set_cookie('uuid', b64encode(pickle.dumps(user_obj)))
return response
else:
return make_response("Hey there! {}!".format(pickle.loads(b64decode(user_obj))))
</code>
</pre>
</div>
</a>
</div>
</div>
<div class="alert alert-primary collapse" role="alert">
<strong>Your flag: </strong>: <span class="AlertMsg"></span>
</div>
<hr>
</div>
<!-- Question block end -->
</div>
</div>
</div>
<!-- Section end -->
<div class="col-lg-12 mb-3">
<div class="card mr-2 ml-2">
<div class="card-header">
<h5>Output encoding</h5>
</div>
<div class="card-body">
<p class="w-75">
Encoding user data when outputting it prevents attacks such as cross site scripting. Protecting from XSS attacks requires developers to consider how data is being displayed on a page. If the data could come from a user’s input in any way (including through the site’s URL), then correct encoding of the output has to be considered.
</p>
<hr>
<!-- Question block -->
<div class="question-block">
<p class="w-75 fw-bold">Q3: Select the code that properly encodes</p>
<div class="row">
<div class="col-sm-6">
<a href="#!" class="block-link" flag="ASV{S4t4n_5ays_H3ll0}" >
<div>
<pre>
<code class="php">
<script>var username="<?php echo(stripslashes($_GET['username'])); ?>";</script>
</code>
</pre>
</div>
</a>
</div>
<div class="col-sm-6 mr-3">
<a href="#!" class="block-link" flag="ASV{Du_h4St_m1cH}">
<div>
<pre>
<code class="php">
<script>var username="<?php echo(htmlspecialchars($_GET['username'])); ?>";</script>
</code>
</pre>
</div>
</a>
</div>
</div>
<div class="alert alert-primary collapse" role="alert">
<strong>Your flag: </strong>: <span class="AlertMsg"></span>
</div>
<hr>
</div>
<!-- Question block end -->
</div>
</div>
</div>
<!-- Section end -->
<div class="col-lg-12 mb-3">
<div class="card mr-2 ml-2">
<div class="card-header">
<h5>Generic Error Codes</h5>
</div>
<div class="card-body">
<p class="w-75">
Generic error codes are used all over the web; This makes it unaversally understood what, and where, something went wrong in case of an error. It is a good practice to give as little information as possible in an error code to prevent any threat actors from using this information in their recon to their advantage. For example, if a threat actor can fuzz for different pages, and see which pages exist and don't exist via HTTP error codes, this could be harmful to your application.
</p>
<hr>
<!-- Question block -->
<div class="question-block">
<p class="w-75 fw-bold">Q4: Which one of these options is considered a generic error code?</p>
<div class="row">
<div class="col-sm-6">
<a href="#!" class="block-link" flag="ASV{Pu5h1ng_L3ft}" >
<div>
<pre>
<code class="javascript">
HTTP Error 500 (Internal Server Error)
</code>
</pre>
</div>
</a>
</div>
<div class="col-sm-6 mr-3">
<a href="#!" class="block-link" flag="ASV{J4_z3k3r_W3L}">
<div>
<pre>
<code class="javascript">
Your search did not return any results. Please try again with other information
</code>
</pre>
</div>
</a>
</div>
</div>
<div class="alert alert-primary collapse" role="alert">
<strong>Your flag: </strong>: <span class="AlertMsg"></span>
</div>
<hr>
</div>
<!-- Question block end -->
</div>
</div>
</div>
<!-- Section end -->
<div class="col-lg-12 mb-3">
<div class="card mr-2 ml-2">
<div class="card-header">
<h5>Server Side Validation</h5>
</div>
<div class="card-body">
<p class="w-75">
Server Side Validation is important when handling data of any kind, especially user-provided data.<br/>Server side validation ensures that the data is receives is what it expects to receive, to prevent any issues.
</p>
<hr>
<!-- Question block -->
<div class="question-block">
<p class="w-75 fw-bold">Q5: Which code example demonstrates server side validation? </p>
<div class="row">
<div class="col-sm-6">
<a href="#!" class="block-link" flag="ASV{S3cur3_C0d1ng}" >
<div>
<pre>
<code class="php">
if (isset($_POST['counter'])) {
$counter = $_POST['counter']
if (is_numeric(counter) && intval(counter) > 0) {
$GLOBALS["total_counter"] += intval(counter)
}
}
</code>
</pre>
</div>
</a>
</div>
<div class="col-sm-6 mr-3">
<a href="#!" class="block-link" flag="ASV{D0_1_W4nnn4Kn0w}">
<div>
<pre>
<code class="php">
$GLOBALS["total_counter"] += intval($_POST['counter'])
#don't make things more complicated than they have to be!
</code>
</pre>
</div>
</a>
</div>
</div>
<div class="alert alert-primary collapse" role="alert">
<strong>Your flag: </strong>: <span class="AlertMsg"></span>
</div>
<hr>
</div>
<!-- Question block end -->
</div>
</div>
</div>
<!-- Section end -->
<div class="col-lg-12 mb-3">
<div class="card mr-2 ml-2">
<div class="card-header">
<h5>Cross-Site Request Forgery Prevention</h5>
</div>
<div class="card-body">
<p class="w-75">
Cross-Site Request Forgery Prevention, or CSRF prevention, is ensuring that incoming requests originate from the user's action on your website, and not from a malicious third-praty site your user happens to browse. There are many ways in which a malicious website can transmit such commands; specially-crafted image tags, hidden forms, and JavaScript XMLHttpRequests. It is the attacker's end goal to cause a victim to unknowingly submit a malicious web request to a website that the victim has privileged access to, and allows unauthenticated users to preform actions that would normally be allowed to only authenticated users with certain privileges.
</p>
<hr>
<!-- Question block -->
<div class="question-block">
<p class="w-75 fw-bold">Q6: Which code block prevents CSRF?</p>
<div class="row">
<div class="col-sm-6">
<a href="#!" class="block-link" flag="ASV{51n4s4pp3l54p}" >
<div>
<pre>
<code class="php">
if (!empty($_POST['token'])) {
if (hash_equals($_SESSION['token'], $_POST['token'])) {
// Proceed to process the form data
} else {
// Log this as a warning and keep an eye on these attempts
}
}
</code>
</pre>
</div>
</a>
</div>
<div class="col-sm-6 mr-3">
<a href="#!" class="block-link" flag="ASV{5n0rf13ts}">
<div>
<pre>
<code class="php">
if (!empty($_POST['token'])) {
if ($_POST['token'])) {
// Proceed to process the form data
} else {
// Log this as a warning and keep an eye on these attempts
}
}
</code>
</pre>
</div>
</a>
</div>
</div>
<div class="alert alert-primary collapse" role="alert">
<strong>Your flag: </strong>: <span class="AlertMsg"></span>
</div>
<hr>
</div>
<!-- Question block end -->
</div>
</div>
</div>
<!-- Section end -->
<div class="col-lg-12 mb-3">
<div class="card mr-2 ml-2">
<div class="card-header">
<h5>Principle of Least Privilege</h5>
</div>
<div class="card-body">
<p class="w-75">
The principle of least privilege is pertaining to reducing the amount of permissions a user has on a system. This helps protect data, credidentials, and assets. The principle of least privilege functions on the assumption that everyone and everything is a potential threat, therefore your privilege is restricted to strictly what is necessary to get the job done.
</p>
<hr>
<!-- Question block -->
<div class="question-block">
<p class="w-75 fw-bold">Q7: Which example demonstrates the principle of least privilege?</p>
<div class="row">
<div class="col-sm-6">
<a href="#!" class="block-link" flag="ASV{Purpl3_T34m}" >
<div>
<pre>
<code class="bash">
guest@kali:/$ cd adminfolder/
guest@kali:/adminfolder$
admin@kali:/$ cd adminfolder/
admin@kali:/adminfolder$
</code>
</pre>
</div>
</a>
</div>
<div class="col-sm-6 mr-3">
<a href="#!" class="block-link" flag="ASV{My_n4m3_1s_54BL3}">
<div>
<pre>
<code class="bash">
guest@kali:/$ cd adminfolder/
bash: cd: adminfolder/: Permission denied
guest@kali:/$
admin@kali://$ cd adminfolder/
admin@kali:/adminfolder$
</code>
</pre>
</div>
</a>
</div>
</div>
<div class="alert alert-primary collapse" role="alert">
<strong>Your flag: </strong>: <span class="AlertMsg"></span>
</div>
<hr>
</div>
<!-- Question block end -->
</div>
</div>
</div>
<!-- Section end -->
<div class="col-lg-12 mb-3">
<div class="card mr-2 ml-2">
<div class="card-header">
<h5>Database Security</h5>
</div>
<div class="card-body">
<p class="w-75">
Database security is important in web application security. Databases have a wide range of information that can leak user data, confidential information and more. Threat actors may use this data to harm your company, users and possibly cost you money. In this example we are using SQL. SQL is designed for managing data held in a relational database management system (RDBMS), or for stream processing in a relational data stream management system (RDSMS). It is particularly useful in handling structured data, i.e. data incorporating relations among entities and variables.
</p>
<hr>
<!-- Question block -->
<div class="question-block">
<p class="w-75 fw-bold">Q8: Which of the following code contains an SQL injection?</p>
<div class="row">
<div class="col-sm-6">
<a href="#!" class="block-link" flag="ASV{good_N1ght}" >
<div>
<pre>
<code class="php">
<?php
$offset = $_GET["offset"];
$query = "SELECT id, name FROM products ORDER BY name LIMIT 20 OFFSET $offset";
$result = pg_query($conn, $query);
?>
</code>
</pre>
</div>
</a>
</div>
<div class="col-sm-6 mr-3">
<a href="#!" class="block-link" flag="ASV{5tr3ss3d_0ut}">
<div>
<pre>
<code class="php">
<?php
$offset = $_GET["offset"];
$query = "SELECT id, name FROM products ORDER BY name LIMIT 20 OFFSET $1";
$result = pg_query_params($conn, $query, $offset);
?$gt;
</code>
</pre>
</div>
</a>
</div>
</div>
<div class="alert alert-primary collapse" role="alert">
<strong>Your flag: </strong>: <span class="AlertMsg"></span>
</div>
<hr>
</div>
<!-- Question block end -->
</div>
</div>
</div>
<!-- Section end -->
<div class="col-lg-12 mb-3">
<div class="card mr-2 ml-2">
<div class="card-header">
<h5>Cryptographic Practices</h5>
</div>
<div class="card-body">
<p class="w-75">
Cryptographic practices is the practice of mathematical techniques toward achieving confidentiality, integrity and etc as defined by OWASP.Cryptographic practices should be applied to the application level, database level, hardware level, and filesystem level. You should refrain (keyword for never,) create your own design your own cryptographic protocols, or custom algorithms. Instead, consider using peer reviewed and tested protocols. In this specific section we will focus on secure random number generation. Cryptographically Secure Pseudo-Random Number Generators are focused on providing a greater amount of entropy. They're safe to use for security sensitive functionality. While these are more CPU intensive, than their counter part Pseudo Random Number Generators or PRNG, they are able to produce a much higher quality of random generated numbers.
</p>
<hr>
<!-- Question block -->
<div class="question-block">
<p class="w-75 fw-bold">Q9: Which code block demonstrates Cryptographically Secure Functions?</p>
<div class="row">
<div class="col-sm-6">
<a href="#!" class="block-link" flag="ASV{Mr5_5k3ll1}" >
<div>
<pre>
<code class="python">
pythonsecrets.secrets()
</code>
</pre>
</div>
</a>
</div>
<div class="col-sm-6 mr-3">
<a href="#!" class="block-link" flag="ASV{F4k3_Y0U_0UT}">
<div>
<pre>
<code class="python">
pythonrandom.random()
</code>
</pre>
</div>
</a>
</div>
</div>
<div class="alert alert-primary collapse" role="alert">
<strong>Your flag: </strong>: <span class="AlertMsg"></span>
</div>
<hr>
</div>
<!-- Question block end -->
</div>
</div>
</div>
<!-- Section end -->
<div class="col-lg-12 mb-3">
<div class="card mr-2 ml-2">
<div class="card-header">
<h5>Code Obfuscation</h5>
</div>
<div class="card-body">
<p class="w-75">
Code obfuscation is when a programmer makes it very difficult for their code to be read by another human. It's a practice of Security through Obscurity. While this shouldn't be the only method employed in secure coding practices, it certianly helps. Some practices of code obfuscation may include name obfuscaition, which variables are often named uselessly, or even deceptively. There could also be, comment, code or data confusion, which makes code look like comments, or create a confusing syntax with data. Double coding is another, which could display interesting shapes or in a poetry like form to make readability difficult. Second answer is correct
</p>
<hr>
<!-- Question block -->
<div class="question-block">
<p class="w-75 fw-bold">Q10: Which of these examples shows obfuscated code?</p>
<div class="row">
<div class="col-sm-6">
<a href="#!" class="block-link" flag="ASV{4ng3l_0f_Sm4LL_D34th_4nd_th3_C0ding_Sc3n3}" >
<div>
<pre>
<code class="javascript">
var _0x2665=['9049Ztlxxk','How\x20many\x20columns\x20for\x20your\x20multiplication\x20table?','<td>','15UrOwqH','2866ZOjkSg','86201lRTKIe','225484UBcuFb','570668socvIJ','517161drLjfs','108120eRykqa','252uyMFcg','</tr>','53nRxsOS'];var _0x2122bc=_0x1806;(function(_0x3a232b,_0x3cd479){var _0x2be606=_0x1806;while(!![]){try{var _0x581963=parseInt(_0x2be606(0x14e))+parseInt(_0x2be606(0x157))*-parseInt(_0x2be606(0x14c))+parseInt(_0x2be606(0x150))+parseInt(_0x2be606(0x14f))+-parseInt(_0x2be606(0x14d))+parseInt(_0x2be606(0x151))*parseInt(_0x2be606(0x158))+parseInt(_0x2be606(0x154))*parseInt(_0x2be606(0x153));if(_0x581963===_0x3cd479)break;else _0x3a232b['push'](_0x3a232b['shift']());}catch(_0x1a7a90){_0x3a232b['push'](_0x3a232b['shift']());}}}(_0x2665,0xd6aaf));var rows=prompt('How\x20many\x20rows\x20for\x20your\x20multiplication\x20table?'),cols=prompt(_0x2122bc(0x155));function _0x1806(_0x1b134b,_0x1901ba){_0x1b134b=_0x1b134b-0x14c;var _0x266555=_0x2665[_0x1b134b];return _0x266555;}if(rows==''||rows==null)rows=0xa;if(cols==''||cols==null)cols=0xa;createTable(rows,cols);function createTable(_0x39de12,_0x3e1935){var _0x338ecb=_0x2122bc,_0x1a82c7=0x1,_0x462667='<table\x20border=\x271\x27\x20width=\x27500\x27\x20cellspacing=\x270\x27cellpadding=\x275\x27>';for(i=0x1;i<=_0x39de12;i++){_0x462667=_0x462667+'<tr>';while(_0x1a82c7<=_0x3e1935){_0x462667=_0x462667+_0x338ecb(0x156)+i*_0x1a82c7+'</td>',_0x1a82c7=_0x1a82c7+0x1;}_0x462667=_0x462667+_0x338ecb(0x152),_0x1a82c7=0x1;}_0x462667=_0x462667+'</table>',document['write'](_0x462667);}
</code>
</pre>
</div>
</a>
</div>
<div class="col-sm-6 mr-3">
<a href="#!" class="block-link" flag="ASV{th1s_w4s_EZ}">
<div>
<pre>
<code class="javascript">
var rows = prompt("How many rows for your multiplication table?");
var cols = prompt("How many columns for your multiplication table?");
if(rows == "" || rows == null)
rows = 10;
if(cols== "" || cols== null)
cols = 10;
createTable(rows, cols);
function createTable(rows, cols) {
var j=1;
var output = "<table border='1' width='500' cellspacing='0'cellpadding='5'>";
for(i=1;i<=rows;i++)
{
output = output + "<tr>";
while(j<=cols)
{
output = output + "<td>" + i*j + "</td>";
j = j+1;
}
output = output + "</tr>";
j = 1;
}
output = output + "</table>";
document.write(output);
}
</code>
</pre>
</div>
</a>
</div>
</div>
<div class="alert alert-primary collapse" role="alert">
<strong>Your flag: </strong>: <span class="AlertMsg"></span>
</div>
<hr>
</div>
<!-- Question block end -->
</div>
</div>
</div>
<!-- Section end -->
</div>
</div>
<hr>
<footer class="m-3">
<p class="text-white">© 2021 App Sec Village.</p>
</footer>
<!-- /container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/highlight.min.js"></script>
<script>
hljs.highlightAll();
</script>
<script src="app.js"> </script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
</body>
</html>