E-MailRelay

What is it?

E-MailRelay is a simple store-and-forward message transfer agent and proxy server. It runs on Unix-like operating systems (including Linux), and on Windows.

When used as proxy server the E-MailRelay program (emailrelay) runs in the background and accepts e-mail from local e-mail client programs (KMail, Outlook etc.) or from the outside world, using the SMTP protocol. As soon as an e-mail message is received it is forwarded on to the next SMTP server for onward delivery. This becomes more useful when you add in your own message processing: as each message is received it can be passed one of your programs for editing, filtering, encrypting etc.

Get it here EmailRelay

Or my local copy Version 1.9 EmailRelay

 

pfsense – Image upgrade issues

Psense troubleshooting – Image upgrade problems

Symptom: Unable to check for updates

Fix:

  1. Set the update repo to 2.3.X Security/Errata only in update settings.
  2. Run this command from Diag > Command prompt
    pkg-static clean -ya; pkg-static install -yf pkg pfSense-repo pfSense-upgradeThis forces it to downgrade those packages to the correct version for 2.3.4
  3. Update to 2.3.5
  4. Switch back to Latest stable version in System Update Systems. Skip step 5 if update for 2.4.2 is detected.
  5. If the gui will not switch back to latest stable version update selection then just select option 13 in ssh. It will find 2.4.2 for sure. Warning: The update to 2.4.2 will take a couple minutes so don´t freak out. Let me know if you need more help.

Attempted update from 2.3.4 to 2.4.2 – Upgrade failed and now "Unable to check for updates" —– Log Linked
byu/UltiFix inPFSENSE

 

Add to PS1 File Context Menu in Windows 10 for editing in ISE elevated

I wanted to get into ISE elevated directly from the shell by just rightclicking the *.ps1 file and then choose to edit …

I realy couldnt find anywone that had made this available public 100% working… so here it is… my verison…

Create a regfile of the below and run it or edit the registry directly…

Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.PowerShellScript.1\Shell\Edit(Elevated)]
    @="Redigera (eleverat)"
    "HasLUAShield"=""

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.PowerShellScript.1\Shell\Edit(Elevated)\Command]
    @="c:\\windows\\system32\\windowsPowerShell\\v1.0\\powershell.exe -command \"& {start-process -Filepath \"c:\\windows\\system32\\windowsPowerShell\\v1.0\\\\powershell_ise.exe -Verb RunAS %1\"}"

Result

RDS Connection Broker on RDS on a DomainController

Sigh this isnt the best solution but … it works…

When installing RDSH on the domain controller 2016 it uses the Windows Internal Database (a small SQL)
It does not allow it to run properly due to missing credentials…
add the following security identity to the ”log on as a service” rigths on the default domain controller policy.

 

Redirected homefolder – the correct way…

https://support.microsoft.com/kb/274443

1. Set Share Permissions for the the correct group to full access (Sudgestionname: RDS_access_all_user)

2. Use the following settings for NTFS Permissions:

CREATOR OWNER – Full Control (Apply onto: Subfolders and Files Only)
System – Full Control (Apply onto: This Folder, Subfolders and Files)
Domain Admins – Full Control (Apply onto: This Folder, Subfolders and Files)
RDS_access_all_user – Modify (Apply onto: This folder only)
RDS_access_all_user – Read & Execute (Apply onto: This folder only)
RDS_access_all_user – List fodler content (Apply onto: This folder only)
RDS_access_all_user – read (Apply onto: This folder only)
RDS_access_all_user – write(Apply onto: This folder only)

RDS Cert and RDWBmodding

Detta skript gör så man inte får fel i RDGW när man nyttjar det externa namnet från SSL certet.


# Kör detta på på 2016 ConnectionBrokermaskinen eleverat
Import-Module RemoteDesktop
get-rdserver

$clientAccessName = "remote.Kundnamn.se" # SSL namn...
$ConnectionBroker = "vrds04.hr.local"

# Ange nu brokern nedan
set-RDWorkspace -Name "Remote Deskop" -ConnectionBroker $ConnectionBroker

# Gör en backup av RD WEB
$Source = "C:\windows\Web\RDWeb"
$BackupDest = "c:\windows\web\backup\rdweb"
copy-item -Recurse $Source ($BackupDest +"\"+(Get-Date -format "yyyMMdhhmmss"))

# Branding av RDWEB
copy-item *.png ($Source + "\Pages\images")

#Fixa Cert namnen! 2 lägen finns Normal samt HA URL: -> https://gallery.technet.microsoft.com/Change-published-FQDN-for-2a029b80
# I HA läge använder man sig av en sql för all last balansera... och då har man en connectionstring... kolla om vi har det ... null = nope och vi kör troligen inte i HA...
if ((iwmi -Class "Win32_RDMSDeploymentSettings" -Namespace "root\CIMV2\rdms" -Name "GetStringProperty" -ArgumentList @("DatabaseConnectionString") -ComputerName $ConnectionBroker -Authentication PacketPrivacy) -eq $null)
{
# Broker runns probably in HA mode Use Powershell
Set-RDClientAccessName -ConnectionBroker $ConnectionBroker -ClientAccessName $ClientAccessName
}
else
{
# Broker runns probably not i HA mode Use WMI!

#Kollar befintligt namn....
iwmi -Class "Win32_RDMSDeploymentSettings" -Namespace "root\CIMV2\rdms" -Name "GetStringProperty" -ArgumentList @("DeploymentRedirectorServer") -ComputerName $ConnectionBroker -Authentication PacketPrivacy

#Skriv in det nya namnet som sakll nyttjas (Samma som Certet man nyttjar tex remote.kundnamn.se; returnerar 0
iwmi -Class "Win32_RDMSDeploymentSettings" -Namespace "root\CIMV2\rdms" -Name "SetStringProperty" -ArgumentList @("DeploymentRedirectorServer",$ClientAccessName) -ComputerName $ConnectionBroker -Authentication PacketPrivacy -ErrorAction Stop

# kollar igen så vi lyckades ändrad namnet...
iwmi -Class "Win32_RDMSDeploymentSettings" -Namespace "root\CIMV2\rdms" -Name "GetStringProperty" -ArgumentList @("DeploymentRedirectorServer") -ComputerName $ConnectionBroker -Authentication PacketPrivacy

}

SSL issues with old appliances etc – Lower Security temporary

In a new tab, type or paste about:config in the address bar and press Enter. Click the button promising to be careful
* In the search box above the list, type or paste ssl3 and pause while the list is filtered
(3) Double-click the security.ssl3.dhe_rsa_aes_128_sha preference to switch it from true to false (this usually would be the first item on the list)
(4) Double-click the security.ssl3.dhe_rsa_aes_256_sha preference to switch it from true to false (this usually would be the second item on the list)

That’s it, you can test using: https://www.ssllabs.com/ssltest/viewMyClient.html

Gain local admin password

To gain a local admin password is rather simple on any machine that is not bitlocked or some how protected offline.

Setup:
Have/Make a bootable windows 10 USB stick…

#1 Boot windows media Press Shift+F10 to gain Commandprompt
#2 Change dir to local windows drive c:\windows\system32
#3 copy utilman.exe utilman.old
#4 copy cmd.exe utilman.exe

# ALT is to use sethc.exe… activates with Shift 5 times…

#5 reboot computer and boot into windows
#6 Press Windows + U and now a command prompt will appear outside windows logon. (Or shift 5 times…)

#7 Change current admin password with
Net user administrator newpassword
net user administrator /active:yes

If needed make a new account with
net user NewAdmin /add
net localgroup administrator NewAdmin /add
#8 Reboot and login with the new/changed account

Cleanup:
This probably needs a bit of extra high rights – installer etc..
Reset it the same way you setit up above will always work.

# Start a commandprompt as admin.
#Change dir to local windows drive c:\windows\system32
delete utilman.exe
Copy utilman.old utilman.exe

Press Windows + U to se controll comming upp ok
Or Shift 5 times if you are using Sethc.exe

Tested and works on:
Windows Server 2016 Technical Preview 5
Windows 7
Windows 10 1909
Windows Server 2012 R2

RDGateway

RD-Gateway

Install RD Gateway with Powershell fast.. (2012R2)
Certs needs to be fixed and firewall ports needs to be opened and Nated … 443…

# Add Windows Role/Feature
Add-WindowsFeature -Name RDS-gateway -IncludeAllSubFeature -IncludeManagementTools

#verifiy that the module is present … and Load it…
Get-Module remotedesktopservices
import-module remotedesktopservices

 

# Create AD Security Group – Is created in Defalut ”users” container.
new-adgroup -Name ”RD-GW-Users” -Groupscope Global
Add-ADGroupMember ”RD-GW-Users” -member ”Domain Admins”
# Get Domain we are running in.. (Just to get things dynamic)
$dom=get-addomain | Select Name # $dom.name give us the domain name from now on..

#change dir into rds provider
cd RDS:
# Create new Connection Authorization Policy (CAP)
New-Item -Path ”RDS:\GatewayServer\CAP” -Name ”Allow RD-GW-Users” -UserGroups ”RD-GW-Users@$($dom.name)” -AuthMethod 1
# Create new Resource Authorization Policy
New-Item -Path ”RDS:\GatewayServer\RAP” -Name ”Allow Connections To Everywhere” -UserGroups ”RD-GW-Users@$($dom.name)” -ComputerGroupType 2