miércoles, 13 de abril de 2022

DMZ. Share LAN Windows folder with DMZ Linux Server

 Purpose

Share a folder in one LAN Windows File server with a Linux Web Server in a DMZ.


Information

Web Server in DMZ:  192.168.89.55  - Linux

File Server in LAN:  192.168.79.71  - Windows

Open DMZ ports: 445, 137,138,139  - In a DMZ Firewall

Domain Windows: MyDomain


Steps

[ ] Share a Folder in a Windows server

We have read permission to user: svcwebserver

Name Server: WindowsServer1

Share Folder: FoldertoRead1


[ ] The server in DMZ need CIFS installed

Command: apt-cache search cifs-utils


Command: apt-get install cifs-utils


[ ] At DMZ Web Server we need create a folder to mount the Window File server share folder.

Command:  Sudo mkdir /mnt/FoldertoRead2

[ ] In the DMZ Web server. Mount the LAN share folder

Command:  sudo mount -t cifs -o vers=2.0,username=svcwebserver,domain=Mydomain,password=HolaHola //192.168.89.171/FoldertoRead1 /mnt/FoldertoRead2

[ ] In the DMZ Web server. For check

Command: df-h 


 [ ] Automatic Mount in DMZ Server

Edit /etc/fstab -> Sudo nano /etc/fstab

Add the text: 

//192.168.89.171/FoldertoRead1     /mnt/FoldertoRead2      cifs    vers=2.0,username=svcwebserver,domain=MyDomain,password=HolaHola,nofail  0       0


by GoN | Published: April 13 2022 | Last Updated:

miércoles, 9 de marzo de 2022

WINDOWS. PS. Eventvwr insert event

 Purpose

Write a event into Windows eventViewer. It is very util to register some task.

Dificulty: Low 

COMMAND:

if(-not([System.Diagnostics.EventLog]::SourceExists("MySourcex"))){
    New-EventLog -LogName 'Application' -Source 'MySourcex'
}
Write-EventLog -LogName 'Application' -Source 'MySourcex' -EventId 6123 -EntryType Information -Message 'Check Test Log 66123 GoB'



References:

 https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.eventlog.sourceexists?redirectedfrom=MSDN&view=dotnet-plat-ext-6.0#overloads

 https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/write-eventlog?view=powershell-5.1


by GoN | Published: Mar 9, 2022 | Last Updated: 

martes, 1 de marzo de 2022

WINDOWS. PS. List install program

 Purpose

Check the software install in the Windows computer

Dificulty: Low

COMMAND: Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, Publisher, DisplayVersion, InstallDate | Format-Table -AutoSize 

Description: All software install


COMMAND: Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | where {$_.DisplayName -Like "AMD*"} | Format-Table -AutoSize
 

Description: Software install with "AMD" in the description

  
 by GoN | Published: Mar 1, 2022 | Last Updated: