Showing posts with label Tech Stuff. Show all posts
Showing posts with label Tech Stuff. Show all posts

Open BSD Vitrualbox Screen Resolution Workaround

How to Adjust Screen Resolution on Open BSD in Virtualbox 


Introduction

One of the first thing that you will want to do after installing Open BSD on Virtualbox is to adjust the screen resolution. But if you go to the view menu you see that the resize options are disabled. Well there is good news and bad news...I'll start with the bad news: Virtualbox guest additions does not support Open BSD but the good news is with some custom scripts and hacking we can simply resize the screen resolutions to what we want. I have created two scripts to solve the issue.


This is the first script that is that we are going to execute on the host machine.



#!/bin/sh

if [ -z "$1" ] || [ -z "$2" ]; then
	echo "Pass VBox machine name and screen resolution"
	echo "Example: 'OpenBSD New' '1920x1080x32'"
	exit 1
fi

VBoxManage setextradata "$1" CustomVideoMode1 "$2"

result=`VBoxManage getextradata "$1" CustomVideoMode1`

case "$result" in
*$2*) VBoxManage getextradata "$1" CustomVideoMode1 && echo success;;
*       ) echo failure ;;
esac


This is the second script that we are going to run it inside of the Open BSD.



#!/bin/sh


if [ "$(id -u)" -ne 0 ]; then
    echo "This script must be run as root"
    exit 1
fi

mkdir -p /etc/X11/xorg.conf.d

cat << EOF > /etc/X11/xorg.conf.d/00-virtualbox-monitor.conf
Section "Device"
  Identifier   "VirtualBox-Card"
  Driver       "vesa"
  VendorName   "InnoTek"
  BoardName    "VirtualBox Graphics Adapter"
EndSection
Section "Monitor"
  Identifier   "VirtualBox-Monitor"
  VendorName   "InnoTek"
  ModelName    "VirtualBox Screen"
  HorizSync    1.0 - 1000.0
  VertRefresh  1.0 - 1000.0
EndSection
Section "Screen"
  Identifier   "VirtualBox-Screen"
  Device       "VirtualBox-Card"
  Monitor      "VirtualBox-Monitor"
  DefaultDepth 24
  SubSection "Display"
    Viewport   0 0
    Depth      24
    #Modes "1368x768" "1360x768" "1280x800" "1024x768"
    Modes  "$1"
  EndSubSection
EndSection
EOF

echo "Success - reboot your system"


So all you have to do is save the shell scripts to each machine (customize first if needed) and then execute the scripts. I will go over the rest of this process now.

On The Host machine

I power off my virtual machine and bring up my terminal so on the host. I will chmod +x the script and if you execute the script without passing any parameter it tells you that you need to specify two parameters.... the first one is the name of the virtual machine that you want to set the screen resolution for, and the second option is the desirable screen resolution to set the screen resolution on the machine. We need to pass the s switch and then type the name of the virtual machine here in my case my VM is named Puffdaddy. Make sure to wrap the name and the screen resolution in single quotation then as the screen resolution you can pass anything. My screen is full HD so I specify full HD 32-bit color. We are done with the host machine... now we have to start the Open BSD VM and run the second script.

Inside The OpenBSD VM

Switch to the root user then make sure that the script is executable with chmod +x (after customizing script to meet your requirements). Specify the desirable resolution in my case again full HD and then you shoould a success message. What the script does is it creates a file under x11 directory xorg and then this is the file we show a box monitor conf and then it sets the resolution that has been specified by you in the script. Now restart your machine and check whether everything works as expected.


Final Notes

After restarting the OpenBSD virtual machine you will now have a much larger workspace. Hopefully this enriches your Open BSD expirience and has helped you solve the issue with Virtual Box VM resolution & Open BSD.

How To Install Commando VM On Windows 10

Overview

In this post we are going over the procedure to deploy Commando VM. Commando VM is a Windows pen-testing virtual machine which is designed for helping you achieve your red team / pen testing objectives. Commando VM is Windows environment with many useful tools and settings to help make your pen testing job much easier. It is especially useful when it comes to exploit development research, exploits, threat intelligence, or any kind of windows exploitation. it has variety of tools and if anything is missing it can pretty much be installed and most of those has with all support especially if they are built on python.

System Requirements

All right first things first let's go and look at the prerequisites so this is the official github page of commando hosted by Mandiant. Next what you're gonna need is to download the standard windows 10 iso from microsoft. I do recommend that you use an official copy of Windows 10 as we will need to disable windows defender and other security mechanisms for the installation to succeed. It is  recommended to use the 22H2 release of the Windows 10 ISO. Then you're going to need at least 4 gigs of ram and 60 gigs of a hard drive space. This minimal setup is good to test the setup and get used to how it all works, however 100 gigs hard drive space & 8 gigs ram is much better option if you are doing a Full intsall of all the features available. I suggest creating a VM just for the purpose of "trial run" take note of aspects of installation then test it all out. Later you can make clean VM with improvements and edits to the trial run.

Installing Standard Windows 10 VM


Inside my vmware workstation I create a new windows virtual machine all you'll need is go to file your virtual machine then go to typical next load your iso which downloaded from microsoft. Documentation from microsoft visual page story what it there now that's going then name it the proper name so windows 10 commando. Now both we're pretty much the commando is gonna be stored so i'm gonna do vms commando. Just click ok command all right click next now we need to pretty much say how much the disk we want at my case it's 60 gigs click next customize hardware now as as I mentioned go with at least 4 gigs of ram i'm going to put 8 because i have a lot and then to process it's okay processor is ok. Then network adapter not this should be ok now close finish and this should be enough now let's just wait a little bit because it's gonna work still a standard windows installation. I'm going to click to vm and install vm tools when you click that you should be mounting an iso on D:\  drive and then click the run  setup 64. Vmware tools is pretty much all the vm support that you need for example the screen resize the double mouse button and all the extras that you need for your vms to run smooth so it's always a good idea to have them go with complete next install and you should be pretty fast. 

AV Removal and VM Setup


If you paid attention we can see pre-installed procedures so there's the thing we must do before installing commando you must disable windows defender for smooth install keep in mind that commando is offensive vm so it is going to install a lot of things most of them which are triggered by the defender so it must be disabled. The best way to accomplish this with policy in windows versions of higher than 1909 template protection was hired and protection was disabled so device group of settings have ignored. Go to in windows security type windows security search box and it's going to bring up the defender. Now here we're going to need to various thread protection go to manage setting and pretty much disable all these things here is the damper protection all right then to permanently disable real-time protection let's open up gp edit which is the group policy editor and maybe we're going to need an administrator right so cmd right click administrator gpedit. There we are now what we need to do here computer configuration computer configuration administrative templates windows component microsoft defender where is it microsoft defined antivirus and real-time protection. All right now enable turn off real-time protection turn off your time protection enable it apply and it should be disabled. Next we're  gonna need to reboot and we need to build before making the next change. Then we're gonna need to disable permanently disable microsoft defender and then we're gonna need to install the commando.  This is done because every single time you restart the box or windows machine the defender is automatically turning itself to on no matter what. If you don't permanently disable defender he's gonna find a way to pretty much turn itself back on that's why we're gonna need a lot of starts because each procedure is turning this table is disabling the defender off and by the last one which is gonna be performed. Right now we should have not non-defender box then we're gonna smoothly start commando and be happy to be a red team ninja.

Installing Commando VM


We're gonna need run cmd as administrator and now do gp edit all right and here we're gonna need to do again computer configuration administrative templates, windows components, microsoft defender antivirus pretty much the same path all right and then enable turn off microsoft defender antivirus. Next we're gonna go with the standard install. all right so where was it here when we download that there is the file called install.ps1 and pretty much it take cares of all the installation process so we're going to follow the steps we're going to run that script. Take a snapshot of the machine!!! This is really important because if something breaks up you must have the ability to revert back to the box. We download that script  open powershell as administrator yes administrator cd users test desktop commando we have that install.ps1. Unblock file ps1 set execution policy unrestricted so we can pretty much execute scripts for the install. We can either run it like that or we can supply a password i've never supplied a password because i would need i would not need that but if you want you can try it out. The last step is to pretty much even install that ps1 script. You need to to change this setting so checking to make sure we don't defender tamper protection is disabled. It is disabled so do you need to change the settings i didn't know all right do you need to take snapshot. I already took that type your password a bit carefully this style is not 100 unattended please monitor this stuff with possible failures. After the final reboot you should be seeing something like that whenever you see the command vmware logo your machine is good to go. If there's anything left over you just have to click enter and reboot the box once again. It is a really easy straightforward install all you need is just wanna install script using powershell with administrative fights and that's it keep in mind that it takes a lot of time and it restarts a lot of thing a lot of times so you have to be patient but you end up having a Commando VM!