PSmRemoteNG.psm1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 |
# find mRemoteNG install location $mRNGDirectory = 'HKLM:\SOFTWARE\mRemoteNG', 'HKLM:\SOFTWARE\WOW6432Node\mRemoteNG' | ForEach-Object { Get-ItemProperty -Path $_ -Name InstallDir -ErrorAction SilentlyContinue } | Select-Object -First 1 -ExpandProperty InstallDir # load assemblies try { [void][System.Reflection.Assembly]::LoadFile( "$mRNGDirectory\mRemoteNG.exe" ) [void][System.Reflection.Assembly]::LoadFile( "$mRNGDirectory\BouncyCastle.Crypto.dll" ) } catch { throw $Messages.AssemblyLoadError } <# .SYNOPSIS Import an mRemoteNG root connections node from a confCons.xml file. .PARAMETER EncryptionKey The encryption key for the confCons.xml file. .EXAMPLE $RootNode = Import-MRNGRootNode -Path .\confCons.xml -EncryptionKey ( Read-Host 'Encryiption Key' -AsSecureString ) #> function Import-MRNGRootNode { [OutputType([mRemoteNG.Tree.Root.RootNodeInfo])] param( [Parameter(Mandatory)] [System.IO.FileInfo] $Path, [securestring] $EncryptionKey = ( ConvertTo-SecureString -String 'mR3m' -AsPlainText -Force ) ) # resolve the path $Path = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath( $Path ) # load the XML $DataProvider = [mRemoteNG.Config.DataProviders.FileDataProvider]::new( $Path ) $XmlString = $DataProvider.Load() # create a function to return the password # this is what mRemoteNG expects [Func[mRemoteNG.Tools.Optional[securestring]]]$Auth = { $EncryptionKey } # create a deserializer $Deserializer = [mRemoteNG.Config.Serializers.Xml.XmlConnectionsDeserializer]::new($Auth) # return the connections ( $Deserializer.Deserialize( $XmlString ) ).RootNodes.Item(0) } <# .SYNOPSIS Create an empty mRemoteNG root connections node. .PARAMETER EncryptionKey The encryption key to use for this connections file. .EXAMPLE $RootNode = New-MRNGRootNode #> function New-MRNGRootNode { [OutputType([mRemoteNG.Tree.Root.RootNodeInfo])] param( [securestring] $EncryptionKey = ( ConvertTo-SecureString -String 'mR3m' -AsPlainText -Force ) ) # convert the encryption key to plaintext $EncryptionKeyBSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR( $EncryptionKey ) $EncryptionKeyText = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto( $EncryptionKeyBSTR ) $RootNode = [mRemoteNG.Tree.Root.RootNodeInfo]::new('Connection') # set a password? if ( $EncryptionKeyText -ne $RootNode.DefaultPassword ) { $RootNode.Password = $true $RootNode.PasswordString = $EncryptionKeyText } $RootNode } <# .SYNOPSIS Create an mRemoteNG container node. .EXAMPLE New-MRNGContainer -Name 'Test Container' -Parent $RootNode -Protocol SSH2 .EXAMPLE $Container = New-MRNGContainer -Name 'Test Container' $RootContainer.AddChild( $Container ) $Container2 = New-MRNGContainer -Name 'Child Container' $Container.AddChild( $Container2 ) #> function New-MRNGContainer { [OutputType([mRemoteNG.Container.ContainerInfo])] [CmdletBinding()] param() dynamicparam { $DPDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary $SkipParameters = 'Inheritance', 'ConstantID', 'IsContainer' [mRemoteNG.Container.ContainerInfo].GetProperties() | Where-Object { $SkipParameters -notcontains $_.Name } | ForEach-Object { $Attribute = New-Object System.Management.Automation.ParameterAttribute $Attribute.ParameterSetName = '__AllParameterSets' $Collection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] $Collection.Add($Attribute) $Parameter = New-Object System.Management.Automation.RuntimeDefinedParameter( $_.Name, $_.PropertyType, $Collection ) $DPDictionary.Add( $_.Name, $Parameter ) } $Attribute = New-Object System.Management.Automation.ParameterAttribute $Attribute.ParameterSetName = '__AllParameterSets' $Collection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] $Collection.Add($Attribute) $Parameter = New-Object System.Management.Automation.RuntimeDefinedParameter( 'Inheritance', [hashtable], $Collection ) $DPDictionary.Add( 'Inheritance', $Parameter ) return $DPDictionary } process { $ContainerInfo = [mRemoteNG.Container.ContainerInfo]::new() # set default port if ( $PSBoundParameters.Keys -contains 'Protocol' -and $PSBoundParameters.Keys -notcontains 'Port' ) { $PSBoundParameters.Port = switch ( $PSBoundParameters.Protocol ) { 'RDP' { 3389 } 'VNC' { 5900 } 'SSH1' { 22 } 'SSH2' { 22 } 'Telnet' { 23 } 'Rlogin' { 513 } 'RAW' { 23 } 'HTTP' { 80 } 'HTTPS' { 443 } 'IntApp' { 0 } } } # set connection properties $PSBoundParameters.Keys | Where-Object { $_ -notmatch 'Parent|Children|Inheritance' } | Where-Object { [mRemoteNG.Container.ContainerInfo].GetProperties().Name -contains $_ } | ForEach-Object { $ContainerInfo.$_ = $PSBoundParameters.$_ } # configure inheritance if ( $PSBoundParameters.Keys -contains 'Inheritance' ) { # process EverythingInherited first if ( $PSBoundParameters.Inheritance.Keys -contains 'EverythingInherited' ) { $ContainerInfo.Inheritance.EverythingInherited = $true } # process all other inheritence $PSBoundParameters.Inheritance.Keys | Where-Object { $_ -ne 'EverythingInherited' } | ForEach-Object { $ContainerInfo.Inheritance.$_ = $PSBoundParameters.Inheritance.$_ } } # if children is specified we append if ( $PSBoundParameters.Keys -contains 'Children' ) { $PSBoundParameters.Children | ForEach-Object { $ContainerInfo.AddChild($_) Write-Verbose ( 'Child ''{0}'' added to ''{1}''.' -f $_.Name, $ContainerInfo.Name ) } } # if parent is specified we append, otherwise we output if ( $PSBoundParameters.Keys -contains 'Parent' ) { $PSBoundParameters.Parent.AddChild( $ContainerInfo ) Write-Verbose ( 'Container ''{0}'' added to ''{1}''.' -f $ContainerInfo.Name, $PSBoundParameters.Parent.Name ) } $ContainerInfo } } <# .SYNOPSIS Create an mRemoteNG connection node. .EXAMPLE New-MRNGConnection -Name 'Test Connection' -HostName '127.0.0.1' -Parent $RootNode -Protocol SSH2 -Inheritance (New-MRNGInheritanceConfiguration -EverythingInherited -Protocol:$false) .EXAMPLE $Connection = New-MRNGConnection -Name 'Test Connection' -HostName '127.0.0.1' $RootContainer.AddChild( $Connection ) #> function New-MRNGConnection { [OutputType([mRemoteNG.Connection.ConnectionInfo])] [CmdletBinding()] param() dynamicparam { $DPDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary $SkipParameters = 'Inheritance', 'ConstantID', 'IsContainer' [mRemoteNG.Connection.ConnectionInfo].GetProperties() | Where-Object { $SkipParameters -notcontains $_.Name } | ForEach-Object { $Attribute = New-Object System.Management.Automation.ParameterAttribute $Attribute.ParameterSetName = '__AllParameterSets' $Collection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] $Collection.Add($Attribute) $Parameter = New-Object System.Management.Automation.RuntimeDefinedParameter( $_.Name, $_.PropertyType, $Collection ) $DPDictionary.Add( $_.Name, $Parameter ) } $Attribute = New-Object System.Management.Automation.ParameterAttribute $Attribute.ParameterSetName = '__AllParameterSets' $Collection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] $Collection.Add($Attribute) $Parameter = New-Object System.Management.Automation.RuntimeDefinedParameter( 'Inheritance', [hashtable], $Collection ) $DPDictionary.Add( 'Inheritance', $Parameter ) return $DPDictionary } process { $ConnectionInfo = [mRemoteNG.Connection.ConnectionInfo]::new() # set default port if ( $PSBoundParameters.Keys -contains 'Protocol' -and $PSBoundParameters.Keys -notcontains 'Port' ) { $PSBoundParameters.Port = switch ( $PSBoundParameters.Protocol ) { 'RDP' { 3389 } 'VNC' { 5900 } 'SSH1' { 22 } 'SSH2' { 22 } 'Telnet' { 23 } 'Rlogin' { 513 } 'RAW' { 23 } 'HTTP' { 80 } 'HTTPS' { 443 } 'IntApp' { 0 } } } # set connection properties $PSBoundParameters.Keys | Where-Object { $_ -notmatch 'Parent|Inheritance' } | Where-Object { [mRemoteNG.Connection.ConnectionInfo].GetProperties().Name -contains $_ } | ForEach-Object { $ConnectionInfo.$_ = $PSBoundParameters.$_ } # configure inheritance if ( $PSBoundParameters.Keys -contains 'Inheritance' ) { # process EverythingInherited first if ( $PSBoundParameters.Inheritance.Keys -contains 'EverythingInherited' ) { $ConnectionInfo.Inheritance.EverythingInherited = $true } # process all other inheritence $PSBoundParameters.Inheritance.Keys | Where-Object { $_ -ne 'EverythingInherited' } | ForEach-Object { $ConnectionInfo.Inheritance.$_ = $PSBoundParameters.Inheritance.$_ } } # if parent is specified we append, otherwise we output if ( $PSBoundParameters.Keys -contains 'Parent' ) { $PSBoundParameters.Parent.AddChild( $ConnectionInfo ) Write-Verbose ( 'Connection ''{0}'' added to ''{1}''.' -f $ConnectionInfo.Name, $PSBoundParameters.Parent.Name ) } $ConnectionInfo } } <# .SYNOPSIS Helper function to build an inheritance configuration. .EXAMPLE New-MRNGInheritanceConfiguration -EverythingInherited -Icon:$false # inherits everything except the icon #> function New-MRNGInheritanceConfiguration { [OutputType([hashtable])] [CmdletBinding()] param() dynamicparam { $DPDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary [mRemoteNG.Connection.ConnectionInfoInheritance].GetProperties() | Where-Object { $_.Name -ne 'Parent' } | ForEach-Object { $Attribute = New-Object System.Management.Automation.ParameterAttribute $Attribute.ParameterSetName = '__AllParameterSets' $Collection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] $Collection.Add($Attribute) $Parameter = New-Object System.Management.Automation.RuntimeDefinedParameter( $_.Name, [switch], $Collection ) $DPDictionary.Add( $_.Name, $Parameter ) } return $DPDictionary } process { $ReturnHashtable = @{} $PSBoundParameters.Keys | Where-Object { [mRemoteNG.Connection.ConnectionInfoInheritance].GetProperties().Name -contains $_ } | ForEach-Object { $ReturnHashtable.$_ = $PSBoundParameters.$_ } $ReturnHashtable } } <# .SYNOPSIS Exports the mRemoteNG connection file with the encryption parameters specified. .PARAMETER RootNode The mRemoteNG root connections node generated by New-MRNGRootNode. .PARAMETER Path The path to export the connection file to. .PARAMETER EncryptionKey The encryption key to use to secure the connections file. If no password is supplied the default mRemoteNG encryption key is "mR3m". .PARAMETER EncryptionEngine The encryption engine to use when encrypting the connection passwords. Choices are 'AES', 'Serpent', and 'Twofish'. The default is 'AES'. .PARAMETER BlockCipherMode The block cipher mode to use when encrypting the connection passwords. Choices are 'GCM', 'CCM', and 'EAX'. The default is 'GCM'. .PARAMETER KeyDerivationIterations The number of key derivation iterations to perform when encrypting the connection passwords. Valid values are in the range 1,000 to 50,000. .PARAMETER SortConnections Should the exported connections be sorted? .EXAMPLE Export-MRNGConnectionFile -RootNode $RootNode -Path .\Connections.xml (Get-Credential).Password -SortConnections #> function Export-MRNGConnectionFile { [OutputType([void])] param( [Parameter(Mandatory)] [mRemoteNG.Tree.Root.RootNodeInfo] $RootNode, [Parameter(Mandatory)] [System.IO.FileInfo] $Path, [ValidateSet('AES', 'Serpent', 'Twofish')] [string] $EncryptionEngine = 'AES', [ValidateSet('GCM', 'CCM', 'EAX')] [string] $BlockCipherMode = 'GCM', [ValidateRange(1000, 50000)] [int] $KeyDerivationIterations = 1000, [switch] $SortConnections ) # resolve the path $Path = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath( $Path ) # get the encryption key as [securestring] if ( $RootNode.Password ) { $EncryptionKey = $RootNode.PasswordString | ConvertTo-SecureString -AsPlainText -Force } else { $EncryptionKey = $RootNode.DefaultPassword | ConvertTo-SecureString -AsPlainText -Force } # choose the encryption engine $Engine = switch ( $EncryptionEngine ) { 'AES' { [Org.BouncyCastle.Crypto.Engines.AesEngine]::new() } 'Serpent' { [Org.BouncyCastle.Crypto.Engines.SerpentEngine]::new() } 'Twofish' { [Org.BouncyCastle.Crypto.Engines.TwofishEngine]::new() } } # choose the cipher mode $Cipher = switch ( $BlockCipherMode ) { 'GCM' { [Org.BouncyCastle.Crypto.Modes.GcmBlockCipher]::new( $Engine ) } 'CCM' { [Org.BouncyCastle.Crypto.Modes.CcmBlockCipher]::new( $Engine ) } 'EAX' { [Org.BouncyCastle.Crypto.Modes.EaxBlockCipher]::new( $Engine ) } } # XML serializer $CryptoProvider = [mRemoteNG.Security.SymmetricEncryption.AeadCryptographyProvider]::new( $Cipher ) $SaveFilter = [mRemoteNG.Security.SaveFilter]::new() $ConnectionNodeSerializer = [mRemoteNG.Config.Serializers.Xml.XmlConnectionNodeSerializer26]::new($CryptoProvider, $EncryptionKey, $SaveFilter) $XmlSerializer = [mRemoteNG.Config.Serializers.Xml.XmlConnectionsSerializer]::new($CryptoProvider, $ConnectionNodeSerializer) # should we sort? if ( $SortConnections ) { $RootNode.SortRecursive() } # save the connection file $FilePathProvider = [mRemoteNG.Config.DataProviders.FileDataProvider]::new( $Path ) $FilePathProvider.Save( $XmlSerializer.Serialize( $RootNode ) ) } <# .SYNOPSIS Convert a mRemoteNG secure string to plain text. .PARAMETER EncryptedMessage The mRemoteNG secure string to be converted. .PARAMETER EncryptionKey The encryption key that was used when encrypting the ConfCons.xml file. If no password is supplied the default mRemoteNG encryption key is "mR3m". .PARAMETER EncryptionEngine The encryption engine to use when decrypting the string. Choices are 'AES', 'Serpent', and 'Twofish'. The default is 'AES'. .PARAMETER BlockCipherMode The block cipher mode to use when decrypting the string. Choices are 'GCM', 'CCM', and 'EAX'. The default is 'GCM'. .PARAMETER KeyDerivationIterations The number of key derivation iterations to perform when decrypting the string. Valid values are in the range 1,000 to 50,000. .EXAMPLE ConvertFrom-MRNGSecureString -EncryptedMessage 'pLs5zen+UvaqFnn2KDn2eTrhO60gjzagqFnI/8n3dF74zCj9lZDGvR1nJ8bxf5OCuHJW8gcWFWOicNIvV4h1' .EXAMPLE ConvertFrom-MRNGSecureString -EncryptedMessage 'LkJUc6Q60hsZmX6QImOS+1nvFYQLNNCfP7iEupby8Ey84Dz+3u7lRo93YaL6fJf2GCXOtpXtzgZACxhVKcJh' -EncryptionEngine Serpent -BlockCipherMode EAX .EXAMPLE ConvertFrom-MRNGSecureString -EncryptedMessage 'MqE3IQxYiLioTaD86rzRusDmiD2nX2b9uabDASZdRB9+gk7ygLWSqYFVEg5zqa65qe6j3ZPtgeLxKNZiIoGv' -EncryptionKey ( 'password' | ConvertTo-SecureString -AsPlainText -Force ) #> function ConvertFrom-MRNGSecureString { [OutputType([string])] param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $EncryptedMessage, [ValidateNotNullOrEmpty()] [securestring] $EncryptionKey = ( ConvertTo-SecureString -String 'mR3m' -AsPlainText -Force ), [ValidateSet('AES', 'Serpent', 'Twofish')] [string] $EncryptionEngine = 'AES', [ValidateSet('GCM', 'CCM', 'EAX')] [string] $BlockCipherMode = 'GCM', [ValidateRange(1000, 50000)] [int] $KeyDerivationIterations = 1000 ) # choose the text encoding $Encoding = [System.Text.Encoding]::UTF8 # convert the $EncryptionKey to plain text $EncryptionKeyBSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR( $EncryptionKey ) $EncryptionKeyText = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto( $EncryptionKeyBSTR ) $EncryptionKeyBytes = [Org.BouncyCastle.Crypto.PbeParametersGenerator]::Pkcs5PasswordToBytes( [char[]]$EncryptionKeyText ) # convert the base64 encoded string to a byte array $EncryptedMessageBytes = [convert]::FromBase64String( $EncryptedMessage ) # choose the encryption engine $Engine = switch ( $EncryptionEngine ) { 'AES' { [Org.BouncyCastle.Crypto.Engines.AesEngine]::new() } 'Serpent' { [Org.BouncyCastle.Crypto.Engines.SerpentEngine]::new() } 'Twofish' { [Org.BouncyCastle.Crypto.Engines.TwofishEngine]::new() } } # choose the cipher mode $Cipher = switch ( $BlockCipherMode ) { 'GCM' { [Org.BouncyCastle.Crypto.Modes.GcmBlockCipher]::new( $Engine ) } 'CCM' { [Org.BouncyCastle.Crypto.Modes.CcmBlockCipher]::new( $Engine ) } 'EAX' { [Org.BouncyCastle.Crypto.Modes.EaxBlockCipher]::new( $Engine ) } } # generate a new random string $SecureRandom = [Org.BouncyCastle.Security.SecureRandom]::new() # defaults from mRemoteNG source $NonceBitSize = 128 $MacBitSize = 128 $KeyBitSize = 256 $SaltBitSize = 128 $MinPasswordLength = 1 # get the salt $Salt = New-Object byte[] ( $SaltBitSize/8 ) [array]::Copy( $EncryptedMessageBytes, 0, $Salt, 0, $Salt.Length ) # get the key $KeyGenerator = [Org.BouncyCastle.Crypto.Generators.Pkcs5S2ParametersGenerator]::new() $KeyGenerator.Init( $EncryptionKeyBytes, $Salt, $KeyDerivationIterations ) $KeyParameter = $KeyGenerator.GenerateDerivedMacParameters($KeyBitSize) $KeyBytes = $KeyParameter.GetKey() # create the cipher reader $CipherStream = New-Object System.IO.MemoryStream (, $EncryptedMessageBytes ) $CipherReader = New-Object System.IO.BinaryReader ( $CipherStream ) # get the payload $Payload = $CipherReader.ReadBytes( $Salt.Length ) # get the nonce $Nonce = $CipherReader.ReadBytes( $NonceBitSize / 8 ) # build the decryption parameters $Parameters = [Org.BouncyCastle.Crypto.Parameters.AeadParameters]::new( $KeyParameter, $MacBitSize, $Nonce, $Payload ) # initialize the Cipher $Cipher.Init( $false, $Parameters ) # get the cipher text $CipherTextBytes = $CipherReader.ReadBytes( $EncryptedMessageBytes.Length - $Nonce.Length ) # read the decoded text byte array $PlainTextByteArray = New-Object byte[] ( $Cipher.GetOutputSize( $CipherTextBytes.Length ) ) # get the length of the decoded string $Len = $Cipher.ProcessBytes( $CipherTextBytes, 0, $CipherTextBytes.Length, $PlainTextByteArray, 0 ) # do finial decryption $Cipher.DoFinal( $PlainTextByteArray, $Len ) > $null # output UTF8 encoded string $Encoding.GetString( $PlainTextByteArray ) } <# .SYNOPSIS Convert a plain text string to a mRemoteNG secure string. .PARAMETER Message The string to be converted. .PARAMETER EncryptionKey The encryption key to use when encrypting the string. It should match what you are using in your ConfCons.xml file. If no password is supplied the default mRemoteNG encryption key is "mR3m". .PARAMETER EncryptionEngine The encryption engine to use when encrypting the string. Choices are 'AES', 'Serpent', and 'Twofish'. The default is 'AES'. .PARAMETER BlockCipherMode The block cipher mode to use when encrypting the string. Choices are 'GCM', 'CCM', and 'EAX'. The default is 'GCM'. .PARAMETER KeyDerivationIterations The number of key derivation iterations to perform when encrypting the string. Valid values are in the range 1,000 to 50,000. .EXAMPLE ConvertTo-MRNGSecureString -Message 'SecureP@ssword!' .EXAMPLE ConvertTo-MRNGSecureString -Message 'SecureP@ssword!' -EncryptionEngine Serpent -BlockCipherMode EAX .EXAMPLE ConvertTo-MRNGSecureString -Message 'SecureP@ssword!' -EncryptionKey ( 'password' | ConvertTo-SecureString -AsPlainText -Force ) #> function ConvertTo-MRNGSecureString { [OutputType([string])] param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $Message, [ValidateNotNullOrEmpty()] [securestring] $EncryptionKey = ( ConvertTo-SecureString -String 'mR3m' -AsPlainText -Force ), [ValidateSet('AES', 'Serpent', 'Twofish')] [string] $EncryptionEngine = 'AES', [ValidateSet('GCM', 'CCM', 'EAX')] [string] $BlockCipherMode = 'GCM', [ValidateRange(1000, 50000)] [int] $KeyDerivationIterations = 1000 ) # choose the text encoding $Encoding = [System.Text.Encoding]::UTF8 # convert the $EncryptionKey to plain text $EncryptionKeyBSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR( $EncryptionKey ) $EncryptionKeyText = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto( $EncryptionKeyBSTR ) $EncryptionKeyBytes = [Org.BouncyCastle.Crypto.PbeParametersGenerator]::Pkcs5PasswordToBytes( [char[]]$EncryptionKeyText ) # convert message to byte array $MessageBytes = $Encoding.GetBytes($Message) # choose the encryption engine $Engine = switch ( $EncryptionEngine ) { 'AES' { [Org.BouncyCastle.Crypto.Engines.AesEngine]::new() } 'Serpent' { [Org.BouncyCastle.Crypto.Engines.SerpentEngine]::new() } 'Twofish' { [Org.BouncyCastle.Crypto.Engines.TwofishEngine]::new() } } # choose the cipher mode $Cipher = switch ( $BlockCipherMode ) { 'GCM' { [Org.BouncyCastle.Crypto.Modes.GcmBlockCipher]::new( $Engine ) } 'CCM' { [Org.BouncyCastle.Crypto.Modes.CcmBlockCipher]::new( $Engine ) } 'EAX' { [Org.BouncyCastle.Crypto.Modes.EaxBlockCipher]::new( $Engine ) } } # generate a new random string $SecureRandom = [Org.BouncyCastle.Security.SecureRandom]::new() # defaults from mRemoteNG source $NonceBitSize = 128 $MacBitSize = 128 $KeyBitSize = 256 $SaltBitSize = 128 $MinPasswordLength = 1 # create the salt $Salt = New-Object byte[] ( $SaltBitSize/8 ) $SecureRandom.NextBytes($Salt) # create the key $KeyGenerator = [Org.BouncyCastle.Crypto.Generators.Pkcs5S2ParametersGenerator]::new() $KeyGenerator.Init( $EncryptionKeyBytes, $Salt, $KeyDerivationIterations ) $KeyParameter = $KeyGenerator.GenerateDerivedMacParameters($KeyBitSize) $KeyBytes = $KeyParameter.GetKey() # create the payload and add the salt $Payload = New-Object byte[] ( $Salt.Length ) [array]::Copy( $Salt, 0, $Payload, 0, $Salt.Length ) # create the nonce $Nonce = New-Object byte[] ( $NonceBitSize / 8 ) $SecureRandom.NextBytes( $Nonce, 0, $Nonce.Length ) # build the encryption parameters $Parameters = [Org.BouncyCastle.Crypto.Parameters.AeadParameters]::new( $KeyParameter, $MacBitSize, $Nonce, $Payload ) # initialize the cipher $Cipher.Init( $true, $Parameters ) # encrypt the message $CipherText = New-Object byte[] ($Cipher.GetOutputSize( $MessageBytes.Length )) $Len = $Cipher.ProcessBytes( $MessageBytes, 0, $MessageBytes.Length, $CipherText, 0 ) $Cipher.DoFinal( $CipherText, $Len ) > $null # create a binary stream $CombinedStream = New-Object System.IO.MemoryStream $BinaryWriter = New-Object System.IO.BinaryWriter ( $CombinedStream ) # write the payload, nonce, and cipher to the binary stream $BinaryWriter.Write( $Payload ) $BinaryWriter.Write( $Nonce ) $BinaryWriter.Write( $CipherText ) # convert the binary stream to a base64 encoded string [convert]::ToBase64String( $CombinedStream.ToArray() ) } # SIG # Begin signature block # MIIesgYJKoZIhvcNAQcCoIIeozCCHp8CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR # AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUSteiarZo00I03b9tTWCZPUh9 # Lvigghm9MIIEhDCCA2ygAwIBAgIQQhrylAmEGR9SCkvGJCanSzANBgkqhkiG9w0B # AQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNV # BAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRU # cnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTA1MDYwNz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