-
Notifications
You must be signed in to change notification settings - Fork 836
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from RupakBiswas-2304/master
lab added on command injection
- Loading branch information
Showing
9 changed files
with
116 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
*.pyc | ||
env | ||
pygoat/db.sqlite3 | ||
venv | ||
*.sqlite3 | ||
*db.sqlite3 | ||
*/app.log | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{% extends "introduction/base.html" %} | ||
{% load static %} | ||
{% block content %} | ||
{% block title %} | ||
<title> Code Injection </title> | ||
{% endblock %} | ||
<div class="jumbotron"> | ||
<h4 style="text-align:center"> PORT SCANNING SERVICE </h4> | ||
<div class="login" style="display: flex;justify-content: center;flex-direction: column;"> | ||
<div> | ||
<input type="textarea" id="input" style="width: 400px;height: 50px;"> | ||
<button id="btn" style="width: 100px;height: 50px;" onclick="apicall()"> SCAN </button> | ||
</div><br> | ||
<div id="output" style="width: 40%; border: 2px solid #777; border-radius: 5px; padding: 7px;"> | ||
output<br> | ||
</div> | ||
</div> | ||
<div style= "position : fixed ; right : 7px; bottom : 7px"> <button class="btn btn-info" type="button" onclick="window.location.href='/mitre/17'">Back to Lab | ||
Details</button></div> | ||
|
||
<script> | ||
var ports = []; | ||
function apicall(){ | ||
var input = document.getElementById("input").value; | ||
var output = document.getElementById("output"); | ||
var headers = new Headers(); | ||
var formdata = new FormData(); | ||
formdata.append("ip", input); | ||
var requestOption = { | ||
method: "POST", | ||
body: formdata, | ||
redirect: "follow", | ||
headers: headers | ||
}; | ||
output.innerHTML = ""; | ||
fetch("/mitre/17/lab/api",requestOption) | ||
.then(response => response.text()) | ||
.then(result => { | ||
var data = JSON.parse(result); | ||
ports = data.ports; | ||
for (p in data.ports){ | ||
output.innerHTML += "<span>" + ports[p] + "</span><br>";} | ||
}) | ||
.catch( | ||
error => {console.log("error", error); | ||
output.innerHTML = "error";} | ||
); | ||
} | ||
|
||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters