diff --git a/demo-website/new-project/index.js b/demo-website/new-project/index.js index 78b394b72ff5815b775774c98f9809a5b0390e25..fa73e364f0c7753defb2e0bcc25c7d3995650a7a 100644 --- a/demo-website/new-project/index.js +++ b/demo-website/new-project/index.js @@ -75,7 +75,7 @@ function getMemberEmails() { var members = document.getElementById("member-list").getElementsByTagName("li"); for(var i = 0; i < members.length; i++){ - memberEmails.push(members[0].firstChild.data); + memberEmails.push(members[i].firstChild.data); } return memberEmails } diff --git a/source/customLogger/__init__.py b/source/customLogger/__init__.py index 4a9af2e1c8b6e7c314c11f1e9d6a5589c9bd4ae5..8ee29926a5c07ff4084f6022343e19590929af13 100644 --- a/source/customLogger/__init__.py +++ b/source/customLogger/__init__.py @@ -1,6 +1,5 @@ import logging from logging_loki import LokiHandler, emitter - # for this is needed for the color level to work in grafana emitter.LokiEmitter.level_tag = "level" @@ -11,8 +10,8 @@ handler = LokiHandler( version="1", ) - logger = logging.getLogger("ROSE_LOG") +# At or above INFO will be logged logger.setLevel(logging.INFO) logger.addHandler(handler) diff --git a/source/orchestrationLogic/HEAT/bootup.ps1 b/source/orchestrationLogic/HEAT/bootup.ps1 index 9b183259cf4c21b36d4283fffd10108d297c52d2..4e4065e3db8b5e10a469c95785626c6aff1ef345 100644 --- a/source/orchestrationLogic/HEAT/bootup.ps1 +++ b/source/orchestrationLogic/HEAT/bootup.ps1 @@ -1,36 +1,53 @@ #ps1_sysnative -Start-Sleep -s 600 echo custom-script +if( !(Test-Path -Path "C:\flag.txt")) { + New-Item -Path "C:\flag.txt" + echo "if" -get-executionpolicy -Set-ExecutionPolicy RemoteSigned -Force -Get-executionpolicy -New-ItemProperty -Path "REGISTRY::HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" -Name AllowInsecureGuestAuth -PropertyType "DWORD" -New-ItemProperty -Path "REGISTRY::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name EnableLinkedConnections -PropertyType "DWORD" -Set-ItemProperty -path "REGISTRY::HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" -Name "AllowInsecureGuestAuth" -value "1" -Set-ItemProperty -Path "REGISTRY::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections" -Value "1" -Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Any - - - -Set-DNSClientServerAddress -InterfaceIndex (Get-NetAdapter).InterfaceIndex -ServerAddresses 192.168.0.3 - -$dc = "rose.local" -$pw = ConvertTo-SecureString "Rosetest1" -AsPlainText -Force -$usr = "$dc\Administrator" -$creds = New-Object System.Management.Automation.PSCredential($usr,$pw) - -do { - try { - Add-Computer -DomainName $dc -Credential $creds -ErrorAction Stop - echo "`n`n DOMAIN JOIN SUCCEEDED`n`n" - <RDPMembers> - exit 1001 - - } catch { - $joined = $false - $i = $i + 1 - echo "`n`n DOMAIN JOIN FAILED RETRYING IN 1 MINUTE `n`n" - Start-Sleep -s 60 - } -} while ((-Not $joined) -And ($i -lt 10)) \ No newline at end of file + get-executionpolicy + Set-ExecutionPolicy RemoteSigned -Force + Get-executionpolicy + New-ItemProperty -Path "REGISTRY::HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" -Name AllowInsecureGuestAuth -PropertyType "DWORD" + New-ItemProperty -Path "REGISTRY::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name EnableLinkedConnections -PropertyType "DWORD" + Set-ItemProperty -path "REGISTRY::HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" -Name "AllowInsecureGuestAuth" -value "1" + Set-ItemProperty -Path "REGISTRY::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections" -Value "1" + Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Any + + + + Set-DNSClientServerAddress -InterfaceIndex (Get-NetAdapter).InterfaceIndex -ServerAddresses 192.168.0.3 + + $dc = "rose.local" + $pw = ConvertTo-SecureString "Rosetest1" -AsPlainText -Force + $usr = "$dc\Administrator" + $creds = New-Object System.Management.Automation.PSCredential($usr,$pw) + + $joined = $true + $i = 0; + do { + try { + Add-Computer -DomainName $dc -Credential $creds -ErrorAction Stop + echo "`n`n DOMAIN JOIN SUCCEEDED`n`n" + exit 1003 + + } catch { + $joined = $false + $i = $i + 1 + echo "`n`n DOMAIN JOIN FAILED RETRYING IN 1 MINUTE `n`n" + Start-Sleep -s 60 + } + } while ((-Not $joined) -And ($i -lt 25)) + +}else { + $added = $true + $i = 0 + do { + try{ + <RDPMembers> # Adds users to the rdp member group + } catch{ + $added = $false + $i = $i+1 + } + + } while($i -lt 10) +} diff --git a/source/orchestrationLogic/HEAT/dc-init.ps1 b/source/orchestrationLogic/HEAT/dc-init.ps1 index fc71f58dec0d036305d0a17ffbbbf6498f61fd5f..17c80bbe7c759c263d5dd078e1c7a5e181602b96 100644 --- a/source/orchestrationLogic/HEAT/dc-init.ps1 +++ b/source/orchestrationLogic/HEAT/dc-init.ps1 @@ -3,9 +3,9 @@ New-Item -Path "C:\test.txt" echo "kjort" >> C:\test.txt -if( !(Test-Path -Path "C:\flag.txt")) { +if( !(Test-Path -Path "C:\flag1.txt")) { echo "if" - New-Item -Path "C:\flag.txt" + New-Item -Path "C:\flag1.txt" # Use self as DNS Set-DNSClientServerAddress -InterfaceIndex (Get-NetAdapter).InterfaceIndex -ServerAddresses 127.0.0.1 #Install ADDS @@ -13,6 +13,13 @@ if( !(Test-Path -Path "C:\flag.txt")) { # Set Administrator password net user Administrator Rosetest1 Import-Module ADDSDeployment + exit 1003 + + + +}elseif(!(Test-Path -Path "C:\flag2.txt")){ + echo "elseif" + New-Item -Path "C:\flag2.txt" $secureSafeModePwd = ConvertTo-SecureString "Rosetest1" -AsPlainText -Force # Setup domain Install-ADDSForest -DomainName "rose.local" ` @@ -20,15 +27,24 @@ if( !(Test-Path -Path "C:\flag.txt")) { -SafeModeAdministratorPassword $secureSafeModePwd ` -InstallDns -NoRebootOnCompletion -force exit 1003 + }else { echo "else" New-Item -Path "C:\log.txt" - New-ADUser -Name "bojack" -Accountpassword (ConvertTo-SecureString "HorsemanPass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt - New-ADUser -Name "diane" -Accountpassword (ConvertTo-SecureString "NguyenPass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt - New-ADUser -Name "todd" -Accountpassword (ConvertTo-SecureString "ChavezPass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt - New-ADUser -Name "sarah" -Accountpassword (ConvertTo-SecureString "LynnPass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt - New-ADUser -Name "hollyhock" -Accountpassword (ConvertTo-SecureString "ManheimPass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt - New-ADUser -Name "wanda" -Accountpassword (ConvertTo-SecureString "PiercePass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt - New-ADUser -Name "pinky" -Accountpassword (ConvertTo-SecureString "PenguinPass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt + $dc = "rose.local" + $pw = ConvertTo-SecureString "Rosetest1" -AsPlainText -Force + $usr = "$dc\Administrator" + $creds = New-Object System.Management.Automation.PSCredential($usr,$pw) + + + New-ADUser -Name "bojack" -Accountpassword (ConvertTo-SecureString "HorsemanPass1" -AsPlainText -Force ) -Enabled $true -Credential $creds + New-ADUser -Name "diane" -Accountpassword (ConvertTo-SecureString "NguyenPass1" -AsPlainText -Force ) -Enabled $true -Credential $creds + New-ADUser -Name "todd" -Accountpassword (ConvertTo-SecureString "ChavezPass1" -AsPlainText -Force ) -Enabled $true -Credential $creds + New-ADUser -Name "sarah" -Accountpassword (ConvertTo-SecureString "LynnPass1" -AsPlainText -Force ) -Enabled $true -Credential $credst + New-ADUser -Name "hollyhock" -Accountpassword (ConvertTo-SecureString "ManheimPass1" -AsPlainText -Force ) -Enabled $true -Credential $creds + New-ADUser -Name "wanda" -Accountpassword (ConvertTo-SecureString "PiercePass1" -AsPlainText -Force ) -Enabled $true -Credential $creds + New-ADUser -Name "pinky" -Accountpassword (ConvertTo-SecureString "PenguinPass1" -AsPlainText -Force ) -Enabled $true -Credential $creds + + } diff --git a/source/orchestrationLogic/orchestrator.py b/source/orchestrationLogic/orchestrator.py index b68afe4f75d8b22701ecc11d11a58750ddda9f97..d145427c662ac63d146418cfddea3a324d72580f 100644 --- a/source/orchestrationLogic/orchestrator.py +++ b/source/orchestrationLogic/orchestrator.py @@ -157,6 +157,6 @@ class Orchestrator: def allowRDP(self, members): result = '' for member in members: - result += "Add-LocalGroupMember -Group 'Remote Desktop Users' -Member '{}';".format(member) + result += "Add-LocalGroupMember -Group 'Remote Desktop Users' -Member '{}' -ErrorAction Stop;".format(member) return result