-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rob Brooks
committed
Feb 22, 2021
0 parents
commit 7ef06f7
Showing
30 changed files
with
2,004 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Active Directory Reporting Tool | ||
|
||
This tool provides the ability to query groups in Active Directory Domains and display a list of their members. | ||
|
||
|
||
### Prerequisites | ||
|
||
The tool needs to be ran on a Windows instance which has connectivity to the Domain being queried. It doen't need to be ran on a Domain Controller. | ||
|
||
The user running the tool must have local Administrator privileges on the machine being ran on. | ||
|
||
Git, in order to clone the repository | ||
|
||
A modern browser such as Chrome or Firefox | ||
|
||
|
||
|
||
### Starting the application | ||
|
||
Clone this repository locally | ||
|
||
Navigate to the adaudit directory and run the server.ps1 script as Administrator | ||
When prompted select Y | ||
|
||
### Stopping the application | ||
|
||
Close the powershell window | ||
|
||
|
||
## Architecture | ||
|
||
The tool has the following components : | ||
|
||
* A restful API served by Pode (server/ps1) | ||
* A number of views (index, groups) served by HTML and JQuery. The web pages are served by asynchronous ajax API calls to the Pode API | ||
|
||
### Application components | ||
|
||
The main components of the application are as follows: | ||
|
||
| File | Type | Purpose | | ||
| :------------- |:-----------------|:--------- | ||
| views | folder | Available views | | ||
| public | folder | Public assets (stylesheets, javascript etc | | ||
| server.ps1 | powershell script | entrypoint to the application | | ||
| adaudit.bat | bash script | wrapper scrript to start the application | | ||
| views/index.html | html file | Landing view containing login screen and Domain selection | | ||
| views/groups.html | html file | Group selection and membership view | | ||
|
||
|
||
|
||
### To add another view | ||
|
||
Add another route entry similar to the following : | ||
|
||
``` | ||
Add-PodeRoute -Method Get -Path '/groups' -ScriptBlock { | ||
Write-PodeViewResponse -Path 'groups' | ||
} | ||
``` | ||
|
||
### To add another route | ||
|
||
Add the payload of the route | ||
``` | ||
Add-PodeRoute -Method Get -Path '/login/:username/:password/:hostname' -ScriptBlock { | ||
-- CODE -- | ||
Write-PodeJsonResponse -Value @{ 'fooo' = $bar } | ||
} | ||
``` | ||
In this example login is the path, username,password and hostname are parameters which can be used via the following syntax : | ||
|
||
``` | ||
$WebEvent.Parameters['username'] | ||
``` | ||
|
||
### Channging the listener port | ||
|
||
In server.ps1 change 8080 to the desired port on thee following line: | ||
|
||
``` | ||
Add-PodeEndpoint -Address * -Port 8080 -Protocol Http | ||
``` | ||
|
||
|
||
## Built With | ||
|
||
* [Pode](https://badgerati.github.io/Pode/) - The web framework used | ||
* [JQuery](https://jquery.com/) - Javascript framework | ||
* HTML | ||
|
||
|
||
## Authors | ||
|
||
* **Rob Brooks** |
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 @@ | ||
runas /profile /user:Administrator "powershell ./server.ps1" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
function includeHTML() { | ||
var z, i, elmnt, file, xhttp; | ||
/* Loop through a collection of all HTML elements: */ | ||
z = document.getElementsByTagName("*"); | ||
for (i = 0; i < z.length; i++) { | ||
elmnt = z[i]; | ||
/*search for elements with a certain atrribute:*/ | ||
file = elmnt.getAttribute("w3-include-html"); | ||
if (file) { | ||
/* Make an HTTP request using the attribute value as the file name: */ | ||
xhttp = new XMLHttpRequest(); | ||
xhttp.onreadystatechange = function() { | ||
if (this.readyState == 4) { | ||
if (this.status == 200) {elmnt.innerHTML = this.responseText;} | ||
if (this.status == 404) {elmnt.innerHTML = "Page not found.";} | ||
/* Remove the attribute, and call this function once more: */ | ||
elmnt.removeAttribute("w3-include-html"); | ||
includeHTML(); | ||
} | ||
} | ||
xhttp.open("GET", file, true); | ||
xhttp.send(); | ||
/* Exit the function: */ | ||
return; | ||
} | ||
} | ||
} | ||
|
||
|
||
function parseDate(date) { | ||
try { | ||
var utcSeconds = parseInt((date).substring(6, 19)); | ||
parsedDate = new Date(utcSeconds); | ||
} catch { | ||
parsedDate=""; | ||
} | ||
return parsedDate; | ||
} | ||
|
||
function makeTextFile(text) { | ||
var textFile = null; | ||
var data = new Blob([text], {type: 'text/plain'}); | ||
// "data:text/csv;charset=utf-8," + | ||
// If we are replacing a previously generated file we need to | ||
// manually revoke the object URL to avoid memory leaks. | ||
if (textFile !== null) { | ||
window.URL.revokeObjectURL(textFile); | ||
} | ||
textFile = window.URL.createObjectURL(data); | ||
return textFile; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.