nsmfoo / antivmdetection

Script to create templates to use with VirtualBox to make vm detection harder
MIT License
703 stars 123 forks source link

Script [[: not found on line 40 Linux #59

Closed PhantomCloak closed 3 years ago

PhantomCloak commented 3 years ago

I'm currently trying to run the sh file that created from antivmdetect.py and I got these errors

Host OS: Ubuntu 20.04.1 LTS Guess OS: Not installed yet

./HPLaptop.sh: 40: [[: not found ./HPLaptop.sh: 78: [: unexpected operator ./HPLaptop.sh: 80: [: none: unexpected operator ./HPLaptop.sh: 82: [: pulse: unexpected operator

From the beginning of line 40 to 52

if [[ -z "$controller" ]]; then
VBoxManage setextradata "$1" VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/SerialNumber  'F07EA405C1FD49289740'
VBoxManage setextradata "$1" VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/FirmwareRevision  ' HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
 HDIO_GET_IDENTITY failed: Inappropriate ioctl for device'
VBoxManage setextradata "$1" VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/ModelNumber   ' HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
 HDIO_GET_IDENTITY failed: Inappropriate ioctl for device'
else
VBoxManage setextradata "$1" VBoxInternal/Devices/ahci/0/Config/Port0/SerialNumber  'F07EA405C1FD49289740'
VBoxManage setextradata "$1" VBoxInternal/Devices/ahci/0/Config/Port0/FirmwareRevision  ' HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
 HDIO_GET_IDENTITY failed: Inappropriate ioctl for device'
VBoxManage setextradata "$1" VBoxInternal/Devices/ahci/0/Config/Port0/ModelNumber   ' HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
 HDIO_GET_IDENTITY failed: Inappropriate ioctl for device'
fi

From the beginning of line 78 to 85

if [ "$hostint_ip" == '192.168.56.1' ]; then echo "[WARNING] You are using the default IP/IP-range. Consider changing the IP and the range used!"; fi   
virtualization_type=$(VBoxManage showvminfo --machinereadable "$1" | grep -i ^paravirtprovider | cut -d "=" -f2 | sed 's/"//g') 
if [ ! $virtualization_type == 'none' ]; then echo "[WARNING] Please switch paravirtualization interface to: None!"; fi 
audio=$(VBoxManage showvminfo --machinereadable "$1" | grep audio | cut -d "=" -f2 | sed 's/"//g' | head -1)    
if [ $audio == 'none' ]; then echo "[WARNING] Please consider adding an audio device!"; fi  
arc_devman=64   
devman_arc=$(VBoxManage showvminfo --machinereadable "$1" | grep ostype | cut -d "=" -f2 | grep -o "(.*)" | sed 's/(//;s/)//;s/-bit//') 
if [ $devman_arc != $arc_devman ]; then echo "[WARNING] Please use the DevManView version that coresponds to the guest architecture: $devman_arc "; fi  
nsmfoo commented 3 years ago

@PhantomCloak hi sorry for my late reply. Are you by any chance running the script on macOS?

PhantomCloak commented 3 years ago

Not actually, I was using the Ubuntu while trying to set-up my future Windows virtual box but I got this error while trying to run host script ,at that moment there were a no existing Virtual Machines nor addinatonal settings and I don't remember the vmware version but it was the clean install with the latest stable version, if this didn't help I can try to reproduce error again aswell also I haven't tested in machine that I'm using yet for now

nsmfoo commented 3 years ago

With the fix, https://github.com/nsmfoo/antivmdetection/commit/8d7cf0ef8c5ebbdaec373e3e4fccf97b9cd4306c I hope this issue was resolved ...