Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Goad4windows #194

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

svetterIO
Copy link

Porting of goad.sh and check.sh to PowerShell variants incl. following new features:

  • Task: purge (destroy VM without confirmation Y/N for each machine)
  • added vagrant tasks: reload, snapshot, resume, suspend, validate
  • optional Kali VM via -k $True/$False/O (only operate on Kali)
  • Enable GUI on Provider via -g $True/$False or 1/0
  • Typo fixed for GOAD-Light VM names.

Info: Due to porting for windows EOL conversion for bash scripts was required and it is recommended to do this at the repository level rather than in everybody's global Git configuration.

Warning:
Successful provisioning tested only for VMware on Windows 10. VirtualBox: hanging or unreachable VMs. Proxmox: not tested. Providers are kept for testing purposed only.

Issue on ansible execution from Windows based checked out git>
"/bin/bash: ../scripts/provisionning.sh: /bin/bash^M: bad interpreter: No such file or directory"

Recommended configuration for cross-platform compatibility> .gitattributes
Porting of goad.sh and check.sh to PowerShell variants incl. following new features:
- Task: purge (destroy VM without confirmation)
- vagrant tasks: reload, snapshot, resume, suspend, validate
- optional Kali VM via -k $True/$False/O (only operate on Kali)
- Enable GUI on Provider: $True/$False or 1/0

Warning:
Successful provisioning tested only for VMware. VirtualBox: hanging or unreachable VMs. Proxmox: not tested. Providers are kept for testing purposed only.
- Isolate GOAD VMs by disabling nat_adapter from all machines
Attention: Isolation only disables vagrant NAT interface. You have to manually disconnect the host from GOAD network. E.g. vmware: Virtual Network Editor>VMNetX (192.168.56.0)>Uncheck 'Connect a host virtual network adapter to this network

- revert isolation
- added documentation on PowerShell execution on GOAD
@Mayfly277
Copy link
Collaborator

thanks a lot, very nice work, but i will need some time to test this ^^

@NeffIsBack
Copy link

Really cool! My plan was to set up the Lab on my new Win machine the next days. As I always used virtualbox so far I would like to use that there as well. Any idea why the machines are hanging? I think experienced that as well in the past, but couldn't resolve it. Did you already dig into it? Maybe I can get it to work.

@NeffIsBack
Copy link

So in order to get a fresh version of the Lab onto my Host i switched to vmware.

My feedback:
First i tried with podman, apparently there are several bugs and i didn't manage to get that stuff working. podman-cli 5.0.0 is somehow incompatible to the desktop version for now and downgrading also didn't work (after removing some files manually that didn't get cleaned up i still ran into errors).
After switching to docker i had some problems with my network. I couldn't connect to the lab, although the vagrant configuration looked all fine. Apparently the issue was, that my windows network adapter was still configured to use dhcp, so after assigning an ip with subnet (and solving some port conflicts, seems like a vagrant issue) it worked.
Also a nice addition would be to add all the options from the sh script.
Having the kali option is also really nice! Thanks for that. Although it looks like it configures the vmnet2 adapter 2x times?
image

TLDR;

  • I would recommend using docker instead of podman as it seems more stable to me
  • The issue with the own windows adapter needs to be tested and perhaps fixed with some powershell workaround

@NeffIsBack
Copy link

NeffIsBack commented Mar 30, 2024

Weird, tried building it on my laptop. There the vmnet2 adapter had an ip address of 192.168.156.1. After changing that to 192.168.56.2 it worked flawlessly as well.

EDIT: Same for the SCCM lab (merged in the main branch and configured the ps script so it would work with SCCM). You have to manually set an IP address in windows first

@NeffIsBack
Copy link

Another bug while provisioning the SCCM lab:
The ANISBLE_COMMAND here: https://github.com/svetterIO/GOAD/blob/fc5e7e6bc3d7173bcfda10ecca9bc03771894c7c/goad.ps1#L112
was somehow broken, threw an error and didn't play one of the ansible playbooks. I solved it by replacing "ANSIBLE_COMMAND='ansible-playbook -i ../ad/$LAB/data/inventory -i ../ad/$LAB/providers/$PROVIDER/inventory' with LAB=$lab PROVIDER=$provider which would therefore be picked up by the provisioning script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants