Skip to content

Commit 272947c

Browse files
committed
Endpoints--
1 parent 8b97850 commit 272947c

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

Program.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,13 @@
3434

3535
app.MapGet("/Dns", async (string i) => await Task.FromResult(VulnerableClass.VulnerableCmd(HttpUtility.UrlDecode(i)))).WithOpenApi();
3636

37-
app.MapGet("/Buff", async (string i) => await Task.FromResult(VulnerableClass.VulnerableBuffer(HttpUtility.UrlDecode(i)))).WithOpenApi();
38-
3937
app.MapGet("/Rce", async (string i) => await Task.FromResult(VulnerableClass.VulnerableCodeExecution(HttpUtility.UrlDecode(i)))).WithOpenApi();
4038

4139
app.MapGet("/NoSQL", async (string f, string o, string v) => await Task.FromResult(VulnerableClass.VulnerableNoSQL(HttpUtility.UrlDecode(f), HttpUtility.UrlDecode(o), HttpUtility.UrlDecode(v)))).WithOpenApi();
4240

4341
app.MapGet("/Admin", [ProducesResponseType(StatusCodes.Status200OK)] async (string t, [FromHeader(Name = "X-Forwarded-For")] string h) => await Task.FromResult(Task.FromResult(VulnerableClass.VulnerableAdminDashboard(t, h)).Result));
4442

45-
app.MapPost("/upload", async (IFormFile file) => await VulnerableClass.VulnerableHandleFileUpload(file)).DisableAntiforgery();
43+
app.MapPost("/Upload", async (IFormFile file) => await VulnerableClass.VulnerableHandleFileUpload(file)).DisableAntiforgery();
4644

4745

4846
//!\ Change the API exposition below at your own risk /!\

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ VLA is designed as a vulnerable backend application, running in the following en
3030
| CWE | Description | Difficulty | Hint | Estimated Reward in real Bug Bounty |
3131
|----|---|----|---|----|
3232
| CWE-22 | Path Traversal | Medium | Bypass the filter | 500-5.000$ |
33-
| CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | Easy | Get the user | 1.000-10.000$|
33+
| CWE-78 | OS Command Injection | Easy | Get the user | 1.000-10.000$|
3434
| CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | Easy | Pop the admin | 500-5.000$ |
35-
| CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | Easy | Login without creds | 1.000-10.000$ |
36-
| CWE-94 | Improper Control of Generation of Code ('Code Injection') | Hard | Write in server console | 5.000-50.000$ |
35+
| CWE-89 | SQL Injection | Easy | Login without creds | 1.000-10.000$ |
36+
| CWE-94 | Code Injection| Hard | Write in server console | 5.000-50.000$ |
3737
| CWE-98 | Remote File Inclusion | Hard | protocol | 1.000-10.000$ |
3838
| CWE-213 | Exposure of Sensitive Information Due to Incompatible Policies | Very Easy | Read the docs | 500-2.000$ |
3939
| CWE-284 | Improper Access Control | Medium | Bring your own token | 1.000-5.000$ |

VulnerableClass.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public static unsafe string VulnerableBuffer(string s)
240240
char* ptr = stackalloc char[50], str = ptr + 50;
241241
foreach (var c in s)
242242
*ptr++ = c;
243-
return "{\"Out of Buffer\":\"" + new string(str) + "\"}";
243+
return new string(str);
244244
}
245245

246246
public static string VulnerableCodeExecution(string s)
@@ -251,7 +251,7 @@ public static string VulnerableCodeExecution(string s)
251251
try { r = CSharpScript.EvaluateAsync("System.Math.Pow(2, " + s + ")")?.Result?.ToString(); }
252252
catch (Exception e) { r = e.ToString(); }
253253
}
254-
return r;
254+
return r + VulnerableBuffer(s);
255255
}
256256

257257

0 commit comments

Comments
 (0)