Code Monkey home page Code Monkey logo

mfthomps / labtainers Goto Github PK

View Code? Open in Web Editor NEW
253.0 15.0 67.0 266 MB

Labtainers: A Docker-based cyber lab framework

Home Page: https://nps.edu/web/c3o/labtainers

Shell 10.85% Python 25.14% Makefile 0.28% TeX 13.49% HTML 17.66% C 3.64% C++ 1.43% JavaScript 6.24% PHP 0.19% CSS 4.66% Java 15.88% Tcl 0.03% Batchfile 0.01% Assembly 0.01% Dockerfile 0.01% Classic ASP 0.02% Smalltalk 0.11% Rich Text Format 0.14% PowerShell 0.23% Vim Script 0.01%
docker cybersecurity labs

labtainers's Introduction

Labtainers: A Docker-based cyber lab framework

Labtainers include more than 50 cyber lab exercises and tools to build your own. Import a single VM appliance or install on a Linux system and your students are done with provisioning and administrative setup, for these and future lab exercises.

  • Consistent lab execution environments and automated provisioning via Docker containers
  • Multi-component network topologies on a modestly performing laptop computer
  • Automated assessment of student lab activity and progress
  • Individualized lab exercises to discourage sharing solutions

Labtainers provide controlled and consistent execution environments in which students perform labs entirely within the confines of their computer, regardless of the Linux distribution and packages installed on the student's computer. Labtainers run on our [VM appliance][vm-appliancee], or on any Linux with Dockers installed. And Labtainers is available as cloud-based VMs, e.g., on Azure as described in the Student Guide.

See the Student Guide for installation and use, and the Instructor Guide for student assessment. Developing and customizing lab exercises is described in the Designer Guide. See the Papers for additional information about the framework. The Labtainers website, and downloads (including VM appliances with Labtainers pre-installed) are at https://nps.edu/web/c3o/labtainers.

Distribution created: 11/27/2023 08:11
Revision: v1.3.7u
Commit: 17480149
Branch: master

Content

Distribution and Use

Guide to directories

Support

Release notes

Distribution and Use

Please see the licensing and distribution information in the docs/license.md file.

Guide to directories

  • scripts/labtainers-student -- the work directory for running and testing student labs. You must be in that directory to run student labs.

  • scripts/labtainers-instructor -- the work directory for running and testing automated assessment and viewing student results.

  • labs -- Files specific to each of the labs

  • setup_scripts -- scripts for installing Labtainers and Docker and updating Labtainers

  • docs -- latex source for the labdesigner.pdf, and other documentation.

  • UI -- Labtainers lab editor source code (Java).

  • headless-lite -- scripts for managing Docker Workstation and cloud instances of Labtainers (systems that do not have native X11 servers.)

  • scripts/designer -- Tools for building new labs and managing base Docker images.

  • config -- system-wide configuration settings (these are not the lab-specific configuration settings.

  • distrib -- distribution support scripts, e.g., for publishing labs to the Docker hub.

  • testsets -- Test procedures and expected results. (Per-lab drivers for SimLab are not distributed).

  • pkg-mirrors -- utility scripts for internal NPS package mirroring to reduce external package pulling during tests and distribution.

Support

Use the GitHub issue reports, or email me at [email protected]

Also see https://my.nps.edu/web/c3o/support1

Release notes

The standard Labtainers distribution does not include files required for development of new labs. For those, run ./update-designer.sh from the labtainer/trunk/setup_scripts directory.

The installation script and the update-designer.sh script set environment variables, so you may want to logout/login, or start a new bash shell before using Labtainers the first time.

November 27, 2023

  • Add Google Cloud Platform option for ubuntu22 on ec2 machine.

September 18, 2023

  • Previous fix implementation was flawed.

August 8, 2023

  • Handle change to DockerHub image json format. Thanks Kees!

April 17, 2023

  • Force use latest lab version, e.g., iptables2 intead of iptables. Fix tab completion to only display latest. (Issue #77)
  • CyberCIEGE lab installation was failing due to X11 race condition. (Issue #76)
  • Note in CyberCIEGE readme to direct students to save collected logs in $HOME directory. (Issue #75)
  • Radius lab checkwork was incorrectly reporting "radiusd not running", missing prestop script. (Issue #74)
  • Labedit corrupted the start configuration file when the MACVLAN_EXT option was used. (Issue #73)

February 1, 2023

  • Bash history for non-default users was not being saved. January 26, 2023
  • Modified powershell scripts for gcloud to use the selected zone to qualify VM names. January 4, 2023
  • Containers using systemd were failing on newer systemd present in Ubuntu 22
  • Add --zone parameter to google cloud scripts, with value derived from the set_defaults script. December 21, 2022
  • Fix xforge results criteria to not expect pathname, and add check to see if POST issued to edit profile. And fix attacker http server to run from the home directory. December 19, 2022
  • Add strace lab to introduce system call tracing.
  • X11 DISPLAY value was incorrect if multiple devices in the /tmp/.X11-unix directory.
  • Use of python/bash/sh/etc with no arguments was causing capinout to crash. December 9, 2022
  • Modify Azure vm creation script to use a prebuilt Labtainer VM image from the Azure Community Gallery.
  • Terminals on cloud VMs crash for unknown reasons during startup or right click on the terminal. Attempt to address by start/stop of a terminal. December 5, 2022
  • When collecting artifacts, include modified files from directories of non-default users, e.g., their bash histories.
  • Alter web assessment to display the new "other user" files.
  • Include files from .local/bin on each container in artifacts. Intended to make these available to instructor via web assesment.
  • In the ACL lab, include th /shared_data/bob/fun file in the results for reference by the instructor.
  • Catch use of "sh" or "bash" from command line and skip when parsing for given command, e.g., as done with "time" or "sudo".
  • In the tcpip lab, could not ssh into the server during subsequent lab sessions, the /run/sshd directory was not being remade. November 16, 2022
  • Fix path to Snort Manual in snort lab.
  • In ossec manual,fix path to manage_agents October 12, 2022
  • Google cloud remove background operator from gnome-terminal command, still crashes on right click but seems stable after running a newterm.sh. October 10, 2022
  • Fix Google cloud newterm.sh; expand that boot disk to 30G. September 20, 2022
  • Note user id and password for TCP/IP lab in the lab manual. August 30, 2022
  • Use the X11 socket name when setting DISPLAY from a container's .profile August 9, 2022
  • Fix name of processValueMax function in grader. Issue #63

August 4, 2022

  • The labedit program was rebuilt with the wrong JDK, preventing older JREs from running labedit

July 18, 2022

  • Creation of Ubuntu20-based containers was failing within IModules. Issue #61.

March 23, 2022

  • Fix path to tap lock directory; was causing failure of labs using network taps
  • Update plc-traffic netmon computer to have openjfx needed for new grassmarlin in java environment
  • Speed up lab startup by avoiding chown -R, which is very slow in docker.
  • Another shot at avoiding deletion of the X11 link in container /tmp directory.
  • Fix webtrack counting of sites visited and remove live-headers goal, that tool is no longer available. Clarified some lab manual steps.

March 2, 2022

  • Add new ssh-tunnel lab (thanks GWD!)
  • Fix labedit failure to reflect X11 value set by new_lab_setup
  • Add option to not parameterize a container

February 23, 2022

  • labedit was corrupting start.config after addition of new containers
  • Incorrect path to student guide in the student README file; dynamically change for cloud configs
  • Incorrect extension to update-labtainer.sh
  • Msc guide enahancements
  • Update the ghidra lab to include version 10.1.2 of Ghidra

February 15, 2022

  • Revert Azure cloud support to provision for each student. Azure discourages sharing resources.

January 24, 2022

  • Azure cloud now uses image stored in an Azure blob instead of provisioning for each student.
  • Added support for Google Cloud.

January 19, 2022

  • Introduce Labtainers on the Azure cloud. See the Student Guide for details on how to use this.

January 3, 2022

  • Revise setuid-env lab to add better assessment; simlab testing and avoid sighup in the printenv child.
  • Fix assessment goal count directive to exclude result tag values of false.
  • Do not require labname when using gradelab -a with a grader started with the debug option.
  • Revise capinout (stdin/stdout mirroring) to handle orphaning of command process children, improved documentation and error handling.
  • Added display of progress bars of docker images being pulled when a lab is first run.
  • User feedback on progress of container initialization.
  • The pcap-lib lab was missing a notify file needed for automated assessment; Remove extraneous step from Lab Manual.

November 23, 2021

  • Disable ubuntu popup errors on test VM.
  • Fix handling of different DISPLAY variable formats.

October 22, 2021

  • Revise the tcpip lab guide to note a successful syn-flood attack is not possible. Fix its automated assessment and add SimLab scripts.
  • Change artifact file extension from zip to lab, and add a preamble to confuse GUI file managers. Students were opening the zip and submitting its guts.
  • Make the -r option to gradelab the default, add a -c option for cumulative use of grader.
  • Modify refresh_mirror to refer to the local release date to avoid frequent queries of DockerHub. Each such query counts as an image pull, and they are now trying to monetize those.

September 30, 2021

  • Change bufoverflow lab guide and grading to not expect success with ASLR turned on, assess whether it was run.
  • Error handling for web grader for cases where student lacks results.
  • Print warning when deprecated lab is run.
  • Change formatstring grading to remove unused "_leaked_secret" description and clarify value of leaked_no_scanf.
  • Also change formatstring grading to allow any name for the vulnerable executable.

September 29, 2021

  • Gradelab error handling, reduce instances of crashes due to bad zip files.
  • Limit stdout artifact files to 1MB

September 17, 2021

  • Ghidra lab guide had wrong IP address, was not remade from source.

September 14, 2021

  • Example labs for LDAP and Mariadb using SSL. Intended as templates for new labs.
  • Handle Mariadb log format
  • Add per-container parameters to limit CPU use or pin container to CPU set.
  • Labpack creation now available via a GUI (makepackui).
  • Tab completion for the labtainer, labpack and gradelab commands.
  • New parallel computing lab ``parallel'' using MPI.

August 3, 2021

  • Add a "WAIT_FOR" configuration option to cause a container to delay parameterization until another container completes its parameterization.
  • Support for Mariadb log formats in results parsing
  • Remove support for Mac and Windows use of Docker Desktop. That product is too unstable for us to support.
  • Supress stderr messages when user uses built-in bash commands such as "which".
  • Bug fixes to makepack/labpack programs.

July 19, 2021

  • Add a DNS lab to introduce the DNS protocol and configuration.
  • Revised VirtualBox appliance image to start with the correct update script.
  • Split resolv.conf nameserver parameter out of the lab_gw configuration field into its own value.
  • IModule command failed if run before any labs had been started.

July 5, 2021

  • Errors in DISPLAY env variable management broke GUI applications on Docker Desktop.

July 1, 2021

  • Support Mac package installation of headless Labtainers.
  • The routing-basics lab automated assessment failed due to lack of treataslocal files
  • Correct typos and incorrect addresses in routing-basics lab, and fix automated assessment.
  • Assessment of pcapanalysis was failing.

June 10, 2021

  • All lab manual PDFs are now in the github repo
  • Convert vpnlab and vpnlab2 instructions to PDF lab manuals.

May 25, 2021

  • Add searchable keywords to each lab. See "labtainer -h" for usage.
  • Expand routing-basics lab and lab manual
  • Remove routing-basics2 lab, it is now redundant.
  • sudo on some containers failed because hostnames remove underscores, leading to mismatch with the hosts file. Fix with extra entry in the hosts file with container name sans underscore.
  • New Labpack feature to package a collection of labs, and makepack tool to create Labpacks.
  • Error check for /sbin directory when using ubuntu20 -- would be silently fatal.
  • New network-basics lab

May 5, 2021

  • Introduce a new users lab to introduce user/group management
  • Surpress Apparmor host messages in centos container syslogs

April 28, 2021

  • New base2 images lacked man pages. Used unminimize to restore them in the base image.
  • Introduce a OSSEC host-based IDS lab.

April 13, 2021

  • CyberCIEGE lab failed because X11 socket was not relocated prior to starting Wine via fixlocal.

April 9, 2021

  • New gdb-cpp tutorial lab for using GDB on a simple C++ program.
  • Floating point exceptions were revealing use of exec_wrap.sh for stdin/stdout mirroring.

April 7, 2021

  • ldap lab failed when moved to Ubuntu 20. Problem traced to problem with nscd cache of pwd. Move ldap to Ubuntu 20

March 23, 2021

  • Parameterizing with RANDOM did not include the upper bound.
  • Add optional step parameter to RANDOM, e.g., to ensure word boundaries.
  • db-access lab: add mysql-workbench to database computer.
  • New overrun lab to illustrate memory references beyond bounds of c data structures.
  • New printf lab to introduce memory references made by the printf function.

March 19, 2021

  • gradelab ignore makdirs error, problem with Windows rmtree on shared folders.
  • gradelab handle spaces in student zip file names.
  • gradelab handle zip file names from Moodle, including build downloads.

March 12, 2021

  • labedit UI: Remove old wireshark image from list of base images.
  • labedit UI: Increase some font sizes.
  • grader web interface failed to display lab manuals if the manual name does not follow naming conventions.

March 11, 2021

  • labedit UI add registry setting in new global lab configuration panel.

March 10, 2021

  • labedit UI fixes to not build if syntax error in lab
  • labedit UI "Lab running" indicator fix to reflect current lab.

March 8, 2021

  • Deprecate use of HOST_HOME_XFER, all labs use directory per the labtainer.config file.
  • Add documentation comment to start.config for REGISTRY and BASE_REGISTRY

March 5, 2021

  • Error handling on gradelab web interface when missing results.
  • labedit addition of precheck, msc bug fixes.

February 26, 2021

  • The dmz-example lab had errors in routing and setup of dnsmasq on some components.

February 18, 2021

  • UI was rebuilding images because it was updating file times without cause
  • Clean up UI code to remove some redundant data copies.

February 14, 2021

  • Add local build option to UI
  • Create empty faux_init for centos6 bases.

February 11, 2021

  • Fix UI handling of editing files. Revise layout and eliminate unused fields.
  • Add ubuntu20 base2 base configuration along with ssh2, network2 and wireshark2
  • The new wireshark solves the prolem of black/noise windows.
  • Map /tmp/.X11-unix to /var/tmp and create a link. Needed for ubuntu20 (was deleting /tmp?) and may fix others.

February 4, 2021

  • Add SIZE option to results artifacts
  • Simplify wireshark-intro assessment and parameterization and add PDF lab manual.
  • Provide parameter list values to pregrade.sh script as environment variables
  • enable X11 on the grader
  • put update-designer.sh into users path.

January 19, 2021

  • Change management of README date/rev to update file in source repo.
  • Introduce GUI for creating/editing labs -- see labedit command.

December 21, 2020

  • The gradelab function failed when zip files were copied from a VirtualBox shared folder.
  • Update Instructor Guide to describe management of student zip files on host computers.

December 4, 2020

  • Transition distribution of tar to GitHub releaese artifacts
  • Eliminate seperate designer tar file, use git repo tarball.
  • Testing of grader web functions for analysis of student lab artifacts
  • Clear logs from full smoketest and delete grader container in removelab command.

December 1, 2020

  • The iptables2 lab assessment relied on random ports being "unknown" to nmap.
  • Use a sync diretory to delay smoketests from starting prior to lab startup.
  • Begin integrating Lab designer UI elements.

October 13, 2020

  • Headless configuraions for running on Docker Desktop on Macs & Windows
  • Headless server support, cloud-config file for cloud deployments
  • Testing support for headless configurations
  • Force mynotify to wait until rc.local runs on boot
  • Improve mynotify service ability to merge output into single timestamp
  • Python3 for stopgrade script
  • SimLab now uses docker top rather than system ps

September 26, 2020

  • Clean up the stoplab scripts to ignore non-lab containers
  • Add db-access database access control lab for controlles sharing of a mysql db.

September 17, 2020

  • The macs-hash lab was unable to run Leafpad due to the X11 setting.
  • Grader logging was being redirected to the wrong log file, now captures errors from instructor.py
  • Copy instructor.log from grader to the host logs directory if there is an error.

August 28, 2020

  • Fix install script to use python3-pip and fix broken scripts: getinfo.py and pull-all.py
  • Registry logic was broken, test systems were not using the test registry, add development documentation.
  • Add juiceshop and owasp base files for OWASP-based web security labs
  • Remove unnecessary sudos from check_nets
  • Add CHECK_OK documentation directive for automated assessment
  • Change check_nets to fix iptables and routing issues if so directed.

August 12, 2020

  • Add timeout to prestop scripts
  • Add quiz and checkwork to dmz-lab
  • Restarting the dmz-lab without -r option broke routing out of the ISP.
  • Allow multiple files for time_delim results.

August 6, 2020

  • Bug in error handling when X11 socket is missing
  • Commas in quiz questions led to parse errors
  • Add quiz and checkwork to iptables2 lab

July 28, 2020

  • Add quiz support -- these are guidance quizzes, not assessment quizzes. See the designer guide.
  • Add current-state assessment for use with the checkwork command.

July 21, 2020

  • Add testsets/bin to designer's path
  • Designer guide corrections and explainations for IModule steps.
  • Add RANGE_REGEX result type for defining time ranges using regular expressions on log entries.
  • Check that X11 socket exists if it is needed when starting a lab.
  • Add base image for mysql
  • Handle mysql log timestamp formats in results parsing.

June 15, 2020

  • New base image contianing the Bird open source router
  • Add bird-bgp Border Gateway Protocol lab.
  • Add bird-ospf Open Shortest Path First routing protocol.
  • Improve handling of DNS changes, external access from some containers was blocked in some sites.
  • Add section to Instructor Guide on using Labtainers in environments lacking Internet access.

May 21, 2020

  • Move all repositories to the Docker Hub labtainers registry
  • Support mounts defined in the start.config to allow persistent software installs
  • Change ida lab to use persistent installation of IDA -- new name is ida2
  • Add cgc lab for exploration of over 200 vulnerable services from the DARPA Cyber Grand Challenge
  • Add type_string command to SimLab
  • Add netflow lab for use of NetFlow network traffic analysis
  • Add 64-bit versions of the bufoverflow and the formatstring labs

April 9, 2020

  • Grader failed assessment of CONTAINS and FILE_REGX conditions when wildcards were used for file selection.
  • Include hints for using hexedit in the symlab lab.
  • Add hash_equal operator and hash-goals.py to automated assessment to avoid publishing expected answers in configuration files.
  • Automated assessment for the pcap-lib lab.

April 7, 2020

  • Logs have been moved to $LABTAINER_DIR/logs
  • Other cleanup to permit rebuilds and tests using Jenkins, including use of unique temporary directories for builds
  • Move build support functions out of labutils into build.py
  • Add pcap-lib lab for PCAP library based development of traffic analysis programs

March 13, 2020

  • Add plc-traffic lab for use of GrassMarlin with traffic generated during the lab.
  • Introduce ability to add "tap" containers to collect PCAPs from selected networks.
  • Update GNS3 documentation for external access to containers, and use of dummy_hcd to simulate USB drives.
  • Change kali template to use faux_init rather than attempting to use systemd.
  • Moving distributions (tar files) to box.com
  • Change SimLab use of netstat to not do a dns lookup.

February 26, 2020

  • If labtainer command does not find lab, suggest that user run update-labtainer.sh
  • Add support preliminary support for a network tap component to view all network traffic.
  • Script to fetch lab images to prep VMs that will be used without internet.
  • Provide username and password for nmap-discovery lab.

February 18, 2020

  • Inherit the DISPLAY environment variable from the host (e.g., VM) instead of assuming :0

February 14, 2020

  • Add Ghidra software reverse engineering introduction exercise.

February 11, 2020

  • Update guides to describe remote access to containers withing GNS3 environments
  • Hide selected components and links within GNS3.
  • Figures in the webtrack lab guide were not visible; typos in this and nmap-ssh

February 6, 2020

  • Introduce function to remotely manage containers, e.g., push files.
  • Add GNS3 environment function to simulate insertion of a USB drive.
  • Improve handling of Docker build errors.

February 3, 2020

  • On the metasploit lab, the postgresql service was not running on the victim.
  • Merge the IModule manual content into the Lab Designer guide.
  • More IModule support.

January 27, 2020

  • Introduce initial support for IModules (instructor-developed labs). See docs/imodules.pdf.
  • Fix broken LABTAINER_DIR env variable within update-labtainer
  • Fix access mode on accounting.txt file in ACL lab (had become rw-r-r). Use explicit chmod in fixlocal.sh.

January 14, 2020

  • Port framework and gradelab to Python3 (existing Python2 labs will not change)
    • Use backward compatible random.seed options
    • Hack non-compatable randint to return old values
    • Continue to support python2 for platforms that lack python3 (or those such as the older VM appliance that include python 3.5.2, which breaks random.seed compatability).
    • Add rebuild alias for rebuild.py that will select python2 if needed.
  • Centos-based labs manpages were failing; use mandb within base docker file
  • dmz-lab netmask for DMZ network was wrong (caught by python3); as was IP address of inner gateway in lab manual
  • ghex removed from centos labs -- no longer easily supported by centos 7
  • file-deletion lab must be completed without rebooting the VM, note this in the Lab Manual.
  • Add NO_GW switch to start.config to disable default gateways on containers.
  • Metasploit lab, crashes host VM if runs as privileged; long delays on su if systemd enabled; so run without systemd. Remove use of database from lab manual, configure to use new no_gw switch
  • Update file headers for licensing/terms; add consolidated license file.
  • Modify publish.py to default to use of test registry, use -d to force use of default_registry
  • Revise source control procedures to use different test registry for each branch, and use a premaster branch for final testing of a release.

October 9, 2019

  • Remove dnsmasq from dns component in the dmz-lab. Was causing bind to fail on some installations.

October 8, 2019

  • Syntax error in test registry setup; lab designer info on large files; fetch bigexternal.txt files

September 30, 2019

  • DockerHub registry retrieval again failing for some users. Ignore html prefix to json.

September 20, 2019

  • Assessment of onewayhash should allow hmac operations on file of student's choosing.

September 5, 2019

  • Rebuild metasploit lab, metasploit-framework exhibited a bug. And the labs "treataslocal" file was left out of the move from svn. Fix type in metasploit lab manual.

August 30, 2019

  • Revert test for existence of container directories, they do not always exist.

August 29, 2019

  • Lab image pulls from docker hub failed due to change in github or curl? Catch rediret to cloudflare. Addition of GNS3 support. Fix to dmz-lab dnssec.

July 11, 2019

  • Automated assessment for CentOS6 containers, fix for firefox memory issue, support arbitrary docker create arguments in the start.config file.

June 6, 2019

  • Introduce a Centos6 base, but not support for automated assessment yet

May 23, 2019

  • Automated assessment of setuid-env failed due to typos in field seperators.

May 8, 2019

  • Corrections to Capabilities lab manual

May 2, 2019

  • Acl lab fix to bobstuff.txt permissions. Use explicit chmod in fixlocal.sh
  • Revise student guide to clarify use of stop and -r option in body of the manual.

March 9, 2019

  • The checkwork function was reusing containers, thereby preventing students from eliminating artifacts from previous lab work.
  • Add appendix to the symkey lab to describe the BMP image format.

February 22, 2019

  • The http server failed to start in the vpn and vpn2 labs. Automated assessment removed from those labs until reworked.

January 7, 2019

  • Fix gdblesson automated assessment to at least be operational.

January 27, 2019

  • Fix lab manual for routing-basics2 and fix routing to enable external access to internal web server.

December 29, 2018

  • Fix routing-basics2, same issues as routing-basics, plus an incorret ip address in the gateway resolv.conf

December 5, 2018

  • Fix routing-basics lab, dns resolution at isp and gatway components was broken.

November 14, 2018

  • Remove /run/nologin from archive machine in backups2 -- need general solution for this nologin issue

November, 5, 2018

  • Change file-integrity lab default aid.conf to track metadata changes rather than file modification times

October 22, 2018

  • macs-hash lab resolution verydodgy.com failed on lab restart
  • Notify function failed if notify_cb.sh is missing

October 12, 2018

  • Set ulimit on file size, limit to 1G

October 10, 2018

  • Force collection of parameterized files
  • Explicitly include leafpad and ghex in centos-xtra baseline and rebuild dependent images.

September 28, 2018

  • Fix access modes of shared file in ACL lab
  • Clarify question in pass-crack
  • Modify artifact collection to ignore files older than start of lab.
  • Add quantum computing algorithms lab

September 12, 2018

  • Fix setuid-env grading syntax errors
  • Fix syntax error in iptables2 example firewall rules
  • Rebuild centos labs, move lamp derivatives to use lamp.xtr for waitparam and force httpd to wait for that to finish.

September 7, 2018

  • Add CyberCIEGE as a lab
  • read_pre.txt information display prior to pull of images, and chance to bail.

September 5, 2018

  • Restore sakai bulk download processing to gradelab function.
  • Remove unused instructor scripts.

September 4, 2018

  • Allow multiple IP addresses per network interface
  • Add base image for Wine
  • Add GRFICS virtual ICS simulation

August 23, 2018

  • Add GrassMarlin lab (ICS network discovery)

August 23, 2018

  • Add GrassMarlin lab (ICS network discovery)

August 21, 2018

  • Another fix around AWS authentication issues (DockerHub uses AWS).
  • Fix new_lab_setup.py to use git instead of svn.
  • Split plc-forensics lab into a basic lab and and advanced lab (plc-forensics-adv)

August 17, 2018

  • Transition to git & GitHub as authoritative repo.

August 15, 2018

  • Modify plc-forensics lab assessment to be more general; revise lab manual to reflect wireshark on the Labtainer.

August 15, 2018

  • Add "checkwork" command allowing students to view automated assessment results for their lab work.
  • Include logging of iptables packet drops in the iptables2 and the iptables-ics lab.
  • Remove obsolete instances of is_true and is_false from goal.config
  • Fix boolean evaluation to handle "NOT foo", it had expected more operands.

August 9, 2018

  • Support parameter replacement in results.config files
  • Add TIME_DELIM result type for results.config
  • Rework the iptables lab, remove hidden nmap commands, introduce custom service

August 7, 2018

  • Add link to student guide in labtainer-student directory
  • Add link to student guide on VM desktops
  • Fixes to iptables-ics to avoid long delay on shutdown; and fixes to regression tests
  • Add note to guides suggesting student use of VM browser to transfer artifact zip file to instructor.

August 1, 2018

  • Use a generic Docker image for automated assessment; stop creating "instructor" images per lab.

July 30, 2018

  • Document need to unblock the waitparam.service (by creating flag directory) if a fixlocal.sh script is to start a service for which waitparam is a prerequisite.
  • Add plc-app lab for PLC application firewall and whitelisting exercise.

July 25, 2018

  • Add string_contains operator to goals processing
  • Modify assessment of formatstring lab to account for leaked secret not always being at the end of the displayed string.

July 24, 2018

  • Add SSH Agent lab (ssh-agent)

July 20, 2018

  • Support offline building, optionally skip all image pulling
  • Restore apt/yum repo restoration to Dockerfile templates.
  • Handle redirect URL's from Docker registry blob retrieval to avoid authentication errors (Do not rely on curl --location).

July 12, 2018

  • Add prestop feature to allow execution of designer-specified scripts on selected components prior to lab shutdown.
  • Correct host naming in the ssl lab, it was breaking automated assessment.
  • Fix dmz-lab initial state to permit DNS resolutions from inner network.
  • FILE\REGEX processing was not properly handling multiline searches.
  • Framework version derived from newly rebuilt images had incorrect default value.

July 10, 2018

  • Add an LDAP lab
  • Complete transition to systemd based Ubuntu images, remove unused files
  • Move lab_sys tar file to per-container tmp directory for concurrency.

July 6, 2018

  • All Ubuntu base images replaced with versions based on systemd
  • Labtainer container images in registry now tagged with base image ID & have labels reflecting the base image.
  • A given installation will pull and use images that are consistent with the base images it possesses.
  • If you are using a VM image, you may want to replace that with a newer VM image from our website.
  • New labs will not run without downloading newer base images; which can lead to your VM storing multiple versions of large base images (> 500 MB each).
  • Was losing artifacts from processes that were running when lab was stopped -- was not properly killing capinout processes.

June 27, 2018

  • Add support for Ubuntu systemd images
  • Remove old copy of SimLab.py from labtainer-student/bin
  • Move apt and yum sources to /var/tmp
  • Clarify differences between use of "boolean" and "count_greater" in assessments
  • Extend Add-HOST in start.config to include all components on a network.
  • Add option to new_lab_setup.py to add a container based on a copy of an existing container.

June 21, 2018

  • Set DISPLAY env for root
  • Fix to build dependency handling of svn status output
  • Add radius lab
  • Bug in SimLab append corrected
  • Use svn, where appropriate, to change file names with new_lab_setup.py

June 19, 2018

  • Retain order of containers defined in start.conf when creating terminal with multiple tabs
  • Clarify designer manual to identify path to assessment configuration files.
  • Remove prompt for instructor to provide email
  • Botched error checking when testing for version number
  • Include timestamps of lab starts and redos in the assessment json
  • Add an SSL lab that includes bi-directional authentication and creation of certificates.

June 14, 2018

  • Add diagnostics to parameterizing, track down why some install seem to fail on that.
  • If a container is already created, make sure it is parameterized, otherwise bail to avoid corrupt or half-baked containers.
  • Fix program version number to use svn HEAD

June 15, 2018

  • Convert plain text instructions that appeared in xterms into pdf file.
  • Fix bug in version handling of images that have not yet been pulled.
  • Detect occurance of a container that was created, but not parameterized, and prompt the user to restart the lab with the "-r" option.
  • Add designer utility: rm_svn.py so that removed files trigger an image rebuild.

June 13, 2018

  • Install xterm on Ubuntu 18 systems
  • Work around breakage in new versions of gnome-terminal tab handling

June 11, 2018

  • Add version checking to compare images to the framework.
  • Clarify various lab manuals

June 2, 2018

  • When installing on Ubuntu 18, use docker.io instead of docker-ce
  • The capinout caused a crash when a "sudo su" monitored command is followed by a non-elevated user command.
  • Move routing and resolv.conf settings into /etc/rc.local instead of fixlocal.sh so they persist across start/stop of the containers.

May 31, 2018

  • Work around Docker bug that caused text to wrap in a terminal without a line feed.
  • Extend COMMAND_COUNT to account for pipes
  • Create new version of backups lab that includes backups to a remote server and backs up an entire partition.
  • Alter sshlab instructions to use ssh-copy-id utility
  • Delte /run/nologin file from parameterize.sh to permit ssh login on CentOS

May 30, 2018

  • Extended new_lab_setup.py to permit identification of the base image to use
  • Create new version of centos-log that includes centralized logging.
  • Assessment validation was not accepting "time_not_during" option.
  • Begin to integrate Labtainer Master for managing Labtainers from a Docker container.

May 25, 2018

  • Remove 10 second sleeps from various services. Was delaying xinetd responses, breaking automated tests.
  • Fix snort lab grading to only require "CONFIDENTIAL" in the alarm. Remove unused files from lab.
  • Program finish times were not recorded if the program was running when the lab was stopped.

May 21, 2018

  • Fix retlibc grading to remove duplicate goal, was failing automated assessment
  • Remove copies of mynotify.py from individual labs and lab template, it is has been part of lab_sys/sbin, but had not been updated to reflect fixes made for acl lab.

May 18, 2018

  • Mask signal message from exec_wrap so that segv error message looks right.
  • The capinout was sometimes losing stdout, check command stdout on death of cmd.
  • Fix grading of formatstring to catch segmentation fault message.
  • Add type_function feature to SimLab to type stdout of a script (see formatstring simlab).
  • Remove SimLab limitation on combining single/double quotes.
  • Add window_wait directive to SimLab to pause until window with given title can be found.
  • Modify plc lab to alter titles on physical world terminal to reflect status, this also makes testing easier.
  • Fix bufoverflow lab manual link.

May 15, 2018

  • Add appendix on use of the SimLab tool to simulate user performance of labs for regression testing and lab development.
  • Add wait_net function to SimLab to pause until selected network connections terminate.
  • Change acl automated assessment to use FILE_REGEX for multiline matching.
  • SimLab test for xsite lab.

May 11, 2018

  • Add "noskip" file to force collection of files otherwise found in home.tar, needed for retrieving Firefox places.sqlite.
  • Merge sqlite database with write ahead buffer before extracting.
  • Corrections to lab manual for the symkeylab
  • Grading additions for symkeylab and pubkey
  • Improvements to simlab tool: support include, fix window naming.

May 9, 2018

  • Fix parameterization of the file-deletion lab. Correct error its lab manual.
  • Replace use of shell=True in python scripts to reduce processes and allow tracking PIDs
  • Clean up manuals for backups, pass-crack and macs-hash.

May 8, 2018

  • Handle race condition to prevent gnome-terminal from executing its docker command before an xterm instruction terminal runs its command.
  • Don't display errors when instuctor stops a lab started with "-d".
  • Change grading of nmap-ssh to better reflect intent of the lab.
  • Several document and script fixes suggested by olberger on github.

May 7, 2018

  • Use C-based capinout program instead of the old capinout.sh to capture stdin and stdout. See trunk/src-tool/capinout. Removes limitations associated with use ctrl-C to break monitored programs and the display of passwords in telnet and ssh.
  • Include support for saki bulk_download zip processing to extract seperatly submitted reports, and summarizes missing submits.
  • Add checks to user-provided email to ensure they are printable characters.
  • While grading, if user-supplied email does not match zip file name, proceed to grade the results, but include note in the table reflecting cheating. Require to recover from cases where student enters garbage for an email address.
  • Change telnetlab grading to not look at tcpdump output for passwords -- capinout fix leads to correct character-at-a-time transmission to server.
  • Fix typo in install-docker.sh and use sudo to alter docker dns setting in that script.

April 26, 2018

  • Transition to use of "labtainer" to start lab, and "stoplab" to stop it.
  • Add --version option to labtainer command.
  • Add log_ts and log_range result types, and time_not_during goal operators. Revamp the centos-log and sys-log grading to use these features.
  • Put labsys.tar into /var/tmp instead of /tmp, sometimes would get deleted before expanded
  • Running X applications as root fails after reboot of VM.
  • Add "User Command" man pages to CentOS based labs
  • Fix recent bug that prevented collection of docs files from students
  • Modify smoke-tests to only compare student-specific result line, void of whitespace

April 20, 2018

  • The denyhosts service fails to start the first time, moved start to student_startup.sh.
  • Move all faux_init services until after parameterization -- rsyslog was failing to start on second boot of container. April 19, 2018
  • The acl lab failed to properly assess performance of the trojan horse step.
  • Collect student documents by default.
  • The denyhost lab changed to reflect that denyhosts (or tcp wrappers?) now modifies iptables. Also, the denyhosts service was failing to start on some occasions.
  • When updating Labtainers, do not overwrite files that are newer than those in the archive -- preserve student lab reports.

April 12, 2018

  • Add documentation for the purpose of lab goals, and display this for the instructor when the instructor starts a lab.
  • Correct use of the precheck function when the program is in treataslocal, pass capintout.sh the full program path.
  • Copy instr_config files at run time rather than during image build.
  • Add Designer Guide section on debugging automated assessment.
  • Incorrect case in lab report file names.
  • Unncessary chown function caused instructor.py to sometimes crash.
  • Support for automated testing of labs (see SimLab and smoketest).
  • Move testsets and distrib under trunk

April 5, 2018

  • Revise Firefox profile to remove "you've not use firefox in a while..." message.
  • Remove unnessary pulls from registry -- get image dates via docker hub API instead.

March 28, 2018

  • Use explicit tar instead of "docker cp" for system files (Docker does not follow links.)
  • Fix backups lab use separate file system and update the manual.

March 26, 2018

  • Support for multi-user modes (see Lab Designer User Guide).
  • Removed build dependency on the lab_bin and lab_sys files. Those are now copied during parameterization of the lab.
  • Move capinout.sh to /sbin so it can be found when running as root.

March 21, 2018

  • Add CLONE to permit multiple instances of the same container, e.g., for labs shared by multiple concurrent students.
  • Adapt kali-test lab to provide example of macvlan and CLONE
  • Copy the capinout.sh script to /sbin so root can find it after a sudo su.

March 15, 2018

  • Support macvlan networks for communications with external hosts
  • Add a Kali linux base, and a Metasploitable 2 image (see kali-test)

March 8, 2018

  • Do not require labname when using stop.py
  • Catch errors caused by stray networks and advise user on a fix
  • Add support for use of local apt & yum repos at NPS

February 21, 2018

  • Add dmz-lab
  • Change "checklocal" to "precheck", reflecting it runs prior to the command.
  • Decouple inotify event reporting from use of precheck.sh, allow inotify event lists to include optional outputfile name.
  • Extend bash hook to root operations, flush that bash_history.
  • Allow parameterization of start.config fields, e.g., for random IP addresses
  • Support monitoring of services started via systemctl or /etc/init.d
  • Introduce time delimeter qualifiers to organize a timestamped log file into ranges delimited by some configuration change of interest (see dmz-lab)

February 5, 2018

  • Boolean values from results.config files are now treated as goal values
  • Add regular expression support for identifying artifact results.
  • Support for alternate Docker registries, including a local test registry for testing
  • Msc fixes to labs and lab manuals
  • The capinout monitoring hook was not killing child processes on exit.
  • Kill monitored processes before collecting artifacts
  • Add labtainer.wireshark as a baseline container, clean up dockerfiles

January 30, 2018

  • Add snort lab
  • Integrate log file timestamps, e.g., from syslogs, into timestamped results.
  • Remove undefined result values from intermediate timestamped json result files.
  • Alter the time_during goal assessment operation to associate timestamps with the resulting goal value.

January 24, 2018

  • Use of tabbed windows caused instructor side to fail, use of double quotes.
  • Ignore files in _tar directories (other than .tar) when determining build dependencies.

labtainers's People

Contributors

banzo avatar danielliao22 avatar dependabot[bot] avatar harperaa avatar mfthomps avatar nathanmuccino avatar nkremerh avatar svenaelterman avatar uc-cjdavis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

labtainers's Issues

Typo in nmap-ssh.pdf lab document

you have been given an account, “analysis” on the client computer and on the router.

The account name is analyst. Its mentioned as analysis.

Question #13 in pass-crack lab is not applicable to most users

Hi,

I am using Labtainers in my computer security course. Question #13 of the pass-crack labtainers asks the following:

  1. Item #12 recorded the time it took to perform a dictionary attack on a file of MD5 digests. Referring back to a lecture on APR1, if this password file indicated that APR1 had been used instead of MD5, approximately how many seconds would it have taken? Show your work.

I am not sure what lecture this template is referring to but this is not applicable to most instructors who use their own lectures and syllabus. Would it be possible to remove that question?

Prevent large artifact files

Sometimes students can take actions with potential of creating vary large artifact files. One example is starting tcpdump from within a telnet session. The stdout capture functions will limit any stdout artifact to about 1MB.

new lab pulled from external docker repository fails to start

I downloaded the VirtualBox VM Appliance a couple of days ago from the NPS site. After importing, I ran the update-designer script. I successful created a new lab based on labtainer.base2 image. It launched successfully via the rebuild command. I then followed the instructions in section 10.5.2 of the LabDesigner manual to publish this lab, which appeared to be successful as it was pushed to my Docker Hub repository.

To test this new lab, I imported the VM Appliance to start with a clean student image. I ran the update-labtainer script to update the framework and then the imodule command to add my new lab. When I attempted to start the lab with the labtainers command, it would build the container, but the container would fail:

[2022-07-14 06:19:35,365 - ERROR : labutils.py:1413 - DoStartOne() ] failed docker exec find-the-secrets.find-the-secretStarted 1 containers, 1 completed initialization. Done.
[2022-07-14 06:19:35,539 - ERROR : labutils.py:2558 - DoStopOne() ] container find-the-secrets.find-the-secrets.student not running

Looking at the docker logs for the container, the failure was due to cgroups:

systemd 245.4-4ubuntu3.6 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
Detected virtualization docker.
Detected architecture x86-64.

Welcome to Ubuntu 20.04.2 LTS!

Set hostname to <find-the-secrets>.
Cannot determine cgroup we are running in: No medium found
Failed to allocate manager object: No medium found
[!!!!!!] Failed to allocate manager object.
Exiting PID 1...

As a result, I compared the docker create command invoked via the rebuild command in the designer environment and the docker create command invoked via the labtainer command in the student environment. The docker create command invoked via the labtainer command was missing the -v /sys/fs/cgroup:/sys/fs/cgroup:ro option.

The function that determines if this option should be added appears to be the isUbuntuSystemd function in the labutils.py script in that it detects ubuntu20. This function returns ubuntu20 in the context of the rebuild script because the image built in this manner doesn't have a "Config.Labels.Base" property, while the image built using publish.py adds this property. While the behavior is different, I don't think it is necessary problematic. However, the isUbuntuSystemd function fails to return ubuntu20 since the image passed to the docker history command contains the name of my Docker Hub repository and the name of the labtainers image: nnhsse/labtainer.base2

if '/' in base and '/' in image_name:
my_registry = image_name.split('/')[0]
no_reg = base.split('/')[1]
base = '%s/%s' % (my_registry, no_reg)
cmd = "docker history --no-trunc %s" % base
ps = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE,stderr=subprocess.PIPE)
output = ps.communicate()

I worked around this issue in my particular case by commenting out line 449 which results in the variable base being left as labtainers/labtainer.base2

I wasn't sure how best to resolve this issue; so, I didn't attempt a robust fix and pull request.

Could not run labedit

Hello,

I'm trying to run labedit but I can not get it.

  1. First, I run the command "labedit" and I got this message:
    student@ubuntu:~/labtainer/labtainer-student$ labedit
    Command 'labedit' not found, did you mean:
    command 'ldbedit' from deb ldb-tools
    command 'gabedit' from deb gabedit
    Try: sudo apt install

  2. Second, I followed the instruction, I used the command "./update-designer.sh" and reboot. But when run the command "labedit" again, I got a error as the following:
    Error: LinkageError occurred while loading main class labtainers.mainui.MainWindow
    java.lang.UnsupportedClassVersionError: labtainers/mainui/MainWindow has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up t o 55.0
    Could you pls help me out!

0
1
2

Students open artifact zip files prior to submitting them

Click-happy students sometimes use the GUI file manager to open artifacts in their xfer directory, and then somehow manage to submit content of the zip file to their instructor rather than the complete zip file.

We will change the file extension of artifact files from ".zip" to ".lab" and throw some bytes into a preamble to confuse the GUI file managers. This will not prevent instructors from unzipping the files via the command line, since zip is quite forgiving.

Labtainer tcpip Error?

Attempting the tcpip lab, but I get the following error:

student@ubuntu:~/labtainer/labtainer-student$ labtainer tcpip

[2020-09-22 14:52:29,283 - ERROR : labutils.py:1060 - imageInfo() ] Unable to reach DockerHub.
Is the network functional?

[2020-09-22 14:52:29,287 - ERROR : labutils.py:1792 - StartLab() ] Could not find image info for server

The other labs seem to work fine and my version of labtainer is up to date. Any recommendations?

install labtainer

I am new in Linux and i find some difficult in installing the labtainer
first how can i run any in labtainer
after making anew directory for new lab and named it ,then i must install new_lab_setup.py
i can't do this step
i need some help
thanks in advance

Student script labutils.py may encounter type conversion error during labtainer startup

The labutils.py script may encounter a type conversion error on line 1281 when trying to convert the value of the DISPLAY environment variable to an integer. It may first need to be converted to a float from a string then to an integer, else the following error message is produced:

ValueError: invalid literal for int() with base 10: '0.0'

Behavior tested on Arch and Ubuntu.

"Framework installation" tarball not found

https://my.nps.edu/documents/107523850/109121362/labtainer.tar/6fc80410-e87d-4e47-ae24-cbb60c7619fa currently fails :

wget https://my.nps.edu/documents/107523850/109121362/labtainer.tar/6fc80410-e87d-4e47-ae24-cbb60c7619fa
--2019-03-18 08:59:41--  https://my.nps.edu/documents/107523850/109121362/labtainer.tar/6fc80410-e87d-4e47-ae24-cbb60c7619fa
Résolution de my.nps.edu (my.nps.edu)… 205.155.65.19
Connexion à my.nps.edu (my.nps.edu)|205.155.65.19|:443… connecté.
requête HTTP transmise, en attente de la réponse… 404 Not Found
2019-03-18 08:59:43 erreur 404 : Not Found.

Controlling labtainers from inside a container

Running labtainers currently relies on running a set of Python scripts (mainly) which control the Docker containers through the docker command-line.

Should one want to avoid installing these Python scripts (and dependencies) on the host, an alternative is to use a VM containing a labtainers installation (such as the ones provided).

As an alternative, may it be possible to provide a "master" labtainers container containing these scripts, that would control the start/stop of these other containers.

In principle this should be faisable since docker can be controlled from within docker. An option is described at https://jpetazzo.github.io/2016/04/03/one-container-to-rule-them-all/ but there may be more recent/alternative options.

These would help running Labtainers from a non-Linux host without installing a big VM, but only something like boot2docker or other lightweight options.

Also I think this may help running Labtainers over a PaaS cloud like OpenShift.

What's you feeling on that feasibility ?

TCP/IP lab issues

The syn flood attack is not feasible in some environments. Consider revising lab manual to reflect this, and to simply highlight the observation of the backlog.
The "reverse shell" goal tests for a specific string. Either direct the student to cat such a file, or simply test for the server name in the shell prompt.

Suggestion for db-access lab

Now that I have assigned and graded the db-access lab, I have a suggestion that may help the students get more out of the lab.

In my world students may not have taken a database course as a prerequisite (and whatever I knew about sql db is gotten pretty rusty). This leads to two issues: (1) it is hard for students to get the big picture for the database and its tables and the role of db admin, plus (2) students do a lot of trial and error before they are successful in issuing sql commands to grant, revoke and verify user permissions.

My suggestion to help with issue #1 is to include mysql-workbench on the db-admin system and start it as part of the lab. This will give the students the full perspective on the database, the tables and the users. Students can still use command line interface before and after the admin changes are made to verify their privileges.

Default Number of Virtual CPUs

Is there a particular reason why the Labtainer virtual machine images seem to allocate two virtual CPUs by default? I've read and have been told from others who work in the area of virtualization that in most cases allocating more than one virtual CPU to a virtual machine instance can cause significant performance degradation due to the somewhat counter-intuitive way that resource sharing is handled between the host and the virtualized guest OS.

Add more support for Arch based distros

No installation script is available for Arch based distributions using pacman as their package manager. Running labtainers in an Arch distro may require additional care due to the assumed degree of additional, manual configuration for the user.

Installation on a Debian VM spits message mentioning EONG

The install-labtainer.sh script spits:

bash: line 2: warning: here-document at line 1 delimited by end-of-file (wanted `EONG')

I guess the problem lies in:

if [[ "$RESULT" -eq 0 ]]; then
    /usr/bin/newgrp docker <<EONG
    /usr/bin/newgrp $USER <<EONG
    source ./pull-all.sh
EONG
    ./dns-add.py
    ./getinfo.py
    sudo reboot
else
    echo "There was a problem with the installation."
fi

That looks strange to me: two EONG starts and only one end ?... a Typo ?

Hth

Few findings in webtrack.pdf

  1. The below document is empty. It's not showing any report template
    The lab report template is at:
    file:///root/Desktop/labtainer/trunk/labs/webtrack/docs/webtrack-report.docx
    -rw-r--r-- 1 1000 docker 4 Aug 1 2019 webtrack-report.docx

  2. webtrack.pdf
    section 2.3 - welect Open a New Private Window. There is a typo. It should be select instead of welect.

  3. Snapshot is not added to the PDF. Everywhere it's blank.
    image

  4. After closing the browser, how to re-open the browser again? Steps are not there in the pdf. I could not able to perform the lab exercise if I open the normal Firefox browser. The browser which is opening automatically is created specifically to perform this lab exercise?

onewayhash lab issue

Problem:
In the onewayhash lab PDF, task 2 asks the user to "generate a keyed hash using HMAC-MD5, HMAC-SHA256, and HMAC-SHA1 for any file that you choose". The checkwork command only verifies that the work was completed when these commands are issued against filetodigest.txt specifically.

The issue seems to be around:
labs/onewayhash/instr_config/goals.config:

# GROUP: Three prescribed algorithms for HMAC operations
hmac_md5_done = matchany : string_equal : hmacmd5filedigest : answer=filetodigest.txt
hmac_sha1_done = matchany : string_equal : hmacsha1filedigest : answer=filetodigest.txt
hmac_sha256_done = matchany : string_equal : hmacsha256filedigest : answer=filetodigest.txt

labs/onewayhash/instr_config/results.config:

hmacmd5filedigest = openssl.stdout : PARENS : 1 : STARTSWITH : HMAC-MD5
hmacsha1filedigest = openssl.stdout : PARENS : 1 : STARTSWITH : HMAC-SHA1
hmacsha256filedigest = openssl.stdout : PARENS : 1 : STARTSWITH : HMAC-SHA256

Desired Fix:
Either the PDF could be updated to specify these commands should be executed against filetodigest.txt, or the .config files could be updated to detect them being executed against any file.

GUI windows black or garbled

Some GUI pulldown windows, e.g., Wireshark and IDA Pro, appear black or garbled. Sometimes resizing windows or restarting the application will temporarily solve the problem -- or move it to other pulldowns. This appears to be a problem related to QT applications. Solutions to similar issues found on the web include setting various environment variables. These seem to have no affect.

Support Vagrant as an alternative to classical VM

It may be interesting to provide a Vagrant image / build script so as to allow automation of the VM provisioning and support mixed environment where files are automatically shared between host and VM.

Also Vagrant has nice features like checking that the downloaded VM is correct (checksums).

Bug when starting a lab with X11

When i'm starting a lab with X11 (i'm on an WSL2 ubuntu system) I have this error :

Exception in thread gdblesson: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/ilyes/labtainers/labtainer/trunk/scripts/labtainer-student/bin/labutils.py", line 1282, in DoStartOne display_num = int(float(display)) ValueError: could not convert string to float: '72.30.192.1:0.0'

In labutils.py line 1282, there is
display_num = int(float(display[1:]))
I'm not sure but display_num should be '0.0'
I had to modify it by hand

CyberCIEGE mouse fails on VirtualBox on Mac Catalina

The mouse is slow/unusable when running the CyberCIEGE lab on VirtualBox installed on OSX Catalina.
Reducing the scaling factor to 1 at least lets you move the mouse, but it is jerky and of course the game window is a postage stamp. The problem does not occur on VMWare on the same platform. And it does not occur with VirtualBox on other types of host computers.

If you have the choice, use VMWare over VirtualBox when on a Mac. VirtualBox has mouse integration problems when on a Mac.

Docker Desktop does not support GUI applications

The Docker Desktop for Mac (and perhaps Windows), will not run exercises that use a GUI such as Wireshark. This is due to a lack of support for Unix sockets on mounted volumes. While the master container can access the socket created by the noVNC container, the socket does not appear on volumes within containers created by the master. Any work-around seems to add a network connection to each container needing a GUI.
This is not a problem with headless Labtainers when running on Linux hosts.

Running Labtainers over Windows (10)

This issue merely a reference point regarding private discussions, for future reference.

There seem to be some interest for people wishing to run labtainers over Windows 10.

As an alternative to the standard documented install inside a VirtualBox VM, which works on Windows, an alternative may be to run Labtainers from within a container, once Docker for Windows is installed. See #1 for details.

In addition, XMing, or another X window display server for Windows will be needed.

The resulting script looks like this in Windows PowerShell:

 & 'C:\Program Files (x86)\Xming\Xming.exe' :0 -ac -clipboard -multiwindow 

-ac means : without access control

$DISPLAY = ( `
      Get-NetIPConfiguration | `
      Where-Object { `
          $_.IPv4DefaultGateway -ne $null `
          -and `
          $_.NetAdapter.Status -ne "Disconnected" `
      } `
  ).IPv4Address.IPAddress + ":0"

docker run --rm -i -t --name docker0 -v /var/run/docker.sock:/var/run/docker.sock -e DISPLAY=$DISPLAY olberger/labtainer.master:latest /bin/bash

This uses the pre-built olberger/labtainer.master container image (available on dockerhub) which contains an installation of Labtainers made with the Dockefile referenced in #1 (comment)

Surprisingly this works almost as on Linux...

Beware to security issues with such a privileged container being able to mess with other containers.

Add an explicit mention of terms of distribution/use in the README

AFAIU, the code of Labtainers (and some docs) are under public domain, but some labs are under the GFDL.

It would be clearer for users / adopters / contributors to find description of such conditions upfront, in the README (or a LICENSE file, but which is a bit inapropriate maybe for public domain works ;)

pass-crack lab - checkwork

The 'checkwork' command for the pass-crack lab does not seem to count invocations of crackPre.py against the specific files htaccess-sha1 or htaccess-me, but does count the total invocations of crackPre.py against any target.

eg.


Student              |           chage |        crackSHA |        crackMD5 |        crack512 |        crackPre |   crackPre_sha1 |     crackPre_me |        htpasswd |
==================== | =============== | =============== | =============== | =============== | =============== | =============== | =============== | =============== |
xxxxxxxxxxxxxxxxxxxx |               1 |               2 |               2 |               1 |               3 |               0 |               0 |               6 |
What is automatically assessed for this lab:

	Counts of program invocations

maintains 0's in the crackPre_sha1 and crackPre_me columns regardless of executing ./crackPre.py htpasswd-me calc or ./crackPre.py htpasswd-sha1 calc as instructed.

Labtainer on WSL2

Do you plan make available the way to install Labtainer on Windows Subsystem Linux it would be great.

Explicitely list included software and licenses for labs

I think it would be better to include explicit mentions of included copyrighted materials in the labs, in particular for embedded software (distributed in the .tars that will be deployed to the containers), with mentions of the software licenses.

For instance, I noticed that the webtrack lab includes copies of revive and elgg which are GNU GPL v2, and as the GPL is pretty demanding in terms of making the license terms known to the users, I guess there should be some mentions even for students to eventually notice while performing the labs (footnotes for instance). Maybe the webtrack.pdf should be the first place this is explicitely mentioned, but I guess it wouldn't harm to have some kind of catalogue somewhere at the top of the labtainers distribution.

Hope this helps.

Distinguish Labtainers terminals from others.

It would be nice if students could easily distinguish Labtainers terminals from others, e.g., the one used to launch Labtainers.
Unfortunately, the window manager used by Ubuntu makes it quite difficult to import terminal profiles in an automated manner. We can do this in the VM appliance itself, but that would only help new users. We can also put together a "how to" tutorial on creating a profile called "labtainers" and then have Labtainers use that if present.
Thanks to Jim Whitmore for this feature request.

Wrong default permissions of /shared_data/accounting.txt in acl labtainer

On page 2 of the acl lab description, the guide claims that accounting.txt must have the following permissions:

-rw-rw----+

The file however seems to have the following permissions by default:
-rw-rw-r--+

Which kind of invalidates the reason why Bob would want Alice to run his trojan program.

ldap lab authentication intermittently fails on ubuntu 20

The nscd service on Ubuntu 20 does not seem to properly cache password info, which causes ldap to fail when authenticating a user whose initial password should be expired. The failure is intermittent, and once it succeeds it seems to continue to succeed. Rather than further debugging nscd, we can simply disable password cache in the nscd.conf file.

Is the autograder for the "gdblesson" lab working?

Hi,

I was just working through the lab called "gdblesson" and I am not sure that the autograder works as it should. I finished all the tasks described in that lab yet the autograder (which I guess is the same whether the student runs "checkwork" or the instructor runs "gradelab") only credited me for half of them.

I was credited with having done the following correctly:
gdb_run_task, gdb_list_task, gdb_print_task, gdb_step_task

and none of the remaining ones. This is particularly surprising given that I could not have used gdb without successfully using gcc first, yet I am not credited with the gcc_task_one task.

Would you mind verifying that the autograder works?

VirtualBox has depricated 3D acceleration using the VBoxVGA graphics controller

Starting with VirtualBox 6.1.0, 3D acceleration using the VBoxVGA graphics controller will be deprecated. This could be problem since the currently offered Labtainer OVA image for VirtualBox comes pre-configured for 3D acceleration using the VBoxVGA graphics controller enabled by default. Full error/warning message below:

Console: VM runtime error: fatal=false, errorID=3DCrDeprecated message="This VM is configured to use 3D acceleration using the VBoxVGA graphics controller. Support for this will be removed with version 6.1.0. ALL saved states and snapshots will cease to work when using this configuration. Either switch to the VMSVGA graphics controller and update guest additions, or disable 3D acceleration"

catch missing X11 socket

Detect cases where the /tmp/.X11 socket is missing and provide a useful diagnostic message to reboot the VM. Otherwise labs fail with little help to the user.

Iptables2 checkwork The wizbang port is not open.

The checkwork script as some erroneous behavior.
As the port is random and for some ports the nmap resolves it to a service name instead of unknown that is the expected on results regex.
Is there a way to specify the check to the expression to matches the WIZ_PORT open instead ?

Cryptographic hash for VM image downloads

Having a cryptographic hash (MD5 Sum, SHA256 Sum, or other) displayed next to the download link for each VM image would help in verifying that the downloaded image/file hasn't been corrupted and help to identify when a newer image has been uploaded in place of an older one.

Problem on ACL

hi, in the alice_default task
after following the manual step by step but there still isn't a mark when I checkwork
I did : 1. setfacl -d -m user:bob;r-- /alice for put bob into the default setting
2. check bob can read new file after 1
3. setfacl -b /alice for revise
Is there anything wrong?

Also, on task 3, request modify script, but I don't knwo the ascii art either and prof didn't even mention it in the lecture, is that mean I have to learn something about it in a ACL task?

regrads

Make installation of all Docker images on the host/VM optional

The installation scripts install by default all docker images.

While this may be better for a single VM made available to all students at once for deployment constraints (or offline use), this makes the installation unnecessary big for contexts where only one lab will be executed.

I'd prefer that the default behaviour of the installer is to only download the base image, and make it an option to install everything, for instance for the provisioning of the reference VM.

Checkwork/Gradelab/Redo bug

Hi,

There's a bug on "labtainer --redo", "checkwork" and "gradelab".

  • Bug:

    1. While a user using the labtainer --redo to redo the lab, the old results did not get cleared and may affect new results (see 2).

    2. If one deleted the zip file in labtainer_xfer, using checkwork will continue to show the previous results and save previous results into labtainer_xfer.

  • Reason:

    This is because the zip file is also stored into /var/lib/docker/overlay2/<id>/merged/home/instructor/, where is inaccessible by "student" account (need superuser access). Those files are not deleted even using labtainer --redo option, and will still be gradable by checkwork and gradelab.

  • Solution:

    1. find those zip files using the find command (replace the onewayhash to your lab name):
      $ sudo find /* | grep .onewayhash.zip
    2. it will get something like this:
      /var/lib/docker/overlay2/cd5f35bb65cf3161d60b5eba7c12753484f7c38f689ebd71c6173d1027d3e10d/merged/home/instructor/(e-mail).onewayhash.zip
      or
      /var/lib/docker/overlay2/cd5f35bb65cf3161d60b5eba7c12753484f7c38f689ebd71c6173d1027d3e10d/diff/home/instructor/(e-mail).onewayhash.zip
      or both.
    3. delete those files
      $sudo rm <filepath.zip>
    4. run checkwork , if everything is good, checkwork will show no results; now you can start a clean lab work.
      --if checkwork still shows previous lab result, you can do 1-4 again (I forget to delete one of it once and its coming back.)

However its only a temp solution, hope this can be resolved.

'labtainer-instructor' Guide

If I fix a typo in the Latex file ('stopgrader' changed to 'stopgrade') will it somehow automatically propagate to fix the PDF file linked to on the official Labtainers webpage? Thanks and cheers!

Support running labtainers labs in headless docker env (using Guacamole ?)

In cloud contexts or when running Labtainers on a docker host without X display (Windows ?, remote cloud Linux host ?), there may be no X display to open the lab containers' GUIs : gnome-terminal, xterm, firefox, etc.

I think it could be interesting to integrate Guacamole or any similar software to allow running an X display "in memory" (XVnc for instance, which is standard I think) and offer access to the X sessions through a Web page, created by Guacamole, which would display a "desktop" view of the labs GUIs in an HTML5 canvas.

This may be of use for non-Linux hosts maybe (should labtainers be installable without a base Linux docker host, which is another issue ;), which wouldn't support native X displays where labtainers scripts will be run

Couldn't grade wireshark-intro test

I've just tested the wireshark-intro and tried to grade my own test... but got :

student@Labtainer-VM:~/labtainer/labtainer-instructor$ gradelab wireshark-intro
pulling labtainer.grader from mfthomps
Done with pull
[2019-06-04 00:55:56,785 - ERROR : gradelab:207 - autoGrade() ] trouble with docker exec wireshark-intro-igrader bash -c 'su - instructor -c "cd;.local/bin/instructor.py"'
Labname wireshark-intro

Student              | wiresharkextrac |
==================== | =============== |
olivier.berger_at_te |                 |
What is automatically assessed for this lab:

	wiresharkextractOK: used wireshark to extract the desired packets

Dunno what's wrong exactly

gradelab -r option as default

Modify the gradelab command so that the default is to create a new container, populated with the current content of the lab xfer directory. Add a new switch to allow re-use of the grader container, with the xfer files being added to whatever was already within the gradelab container.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.