diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..83a6d0d --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,10 @@ +jobs: + build: + machine: true + steps: + - checkout + # build + - run: make all + + # cleanup + - run: make clean \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c52ff54 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Yosuke Sano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d90bceb --- /dev/null +++ b/Makefile @@ -0,0 +1,52 @@ +OUT_ZIP=Parrot.zip +LNCR_EXE=Parrot.exe + +DLR=curl +DLR_FLAGS=-L +LNCR_URL=https://github.com/yuk7/wsldl/releases/download/20100500/Launcher.exe + +all: $(OUT_ZIP) + +zip: $(OUT_ZIP) +$(OUT_ZIP): ziproot + @echo -e '\e[1;31mBuilding $(OUT_ZIP)\e[m' + cd ziproot; zip ../$(OUT_ZIP) * + +ziproot: Launcher.exe rootfs.tar.gz + @echo -e '\e[1;31mBuilding ziproot...\e[m' + mkdir ziproot + cp Launcher.exe ziproot/${LNCR_EXE} + cp rootfs.tar.gz ziproot/ + +exe: Launcher.exe +Launcher.exe: + @echo -e '\e[1;31mExtracting Launcher.exe...\e[m' + $(DLR) $(DLR_FLAGS) $(LNCR_URL) -o Launcher.exe + +rootfs.tar.gz: rootfs + @echo -e '\e[1;31mBuilding rootfs.tar.gz...\e[m' + cd rootfs; sudo tar -zcpf ../rootfs.tar.gz `sudo ls` + sudo chown `id -un` rootfs.tar.gz + +rootfs: base.tar + @echo -e '\e[1;31mBuilding rootfs...\e[m' + mkdir rootfs + sudo tar -xpf base.tar -C rootfs --exclude=dev + echo "# This file was automatically generated by WSL. To stop automatic generation of this file, remove this line." | sudo tee rootfs/etc/resolv.conf + sudo chmod +x rootfs + +base.tar: + @echo -e '\e[1;31mExporting base.tar using docker...\e[m' + docker run --name parrotwsl parrotsec/core:latest /bin/bash -c "pwconv; grpconv; chmod 0744 /etc/shadow; chmod 0744 /etc/gshadow;" + docker export --output=base.tar parrotwsl + docker rm -f parrotwsl + +clean: + @echo -e '\e[1;31mCleaning files...\e[m' + -rm ${OUT_ZIP} + -rm -r ziproot + -rm Launcher.exe + -rm rootfs.tar.gz + -sudo rm -r rootfs + -rm base.tar + -docker rmi parrotsec/core:latest diff --git a/README.md b/README.md new file mode 100644 index 0000000..6aeddbc --- /dev/null +++ b/README.md @@ -0,0 +1,68 @@ +# ParrotWSL +Parrot Security OS on WSL (Windows 10 FCU or later) +based on [wsldl](https://github.com/yuk7/wsldl) + +![screenshot](https://raw.githubusercontent.com/yosukes-dev/ParrotWSL/master/img/screenshot.png) + +[![CircleCI](https://circleci.com/gh/yosukes-dev/ParrotWSL.svg?style=svg)](https://circleci.com/gh/yosukes-dev/ParrotWSL) +[![Github All Releases](https://img.shields.io/github/downloads/yosukes-dev/ParrotWSL/total.svg?style=flat-square)](https://github.com/yosukes-dev/ParrotWSL/releases) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) +![License](https://img.shields.io/github/license/yosukes-dev/ParrotWSL.svg?style=flat-square) + +### [Download](https://github.com/yosukes-dev/ParrotWSL/releases) + + +## Requirements +* Windows 10 Fall Creators Update x64 or later. (Testing with build 19631) +* Windows Subsystem for Linux feature is enabled. + +## Install +#### 1. [Download](https://github.com/yosukes-dev/ParrotWSL/releases) installer zip + +#### 2. Extract all files in zip file to same directory + +#### 3.Run Parrot.exe to Extract rootfs and Register to WSL +Exe filename is using to the instance name to register. +If you rename it you can register with a diffrent name and have multiple installs. + +## How-to-Use(for Installed Instance) +#### exe Usage +```dos +Usage : + + - Open a new shell with your default settings. + + run + - Run the given command line in that distro. Inherit current directory. + + runp + - Run the path translated command line in that distro. + + config [setting [value]] + - `--default-user `: Set the default user for this distro to + - `--default-uid `: Set the default user uid for this distro to + - `--append-path `: Switch of Append Windows PATH to $PATH + - `--mount-drive `: Switch of Mount drives + + get [setting] + - `--default-uid`: Get the default user uid in this distro + - `--append-path`: Get on/off status of Append Windows PATH to $PATH + - `--mount-drive`: Get on/off status of Mount drives + - `--lxguid`: Get WSL GUID key for this distro + + backup [contents] + - `--tgz`: Output backup.tar.gz to the current directory using tar command + - `--reg`: Output settings registry file to the current directory + + clean + - Uninstall the distro. + + help + - Print this usage message. +``` + +#### How to uninstall instance +```dos +>Parrot.exe clean + +``` diff --git a/img/screenshot.png b/img/screenshot.png new file mode 100644 index 0000000..ed479e3 Binary files /dev/null and b/img/screenshot.png differ