Friday, 1 June 2018

Fix different Sydi-Server issues


General post pulling together different issues that I've come across and fixed in Sydi-Server

Cannot find cscript.exe

Got an error “Can’t find script engine “VBScript” for script “”.
This sometimes means that the dll needs to be re-registered.
but it can also be a change made by an AV engine. McAfee and symantec do this a lot

Basically the antivirus software had changed the regkey that should point to the VBScript.dll.  
Fix that bad entry and the scripts all run fine

  1. Logon to the server as an administrator.
  2. Open the registry editor (regedit.exe) and navigate to the following registry key.[HKEY_CLASSES_ROOT\CLSID\{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InprocServer32]
  3. Check the path of the Default registry key, it will most likely point to the path of your Anti-Virus Product.
  4. Right click on InprocServer32 and select permissions. Give the Administrators group full access.
  5. Modify the Default registry key and change the path to C:\Windows\system32\vbscript.dll
  6. Change the regkey permissions back.


To re-register the vbscript.dll

Click on start button, type cmd. In the search result right-click on cmd and select
Run as Administrator.
Type cd %windir%\system32 and press enter.
Type regsvr32 vbscript.dll in command prompt and press enter.
If the registration was successful, you should now see the following message:
DllRegisterServer in vbscript.dll succeeded.


Cannot run Cscript.exe

Error running the cscript.exe command


Adding info on cscript.exe not running on Server 2012R2/ Server 2016 and Windows 10.
Copy the cscript.exe file from %windir%\syswow64 to to folder that you have Sydi-Server
saved to and run it now. All fixed!

Fix for SydiServe Excel issue on Excel 2013 and higher.

Sydi Server not working with Excel 2013 or Excel 2016
Sydiserver 2.4 released http://networklore.com/sydi/


When using the overview module sydi-overview.vbs I was getting errors;


sydi-overview2-4.vbs(596, 2) Microsoft VBScript runtime error: Subscript out of range
Great error message!


Turns out Excel 2013 opens 1 sheet by default, so you need to add in sheets 2 and 3
by copying in line 598 a few times.


Code lines for original are (590 to 601) objExcel.Cells.Select


objExcel.Cells.EntireColumn.AutoFit objExcel.ActiveWindow.SplitRow = 0.8 objExcel.ActiveWindow.FreezePanes = True
objExcel.Range("A1").Select objExcel.Sheets(1).Name = "Computers" objExcel.Sheets(2).Name = "WMI Programs"
objExcel.Sheets(3).Name = "Registry Programs" objExcel.Sheets.Add ,objExcel.Sheets(3) ' Add a new sheet after the last
one objExcel.Sheets(4).Name = "Processes" objExcel.Sheets.Add ,objExcel.Sheets(4) ' Add a new sheet after the last one
objExcel.Sheets(5).Name = "OS Distribution Data"



New lines need to be as follows (590 to 603) objExcel.Cells.Select
objExcel.Cells.EntireColumn.AutoFit objExcel.ActiveWindow.SplitRow = 0.8 objExcel.ActiveWindow.FreezePanes = True
objExcel.Range("A1").Select objExcel.Sheets(1).Name = "Computers" objExcel.Sheets.Add ,objExcel.Sheets(1) ' Add a new
sheet after the last one objExcel.Sheets(2).Name = "WMI Programs" objExcel.Sheets.Add ,objExcel.Sheets(2) ' Add a new
sheet after the last one objExcel.Sheets(3).Name = "Registry Programs" objExcel.Sheets.Add ,objExcel.Sheets(3) ' Add a
new sheet after the last one objExcel.Sheets(4).Name = "Processes" objExcel.Sheets.Add ,objExcel.Sheets(4) ' Add a new
sheet after the last one objExcel.Sheets(5).Name = "OS Distribution Data"

Thanks to Patrick Ogenstad http://networklore.com/ for the tools


MD5 hash of file
sydi-overview.vbs: 5f1d5ca7da8e83d5487d08e362ce4994
SHA1 hash of file
sydi-overview.vbs: 9b94e94a59d711155ffc4ec49026198a9e95a4e5

Command to check the hash CertUtil -hashfile sydi-overview.vbs MD5 CertUtil -hashfile
sydi-overview.vbs SHA1
File to download
https://raw.githubusercontent.com/wobblewobble/SydiServe_Excel_Fix/master/sydi-overview.vbs

Wednesday, 31 January 2018

Posting Code to my blogs

For my own reference to add code to my blogs and not have it edited




Copy the code you want to display in the post

Open Simplecode 

Paste the code in the box and click on enter

Copy the resulting the code and you are done. Just paste the code in blog post to display the code as expected



Sample 1

Straight Paste

3
false
sound
Sound Card
sound
7
ensoniq1371
35 

From Simplecode

<Item>
<rasd:AddressOnParent>3</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:Caption>sound</rasd:Caption>
<rasd:Description>Sound Card</rasd:Description>
<rasd:ElementName>sound</rasd:ElementName>
<rasd:InstanceID>7</rasd:InstanceID>
<rasd:ResourceSubType>ensoniq1371</rasd:ResourceSubType>
<rasd:ResourceType>35</rasd:ResourceType>


Its adding the following
A tag called < code >
the < is replaced with & l t ;

Item

The  > is replaced with & g t ;
And a  < br  / >  added to the end of each line for a new line.



Convert a Virtual Box OVA to VMware OVF and deploy



Back in college and trying to deploy the demo lab machines. Images I got were Virtual Box OVA files that would not deploy direct to ESXi. Trying to import an Virtual Box OVA file into ESXi and I got errors. Disk was incorrect, wrong hardware, didn't know disk size and a few other errors.

Found a few sites describing the methods, but never had a full set of instructions.

Tried for a few hours and came up with the below.


Download the VMware OVFTools, login is needed to access the download (correct link on 31/1/2018)

https://my.vmware.com/group/vmware/details?downloadGroup=OVFTOOL350&productId=352


Run OVFtool in Administrator mode and point it at your old
C:\Program Files\VMware\VMware OVF Tool>ovftool.exe E:\Downloads\Malware\Sniffer\Sniffer.ova E:\Downloads\Malware\SnifferOVF\sniffer.ovf


Open up the folder you converted to
Delete the mf file (Sniffer.mf) and edit the ovf file as follows

Then use a text editor to change the following sections in the .ovf file

Change the hardware to ESX suitable hardware



<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>

to

<vssd:VirtualSystemType>vmx-08</vssd:VirtualSystemType&gt;




Edit the Drive Type from SATA to a SCSI to suit VMware



<rasd:Address>0</rasd:Address>
<rasd:Caption>sataController0</rasd:Caption>
<rasd:Description>SATA Controller</rasd:Description>
<rasd:ElementName>sataController0</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceSubType>AHCI</rasd:ResourceSubType>
<rasd:ResourceType>20</rasd:ResourceType>

to

<rasd:Address>0</rasd:Address>
<rasd:Caption>SCSIController</rasd:Caption>
<rasd:Description>SCSI Controller</rasd:Description>
<rasd:ElementName>SCSIController</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
<rasd:ResourceType>6</rasd:ResourceType>




Delete the following section for the Sound Card (approx. line 100)

<Item>
<rasd:AddressOnParent>3</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:Caption>sound</rasd:Caption>
<rasd:Description>Sound Card</rasd:Description>
<rasd:ElementName>sound</rasd:ElementName>
<rasd:InstanceID>7</rasd:InstanceID>
<rasd:ResourceSubType>ensoniq1371</rasd:ResourceSubType>
<rasd:ResourceType>35</rasd:ResourceType>
</Item>



Then deploy your VM using vCenter/ vSphere Client. This will also deploy the vmdk for you as well.

KCCO