### Manual Setup for Greyteam Project Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/README.md This section outlines the manual steps to set up the Greyteam project environment. It includes package installation, repository cloning, virtual environment creation, dependency installation, and Ansible role installation. ```shell apt update apt install -y nano git python-is-python3 python3 python3-venv python3-pip sshpass pwgen git clone https://github.com/Guac0/2255-CSEC473-Alpha/ cd ./2255-CSEC473-Alpha/greyteam python -m venv venv source venv/bin/activate pip3 install -r requirements.txt activate-global-python-argcomplete ansible-galaxy install -r requirements.yml ``` -------------------------------- ### Setup Greyteam Project using cURL Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/README.md This command downloads and executes the setup script for the Greyteam project directly from GitHub using cURL. It's a quick way to get the environment ready. ```shell curl https://raw.githubusercontent.com/Guac0/2255-CSEC473-Alpha/refs/heads/main/greyteam/setup.sh | bash ``` -------------------------------- ### Ansible Command Examples for Verification and Execution Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/README.md This snippet provides examples of using Ansible for various tasks. It includes checking playbook syntax, linting playbooks, and executing playbooks with specific tags and verbosity levels. ```shell ansible-lint verify-apache.yml ``` ```shell ansible-playbook -i inventory.yaml playbook.yaml -t ping ``` ```shell ansible-playbook -i inventory/inventory.yaml playbook.yaml -t flags -l unix -vvvv ``` ```shell ansible-playbook -i inventory.yaml playbook.yaml -t tag -vv -c ``` -------------------------------- ### Environment Setup using Ansible Source: https://context7.com/guac0/2255-csec473-alpha/llms.txt Installs dependencies and configures the Ansible control node for the project. It can be executed via a curl script or manually by installing packages, cloning the repository, setting up a virtual environment, and installing Python and Ansible requirements. ```bash curl https://raw.githubusercontent.com/Guac0/2255-CSEC473-Alpha/refs/heads/main/greyteam/setup.sh | bash ``` ```bash apt update apt install -y nano git python-is-python3 python3 python3-venv python3-pip sshpass pwgen git clone https://github.com/Guac0/2255-CSEC473-Alpha/ cd ./2255-CSEC473-Alpha/greyteam python -m venv venv source venv/bin/activate pip3 install -r requirements.txt activate-global-python-argcomplete ansible-galaxy install -r requirements.yml ``` -------------------------------- ### Create Local Users Playbook Example (YAML) Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/windows_users_local/README.md This example demonstrates how to use the 'windows_create_local_users' role within an Ansible playbook. It targets Windows hosts, excluding domain controllers, and applies the role with specific tags. This playbook is intended to be used for creating local user accounts on specified Windows machines. ```yaml - name: Create Local Users hosts: windows:&team_hosts:!win_dc roles: - windows_create_local_users tags: - never - team - windows - team_local_users ``` -------------------------------- ### Initialize and Load Data (JavaScript) Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/scoring_server/files/templates/editor.html This JavaScript function initializes the system by loading host and service data. It makes asynchronous calls to '/get_hosts' and '/get_services' endpoints to populate the respective lists. ```javascript let selectedServiceId = null; async function init() { await loadHosts(); await loadServices(); } init(); ``` -------------------------------- ### Initial Load and Auto-Refresh using JavaScript Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/scoring_server/files/templates/management.html Initializes the application by calling functions to refresh users, tokens, and logs. It then sets up interval timers to automatically refresh logs every 30 seconds and users/tokens every 90 seconds. ```javascript // Initial load refreshUsers(); refreshTokens(); refreshLogs(); // Auto-refresh every 60 seconds setInterval(() => { refreshLogs(); }, 30000); setInterval(() => { refreshUsers(); refreshTokens(); }, 90000); ``` -------------------------------- ### User Management with Ansible Source: https://context7.com/guac0/2255-csec473-alpha/llms.txt Manages the creation and deployment of local and domain users across the environment. It defines standard users, local administrators, and domain administrators, with an example configuration provided for `group_vars/all.yaml`. ```bash ansible-playbook -i inventory.yaml playbook.yaml -t local_users ``` ```bash ansible-playbook -i inventory.yaml playbook.yaml -t users_linux ``` ```yaml # Example inventory group_vars/all.yaml configuration: # local_users: # - twilight # - pinkiepie # - applejack # local_admins: # - bigmac # - mayormare # domain_admins: # - celestia # - discord # team_password: Friendship0! ``` -------------------------------- ### Video Ad Configuration Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/windows_iis/files/site/index.html Configuration object for video ad placements, detailing various ad bidders like AppNexus, GumGum, Ix, Kargo, Medianet, Nobid, OpenX, Ozone, Pubmatic, Rubicon, Seedtag, and Triplelift. Each bidder has specific parameters for targeting and inventory. ```javascript { "incontent_player": { "name": "incontent_player", "type": "video", "sizes": [ [ [0, 0], [ [640, 480] ] ] ], "targeting": { "loc": "middle", "pos": "outstream", "src": "gpt" }, "group": "VIDEO", "bidders": { "prebid": { "mediaTypes": { "video": { "api": [ 2 ], "context": "instream", "linearity": 1, "mimes": [ "video/mp4", "video/x-flv", "video/webm", "video/ogg" ], "placement": 3, "plcmt": 2, "playbackmethod": [ 2, 3 ], "protocols": [ 2, 3, 5, 6 ], "minduration": 1, "maxduration": 30, "startdelay": 0, "playerSize": [ 640, 480 ], "skip": 1, "w": 640, "h": 480 } }, "bids": { "appnexus": [ { "bidder": "appnexus", "params": { "3": {"placementId": "36031426"}, "4": {"placementId": "35554247"} } } ], "gumgum": [ { "bidder": "gumgum", "params": { "4": {"zone": "xncp8nfb"} } } ], "ix": [ { "bidder": "ix", "params": { "3": {"siteId": "1264494"}, "4": {"siteId": "1204726"} } } ], "kargo": [ { "bidder": "kargo", "params": { "4": {"placementId": "_s5qlqwD4Vv"} } } ], "medianet": [ { "bidder": "medianet", "params": { "3": {"cid": "8CU8RM982", "crid": "334418444"}, "4": {"cid": "8CU5JOKX4", "crid": "789719487"} } } ], "nobid": [ { "bidder": "nobid", "params": { "4": {"siteId": 21872987104, "placementId": 169477} } } ], "openx": [ { "bidder": "openx", "params": { "3": {"delDomain": "wikia-d.openx.net", "unit": "562882254"}, "4": {"delDomain": "wikia-d.openx.net", "unit": "562527223"} } } ], "ozone": [ { "bidder": "ozone", "params": { "4": {"publisherId": "OZONEFAN0001", "siteId": "1500000748", "placementId": "3500018045"} } } ], "pubmatic": [ { "bidder": "pubmatic", "params": { "3": {"publisherId": "156260", "adSlot": "7013933"}, "4": {"publisherId": "156260", "adSlot": "6883416"} } } ], "rubicon": [ { "bidder": "rubicon", "params": { "3": {"accountId": "7450", "keywords": ["rp.fastlane"], "siteId": "595364", "zoneId": "3810512", "video": {"size_id": 201, "language": "en"}}, "4": {"accountId": "7450", "keywords": ["rp.fastlane"], "siteId": "590516", "zoneId": "3770942", "video": {"size_id": 201, "language": "en"}} } } ], "seedtag": [ { "bidder": "seedtag", "params": { "4": {"publisherId": "6602-4575-01", "adUnitId": "35631525", "placement": "inArticle"} } } ], "triplelift": [ { "bidder": "triplelift", "params": { "3": {"inventoryCode": "Fandom_RON_Desktop_Video_Prebid"}, "4": {"inventoryCode": "Fandom_incontent_player_prebid_odyssey"} } } ] } }, "a9": { "mediaType": "video" } } } } ``` -------------------------------- ### Configure OpenStack Provider for Terraform Source: https://context7.com/guac0/2255-csec473-alpha/llms.txt Example HCL configuration for the Terraform OpenStack provider. It specifies the required Terraform version, provider source, version constraints, and authentication details for OpenStack. This file is typically named `config.tf` or similar. ```hcl # Example config.tf - OpenStack provider configuration terraform { required_version = ">= 0.14.0" required_providers { openstack = { source = "terraform-provider-openstack/openstack" version = "~> 1.53.0" } } } provider "openstack" { tenant_name = "cdtalpha" auth_url = "https://openstack.cyberrange.rit.edu:5000/v3/" } ``` -------------------------------- ### Define Inventory Structure in YAML Source: https://context7.com/guac0/2255-csec473-alpha/llms.txt Example YAML file defining the inventory structure for Ansible. It organizes hosts into groups based on their roles (e.g., `dc`, `mssql`, `apache2`, `mariadb`) and operating systems, facilitating targeted playbook execution. ```yaml # inventory.yaml - Example host definitions all: children: dc: hosts: canterlot: ansible_host: "10.0.10.1" mssql: hosts: manehatten: ansible_host: "10.0.10.2" apache2: hosts: ponyville: ansible_host: "10.0.10.3" mariadb: hosts: seaddle: ansible_host: "10.0.10.4" # OS-based groups windows: children: dc: mssql: linux: children: apache2: mariadb: # Scope groups inscope: children: dc: mssql: apache2: mariadb: ``` -------------------------------- ### CSS for Post Open Graph Preview Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/windows_iis/files/site/index.html This CSS styles the preview of a post's Open Graph (OG) data, typically shown for shared links. It includes styling for the main container, image, and details section, ensuring a responsive and well-organized layout. ```css .post__og{margin-bottom:12px}.post__og-link{text-decoration:none}.post__og-data-wrapper{border:1px solid var(--webeditor-border-color);border-radius:4px;display:flex}.post__og-image-container{flex:1;position:relative}.post__og-image-container,.post__og-image-wrapper{border-right:1px solid var(--webeditor-border-color)}.post__og-image{background-position:center;background-size:cover;border-bottom-left-radius:4px;border-top-left-radius:4px;display:block;height:100%;width:100%}.post__og-details{display:flex;flex:2;flex-direction:column;justify-content:space-between;overflow:hidden;overflow-wrap:break-word;padding:12px;position:relative}@media only screen and (min-width: 430px){.post__og-details{flex:3}}@media only screen and (min-width: 1024px){.post__og-details{padding:18px}} ``` -------------------------------- ### Get Query Variable Utility Function (JavaScript) Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/windows_iis/files/site/index_files/silver-surfer.htm The `getQueryVar` function retrieves and decodes a specific variable from the URL's query string. It uses regular expressions to find the variable and returns its value, or false if not found. This is useful for parsing URL parameters. ```javascript function getQueryVar(varName) { // Grab and unescape the query string - appending an '&' keeps the RegExp simple // for the sake of this example. var queryStr = unescape(window.location.search) + '&'; // Dynamic replacement RegExp var regex = new RegExp('.*?[&\\]?' + varName + '=(.*?)\\&.*'); // Apply RegExp to the query string var val = queryStr.replace(regex, '$1'); // If the string is the same, we didn't find a match - return false return val === queryStr ? false : val; } ``` -------------------------------- ### Pony Wings Game Initialization and Event Handling (JavaScript) Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/linux_nginx/files/index.html JavaScript code for initializing the Pony Wings game and handling user input. It includes variables for game state, canvas context setup, and preventing default actions for specific events to control game flow. ```javascript function BlockMove(event) { if(!gameIsLoaded || !menu.isGameOver){ event.preventDefault(); } } var gameIsLoaded = false; var gameIsMobile = false; var notHomeScreened = gameIsMobile && !window.navigator.standalone; var enterFrameRate = 1000/60; var drawFrameRate = 1000/60; canvas = document.getElementById('game'); ctx = canvas.getContext('2d'); hudCanvas = document.getElementById('hud'); hudCTX = hudCanvas.getContext('2d'); PWG.loadArtAssets(); PWG.init(); ``` -------------------------------- ### Create Application Launchers with Ansible Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/linux_client_programs/tasks/README.md Generates `.desktop` files for applications, which are used as shortcuts on Linux desktops. This task utilizes the `ansible.builtin.copy` module with the `content` parameter to define the structure and content of each launcher. It iterates over a list of applications, creating a separate launcher for each. ```ansible - name: Create app launchers in /etc/skel/Desktop ansible.builtin.copy: dest: "/etc/skel/Desktop/{{ item.filename }}" mode: "0755" content: | [Desktop Entry] Type=Application Name={{ item.name }} Exec={{ item.exec }} Terminal=false loop: - { name: "Thunderbird", filename: "Thunderbird.desktop", exec: "thunderbird" } - { name: "LibreOffice", filename: "LibreOffice.desktop", exec: "libreoffice" } - { name: "FileZilla", filename: "FileZilla.desktop", exec: "filezilla" } - { name: "HexChat", filename: "HexChat.desktop", exec: "hexchat" } become: true ``` -------------------------------- ### Get Bash Histories from Linux Hosts with Ansible Source: https://context7.com/guac0/2255-csec473-alpha/llms.txt Executes the 'history' tag on Ansible playbooks to retrieve bash histories from all Linux hosts. This is primarily used for auditing purposes to review command execution. It requires an inventory file (inventory.yaml) and a playbook file (playbook.yaml). ```bash # Get bash histories from Linux hosts (for auditing) ansible-playbook -i inventory.yaml playbook.yaml -t history ``` -------------------------------- ### Copy Launchers to User Desktops with Ansible Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/linux_client_programs/tasks/README.md Copies pre-created application launcher files from a central location (`/etc/skel/Desktop`) to the Desktop directory of each existing user. This task employs the `ansible.builtin.copy` module with `remote_src: true` and uses the `product()` filter to efficiently pair users with launcher files. It ensures that all specified users receive the application shortcuts. ```ansible - name: Copy launchers to each user Desktop ansible.builtin.copy: remote_src: true src: "/etc/skel/Desktop/{{ item.1 }}" dest: "/home/{{ item.0 }}/Desktop/{{ item.1 }}" owner: "{{ item.0 }}" group: "{{ item.0 }}" mode: "0755" loop: "{{ linux_desktop_users | product(['Thunderbird.desktop','LibreOffice.desktop','FileZilla.desktop','HexChat.desktop']) | list }}" when: item.0 in ansible_facts.getent_passwd become: true ``` -------------------------------- ### Validate Apache/DokuWiki Service using Python Source: https://context7.com/guac0/2255-csec473-alpha/llms.txt Python script to validate Apache/DokuWiki service availability by checking HTTP response. It sends a GET request to a specified URL and checks for a successful status code or expected text. Dependencies include the `urllib.request`, `socket`, and `sys` modules. ```python import urllib.request import socket import sys url = "http://10.0.10.3/doku.php?id=wiki:wikipage" def check_url(target_url, timeout=5.0, expected_text=None): req = urllib.request.Request(target_url, headers={"User-Agent": "apacheScoreCheck/1.0"}) try: with urllib.request.urlopen(req, timeout=timeout) as resp: status = getattr(resp, "status", None) body = resp.read() text = body.decode("utf-8", errors="replace") if expected_text and expected_text in text: return True, f"UP (status={status}) MATCHED_TEXT", 0 if 200 <= status < 400: return True, f"UP (status={status})", 0 return False, f"UNEXPECTED_STATUS (status={status})", 2 except Exception as e: return False, f"ERROR {e}", 1 # Run check up, message, code = check_url(url, timeout=5.0) print(f"{ 'OK' if up else 'FAIL'}: {message}") sys.exit(code) ``` -------------------------------- ### Plugin Configurations Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/windows_iis/files/site/index.html Configuration object for various plugins used on the website, including BrandMetricsPlugin, ConfiantPlugin, AverageHbPricePlugin, DoubleVerifyPlugin, and IasPublisherOptimizationPlugin. Each plugin has specific parameters and script URLs. ```javascript { "plugins": { "BrandMetricsPlugin": { "scriptUrl": "//cdn.brandmetrics.com/tag/9097a5369e204e6eac53b45c7dde13c5/fandom.com_au.js" }, "ConfiantPlugin": { "propertyId": "d-aIf3ibf0cYxCLB1HTWfBQOFEA" }, "AverageHbPricePlugin": { "slots": [ "top_leaderboard", "top_boxad" ] }, "DoubleVerifyPlugin": { "slotNamesToTrack": [ "top_leaderboard", "top_boxad", "incontent_boxad", "bottom_leaderboard", "incontent_leaderboard", "lightbox_leaderboard", "featured", "incontent_player" ] }, "IasPublisherOptimizationPlugin": { "watchedSlotList": [ "top_leaderboard", "top_boxad", "incontent_boxad", "incontent_leaderboard", "bottom_leaderboard", "lightbox_leaderboard", "featured", "incontent_player" ] } } } ``` -------------------------------- ### Load CSS and JS Modules for Fandom Desktop Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/windows_iis/files/site/index.html This snippet defines the CSS and JavaScript modules to be loaded for the Fandom Desktop skin. It includes various CSS files for different components and extensions, and a comprehensive list of JavaScript modules for features like user options, tokens, tracking, and global components. ```javascript RLPAGEMODULES=["ext.cite.ux-enhancements", "site", "mediawiki.page.ready", "jquery.makeCollapsible", "mediawiki.toc", "ext.fandom.DatacenterPreference.js", "ext.fandom.ServerSideExperiments.js", "ext.fandom.Track.js", "ext.visualEditor.desktopArticleTarget.init", "ext.visualEditor.targetLoader", "ext.checkUser.clientHints", "ext.fandom.FacebookTags.js", "ext.fandom.SilverSurferLoader.trackingWelcomeTool.js", "ext.fandom.ae.consentQueue.js", "ext.fandom.AgeGate.loader.js", "ext.fandom.AgeGate.messages", "ext.fandom.AnalyticsEngine.comscore.js", "ext.fandom.AnalyticsEngine.quantcast.js", "ext.categorySelect.js", "ext.categorySelectFandomDesktop.css", "ext.fandom.bannerNotifications.js", "ext.fandom.bannerNotifications.messages", "ext.fandom.bannerNotifications.techUpdateBanner.js", "ext.fandom.ContentReview.legacyLoaders.js", "ext.fandom.ContentReview.jsReload.js", "ext.fandom.site", "ext.fandom.ContentReviewTestModeMessages", "ext.fandom.ImportJs", "ext.fandom.UncrawlableUrl.anchors.js", "ext.fandom.TimeAgoMessaging.js", "ext.fandom.ImageGalleryIconModuleInit.js", "ext.fandom.Thumbnails.js", "ext.fandom.Thumbnails.messages", "ext.fandom.GTM.js", "ext.fandom.ArticleComments.messages", "ext.fandom.ArticleComments.desktop.js", "ext.tabView.editor.js", "ext.fandom.performanceMonitoring.js", "ext.fandom.ArticleInContentPlayer.desktop.js", "ext.fandom.HighlightToAction.js", "ext.fandom.HighlightToAction.messages", "ext.fandom.Sentry.loader.js", "ext.fandom.SuggestedPages.js", "ext.fandom.DiscordInterceptor.js", "skin.fandomdesktop.js", "skin.fandomdesktop.messages", "mediawiki.Uri", "ext.fandom.GlobalComponents.GlobalExploreNavigation.js", "ext.fandom.GlobalComponents.GlobalExploreNavigation.messages", "ext.fandom.GlobalComponents.GlobalTopNavigation.js", "ext.fandom.GlobalComponents.GlobalTopNavigation.messages", "ext.fandom.GlobalComponents.CommunityNavigation.js", "ext.fandom.GlobalComponents.GlobalFooter.js", "ext.fandom.GlobalComponents.CommunityHeader.js", "ext.fandom.GlobalComponents.StickyNavigation.js", "skin.fandomdesktop.rail.toggle.js", "skin.fandomdesktop.rail.lazyRail.js", "ext.fandom.nositenotice.js", "ext.fandom.Lightbox.js"] ``` -------------------------------- ### Retrieve RustDesk Connection Details for Jump Hosts Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/remoteaccess.txt This section displays the RustDesk connection information, including the ID and password, for various 'jumpblue' and 'jumpgrey' hosts. This data is crucial for establishing remote desktop connections. ```shell ok: [jumpblue1] => { "msg": "RustDesk ID: 507549506 -- Password: Friendship0!" } ok: [jumpblue2] => { "msg": "RustDesk ID: 514264008 -- Password: Friendship0!" } ok: [jumpblue3] => { "msg": "RustDesk ID: 515186532 -- Password: Friendship0!" } ok: [jumpblue4] => { "msg": "RustDesk ID: 513810519 -- Password: Friendship0!" } ok: [jumpblue5] => { "msg": "RustDesk ID: 515043480 -- Password: Friendship0!" } ok: [jumpblue6] => { "msg": "RustDesk ID: 1990674293 -- Password: Friendship0!" } ok: [jumpblue7] => { "msg": "RustDesk ID: 512381411 -- Password: Friendship0!" } ok: [jumpblue8] => { "msg": "RustDesk ID: 506287610 -- Password: Friendship0!" } ok: [jumpblue9] => { "msg": "RustDesk ID: 503963007 -- Password: Friendship0!" } ok: [jumpblue10] => { "msg": "RustDesk ID: 519436120 -- Password: Friendship0!" } ok: [jumpgrey1] => { "msg": "RustDesk ID: 515560629 -- Password: ponyuploc0!" } ok: [jumpgrey2] => { "msg": "RustDesk ID: 518635574 -- Password: ponyuploc0!" } ok: [jumpgrey3] => { "msg": "RustDesk ID: 505129719 -- Password: ponyuploc0!" } ok: [jumpgrey4] => { "msg": "RustDesk ID: 519002604 -- Password: ponyuploc0!" } ok: [jumpgrey5] => { "msg": "RustDesk ID: 513125055 -- Password: ponyuploc0!" } ok: [jumpgrey6] => { "msg": "RustDesk ID: 510578557 -- Password: ponyuploc0!" } ok: [jumpgrey7] => { "msg": "RustDesk ID: 1338717426 -- Password: ponyuploc0!" } ok: [jumpgrey8] => { "msg": "RustDesk ID: 514335282 -- Password: ponyuploc0!" } ok: [jumpgrey9] => { "msg": "RustDesk ID: 515088631 -- Password: ponyuploc0!" } ok: [jumpgrey10] => { "msg": "RustDesk ID: 516129048 -- Password: ponyuploc0!" } ``` -------------------------------- ### Host User Management Logic (JavaScript) Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/scoring_server/files/templates/editor.html Handles the loading and display of host users. It fetches user data based on a selected host ID and renders user information, including password update fields and buttons. It also includes logic to update user passwords via a POST request. ```javascript async function loadHosts() { const res = await fetch('/get_hosts'); const hosts = await res.json(); const list = document.getElementById('host-list'); list.innerHTML = hosts.map(h => `` ).join(''); } async function loadScoringUsers(hostId, el) { document.querySelectorAll('#host-list .sidebar-item').forEach(i => i.classList.remove('active')); el.classList.add('active'); const res = await fetch(`/get_scoring_users?host_id=${hostId}`); const users = await res.json(); const workspace = document.getElementById('user-workspace'); workspace.innerHTML = users.map(u => `
User: ${u.username}
Credential Update Required?
` ).join(''); } async function updatePassword(userId) { const pwd = document.getElementById(`pw-${userId}`).value; const res = await fetch('/update_scoring_user_pwd', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ user_id: userId, password: pwd }) }); if (res.ok) alert("Password updated in database."); } ``` -------------------------------- ### Create Desktop Directories with Ansible Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/linux_client_programs/tasks/README.md Ensures that the 'Desktop' directory exists in the user skeleton and for individual users. This task uses the `ansible.builtin.file` module to create directories with specified paths, ownership, and permissions. It's crucial for providing a consistent desktop environment for new and existing users. ```ansible - name: Fix desktop skeleton path ansible.builtin.file: path: /etc/skel/Desktop state: directory mode: "0755" become: true - name: Ensure desktop exsists for all users ansible.builtin.file: path: /usr/skel/Desktop state: directory mode: '0755' become: true - name: Ensure desktop exisits for existing users ansible.builtin.file: path: "/home/{{ item }}/Desktop" state: directory owner: "{{ item }}" group: "{{ item }}" mode: '0755' loop: "{{ linux_desktop_users }}" when: item in ansible_facts.getent_passwd become: true ``` -------------------------------- ### Explore Panel Styling (CSS) Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/windows_iis/files/site/index.html Styles the explore panel component, including its header, scrollable content area, and loading indicators. It defines the visual appearance and behavior of the panel, such as scrollbar styling and responsiveness. ```css .ExplorePanel-module_exploreHeader__qGV2k{color:var(--fandom-text-color);font-size:18px;font-weight:500;margin:12px 0}.ExplorePanel-module_wrapperLeftPanel__3O2wj{--fd-widget-primary-background-color:var(--fandom-widget-primary-background-color);--fd-widget-arrow-background-color:var(--fandom-widget-arrow-background-color);overflow-y:auto;padding:0 12px 12px}.ExplorePanel-module_wrapperLeftPanel__3O2wj::-webkit-scrollbar{width:12px}.ExplorePanel-module_wrapperLeftPanel__3O2wj::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:var(--fandom-global-nav-panel-scrollbar-color);border:4px solid #0000;border-radius:6px}.ExplorePanel-module_wrapperLeftPanel__3O2wj::-webkit-scrollbar-track{background-color:initial}@supports (-moz-appearance:none){.ExplorePanel-module_wrapperLeftPanel__3O2wj{scrollbar-color:var(--fandom-global-nav-panel-scrollbar-color) #0000;scrollbar-width:thin}}.ExplorePanel-module_wrapperLeftPanel__3O2wj h3{font-size:14px}.ExplorePanel-module_wrapperLeftPanel__3O2wj .fandom-spinner>svg circle{stroke:var(--fandom-link-color)}.ExplorePanel-module_loading__uRmUz{align-items:center;display:flex;height:100%}.ExplorePanel-module_exploreHeaderLink__B3k95:hover{cursor:pointer}.ExplorePanel-module_pages__y3LJ9{padding:12px 0}.ExplorePanel-module_pagesHeader__4RSUb{border-bottom:1px solid var(--fandom-border-color);color:var(--fandom-heading-color);font-size:18px;font-weight:700;line-height:1.5;padding-bottom:6px}.ExplorePanel-module_pagesList__ycPe8{display:flex;flex-direction:column;gap:12px;padding-top:12px}.ExplorePanel-module_widgetsWrapper__Wkctn{display:flex;flex-direction:column;gap:18px;width:256px}.ExplorePanel-module_noDataWrapper__A3zu6{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;padding:12px}.ExplorePanel-module_noDataMessage__ME-dB{align-items:center;color:var(--fandom-text-color);display:flex;flex-direction:column;font-size:12px;gap:6px;padding:30px;text-align:center}.ExplorePanel-module_noDataFandomIcon__X-3Y0{height:42px;width:42px}html[dir=rtl] .ExplorePanel-module_closeButton__d1DGL{margin-left:unset;margin-right:auto}html[dir=rtl] .ExplorePanel-module_closeChevron__Zfjn7{tr ``` -------------------------------- ### MediaWiki Configuration Settings Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/windows_iis/files/site/index.html JavaScript code snippet for setting MediaWiki configuration variables, including backend response time and page parse report details. This is typically used for performance monitoring and debugging. ```javascript (RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgBackendResponseTime":212,"wgPageParseReport":{"limitreport":{"cputime":"0.480","walltime":"0.796","ppvisitednodes":{"value":1855,"limit":1000000},"postexpandincludesize":{"value":61966,"limit":2097152},"templateargumentsize":{"value":4400,"limit":2097152},"expansiondepth":{"value":14,"limit":100},"expensivefunctioncount":{"value":0,"limit":100},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":3443,"limit":5000000},"timingprofile":["100.00% 79.747 1 -total"," 61.29% 48.879 1 Template:Infobox_episode"," 32.06% 25.565 15 Template:Nameconvert"," 9.24% 7.369 5 Template:Eps"," 7.22% 5.756 6 Template:Cite_web"," 6.06% 4.833 2 Template:Episode"," 5.12% 4.079 1 Template:Comic"," 3.29% 2.620 1 Template:Episodes,_films,_and_shorts"," 3.24% 2.584 1 Template:Has_spec"," 2.22% 1.769 1 Template:Defaultsort"]},"scribunto":{"limitreport-timeusage":{"value":"0.014","limit":"7.000"},"limitreport-memusage":{"value":1569534,"limit":104857600}},"cachereport":{"timestamp":"20260203033522","ttl":2592000,"transientcontent":false}}});}); ``` -------------------------------- ### Set Page Actions Configuration (JavaScript) Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/windows_iis/files/site/index.html This JavaScript code snippet configures page-specific actions for a MediaWiki-based site, likely Fandom. It sets up actions such as 'History', 'Purge', and 'Talk' with their corresponding URLs and tracking identifiers. This is typically used to customize the user interface for page management. ```javascript window.RLQ = window.RLQ || []; window.RLQ.push(() => { mw.config.set('wgPageActions', { "3": {"class": false, "text": "History", "href": "\/wiki\/Fluttershy_Leans_In?action=history", "id": "ca-history", "accesskey": "h", "data-tracking": "ca-history-dropdown"}, "5": {"class": false, "text": "Purge", "href": "\/wiki\/Fluttershy_Leans_In?action=purge", "id": "ca-purge", "data-tracking": "ca-purge-dropdown"}, "11": {"class": "new", "text": "Talk (0)", "href": "\/wiki\/Talk:Fluttershy_Leans_In?action=edit&redlink=1", "exists": false, "primary": true, "link-class": "new", "context": "talk", "rel": "discussion", "id": "ca-talk", "accesskey": "t", "data-tracking": "ca-talk-dropdown"} }); }); ``` -------------------------------- ### Responsive Banner Styling with CSS Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/windows_iis/files/site/index.html This CSS code defines styles for a banner, adapting its layout and appearance based on screen width. It includes rules for various breakpoints to ensure optimal display on different devices. No external dependencies are required. ```css ink{text-align:center}}@media only screen and (min-width: 550px){#onetrust-banner-sdk .banner-option:not(:first-child){border-left:1px solid #d8d8d8;padding-left:25px}}@media only screen and (min-width: 425px)and (max-width: 550px){#onetrust-banner-sdk.ot-iab-2 #onetrust-button-group,#onetrust-banner-sdk.ot-iab-2 .banner-option{width:100%}#onetrust-banner-sdk.ot-iab-2 #onetrust-button-group #onetrust-accept-btn-handler,#onetrust-banner-sdk.ot-iab-2 #onetrust-button-group #onetrust-reject-all-handler,#onetrust-banner-sdk.ot-iab-2 #onetrust-button-group #onetrust-pc-btn-handler{width:100%}#onetrust-banner-sdk.ot-iab-2 #onetrust-button-group #onetrust-accept-btn-handler,#onetrust-banner-sdk.ot-iab-2 #onetrust-button-group #onetrust-reject-all-handler{float:left}#onetrust-banner-sdk.ot-iab-2 #onetrust-button-group.ot-button-order-container{width:auto}}@media only screen and (min-width: 769px){#onetrust-banner-sdk #onetrust-button-group{margin-right:30%}#onetrust-banner-sdk #banner-options{margin-left:2em;margin-right:5em;margin-bottom:1.25em;width:calc(100% - 7em)}}@media only screen and (min-width: 897px)and (max-width: 1023px){#onetrust-banner-sdk.vertical-align-content #onetrust-button-group-parent{position:absolute;top:50%;left:80%;transform:translateY(-50%)}#onetrust-banner-sdk #onetrust-close-btn-container{top:50%;margin:auto;transform:translate(-50%, -50%);position:absolute;padding:0;right:0}#onetrust-banner-sdk #onetrust-close-btn-container button{position:relative;margin:0;right:-22px;top:2px}}@media only screen and (min-width: 1024px){#onetrust-banner-sdk #onetrust-close-btn-container{top:50%;margin:auto;transform:translate(-50%, -50%);position:absolute;right:0}#onetrust-banner-sdk #onetrust-close-btn-container button{right:-12px}#onetrust-banner-sdk #onetrust-policy{margin-left:2em}#onetrust-banner-sdk.vertical-align-content #onetrust-button-group-parent{position:absolute;top:50%;left:60%;transform:translateY(-50%)}#onetrust-banner-sdk .ot-optout-signal{width:50%}#onetrust-banner-sdk.ot-iab-2 #onetrust-policy-title{width:50%}#onetrust-banner-sdk.ot-iab-2 #onetrust-policy-text,#onetrust-banner-sdk.ot-iab-2 :not(.ot-dpd-desc)>.ot-b-addl-desc{margin-bottom:1em;width:50%;border-right:1px solid #d8d8d8;padding-right:1rem}#onetrust-banner-sdk.ot-iab-2 #onetrust-policy-text{margin-bottom:0;padding-bottom:1em}#onetrust-banner-sdk.ot-iab-2 :not(.ot-dpd-desc)>.ot-b-addl-desc{margin-bottom:0;padding-bottom:1em}#onetrust-banner-sdk.ot-iab-2 .ot-dpd-container{width:45%;padding-left:1rem;display:inline-block;float:none}#onetrust-banner-sdk.ot-iab-2 .ot-dpd-title{line-height:1.7}#onetrust-banner-sdk.ot-iab-2 #onetrust-button-group-parent{left:auto;right:4%;margin-left:0}#onetrust-banner-sdk.ot-iab-2 #onetrust-button-group button{display:block}#onetrust-banner-sdk:not(.ot-iab-2) #onetrust-button-group-parent{margin:auto;width:30%}#onetrust-banner-sdk:not(.ot-iab-2) #onetrust-group-container{width:60%}#onetrust-banner-sdk #onetrust-button-group{margin-right:auto}#onetrust-banner-sdk #onetrust-accept-btn-handler,#onetrust-banner-sdk #onetrust-reject-all-handler,#onetrust-banner-sdk #onetrust-pc-btn-handler{margin-top:1em}}@media only screen and (min-width: 890px){#onetrust-banner-sdk.ot-buttons-fw:not(.ot-iab-2) #onetrust-button-group-parent{padding-left:3%;padding-right:4%;margin-left:0}#onetrust-banner-sdk.ot-buttons-fw:not(.ot-iab-2) #onetrust-button-group{margin-right:0;margin-top:1.25em;width:100%}#onetrust-banner-sdk.ot-buttons-fw:not(.ot-iab-2) #onetrust-button-group button{width:100%;margin-bottom:5px;margin-top:5px}#onetrust-banner-sdk.ot-buttons-fw:not(.ot-iab-2) #onetrust-button-group button:last-of-type{margin-bottom:20px}}@media only screen and (min-width: 1280px){#onetrust-banner-sdk:not(.ot-iab-2) #onetrust-group-container{width:55%}#onetrust-banner-sdk:not(.ot-iab-2) #onetrust-button-group-parent{width:44%;padding-left:2%;padding-right:2%}#onetrust-banner-sdk:not(.ot-iab-2).vertical-align-content #onetrust-button-group-parent{position:absolute;left:55%}} #onetrust-consent-sdk #onetrust-banner-sdk {background-color: #FFFFFF;} #onetrust-consent-sdk #onetrust-policy-title, #onetrust-consent-sdk #onetrust-policy-text, #onetrust-consent-sdk .ot-b-addl-desc, #onetrust-consent-sdk .ot-dpd-desc, #onetrust-consent-sdk .ot-dpd-title, #onetrust-consent-sdk #onetrust-policy-text *:not(.onetrust-vendors-list-handler), #onetrust-consent-sdk .ot-dpd-desc *:not(.onetrust-vendors-list-handler), #onetrust-consent-sdk #onetrust-banner-sdk #banner-options *, #onetrust-consent-sdk .ot-cat-header, #onetrust-consent-sdk .ot-optout-signal { color: #696969; } #onetrust-consent-sdk #onetrust-banner-sdk .banner-option-details { background-color: #E9E9E9;} #onetrust-consent-sdk #onetrust-banner-sdk a[href], #onetrust-consent-sdk #onetrust-banner-sdk a[href] font, #onetrust-consent-sdk #onetrust-banner-sdk .ot-link-btn { color: #520044; }#onetrust-consent-sdk #onetrust-accept-btn-handler, #onetrust-banner-sdk #onetrust-reject ``` -------------------------------- ### Run Post-Deployment Cleanup with Ansible Source: https://context7.com/guac0/2255-csec473-alpha/llms.txt Executes the 'post_deploy' tag on Ansible playbooks to perform cleanup operations after deployment. This ensures that the environment is in a clean state. It requires an inventory file (inventory.yaml) and a playbook file (playbook.yaml). ```bash # Run post-deployment cleanup ansible-playbook -i inventory.yaml playbook.yaml -t post_deploy ``` -------------------------------- ### Define Fixed IP Addresses for Deployment Instances Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/remoteaccess.txt These variables define the fixed external and internal IP addresses used for deploying instances. They are simple string assignments and do not have external dependencies. ```hcl instance_fixed_ip_deploy_external = "172.20.0.80" instance_fixed_ip_deploy_internal = "100.65.3.219" ``` -------------------------------- ### Deploy OpenVPN Server using Ansible Source: https://context7.com/guac0/2255-csec473-alpha/llms.txt Deploys an OpenVPN server for remote access using an Ansible playbook. Requires an inventory file and the playbook itself. ```ansible ansible-playbook -i inventory.yaml playbook.yaml -t openvpn_server ``` -------------------------------- ### Styling OneTrust Accept, Reject, and PC Buttons Source: https://github.com/guac0/2255-csec473-alpha/blob/main/greyteam/roles/windows_iis/files/site/index.html Defines styles for the primary action buttons in the OneTrust banner: Accept, Reject All, and Privacy Center. Includes background color, text color, borders, and specific sizing for different button types. ```css #onetrust-banner-sdk #onetrust-accept-btn-handler,#onetrust-banner-sdk #onetrust-reject-all-handler,#onetrust-banner-sdk #onetrust-pc-btn-handler{background-color:#68b631;color:#fff;border-color:#68b631;margin-right:1em;min-width:125px;height:auto;white-space:normal;word-break:break-word;word-wrap:break-word;padding:12px 10px;line-height:1.2;font-size:.813em;font-weight:600} #onetrust-banner-sdk #onetrust-pc-btn-handler.cookie-setting-link{background-color:#fff;border:none;color:#68b631;text-decoration:underline;padding-left:0;padding-right:0} ```