PowerShell – what every
haXor needs to know
Jameel	
  Haffejee	
  /	
  RC1140	
  	
  
What is PowerShell
Its awesome
Why Should you care ?
 Its installed by default on a growing number of MS OS’s
  Windows 7
  Windows Server 2K8R2
 Optional On Windows XP SP 3
 Its an alternate scriptable way to access the OS
 It’s a unchecked environment at the moment
Accessing PowerShell
•  Can be accessed via the Start Menu or Run
•  Can be called from within batch files
•  Accessed via its hostable core in any supported language
Execution Policies
•  Restricted (Default)
•  Signed
•  Remote Signed
•  Unrestricted
•  Bypass
•  PowerShell Does not require admin privileges to run and
most commands work without the need for admin access.
PowerShell Trinity
 Where it all begins and ends, Get-Help , Get-Command ,Get-
member
Hello World
•  Variables
•  String Types
•  Loops
•  Running a script
•  ISE , Yes is comes with a ISE :P
Poking the System with
PowerShell
 One Liners – Because everyone has to count their
keystrokes till doom
 Accessing windows through WMI and COM
 Making use of Active Directory to index machines on the
network
 What can we do with more than one line
Knock Knock – Is that port open
 No direct PowerShell interfaces so we have to resort to .Net
 Making socket connections in PowerShell
  $tcpclient = new-Object system.Net.Sockets.TcpClient
  $tcpclient.Connect('localhost','80')
 Creating and using a Port Scanner in PowerShell
 Finally setting up a basic bind interface to listen on our port of
choice i.e Basic netcat
Breaking Down the front door
 Brute Forcing RDP/SQL with PowerShell
Popped The Cork
  So now that you have access to a PC/Server
what can you do ?
  Dumping Hashes
  Complete control over IIS from the command
line
  Setting up a bot with PowerShell
  Setting up backdoor access in 60 seconds,
Assuming you have physical access (Still
possible without physical access as well )
Questions and Contact Info
Twi3er	
  :	
  h3p://twi3er.com/RC1140	
  
Mail	
  	
  	
  	
  	
  	
  :	
  jameel@superuser.co.za	
  
IRC 	
  	
  	
  	
  	
  :	
  #ZaCon	
  (On	
  Atrum)	
  
	
  	
  	
  	
  	
  	
  	
  #PowerShell	
  (On	
  FreeNode)	
  
Code	
  	
  	
  	
  	
  :	
  h3p://github.com/rc1140/zacon	
  

2010 za con_jameel_haffejee

  • 1.
    PowerShell – whatevery haXor needs to know Jameel  Haffejee  /  RC1140    
  • 2.
  • 3.
    Why Should youcare ?  Its installed by default on a growing number of MS OS’s   Windows 7   Windows Server 2K8R2  Optional On Windows XP SP 3  Its an alternate scriptable way to access the OS  It’s a unchecked environment at the moment
  • 4.
    Accessing PowerShell •  Canbe accessed via the Start Menu or Run •  Can be called from within batch files •  Accessed via its hostable core in any supported language
  • 5.
    Execution Policies •  Restricted(Default) •  Signed •  Remote Signed •  Unrestricted •  Bypass •  PowerShell Does not require admin privileges to run and most commands work without the need for admin access.
  • 6.
    PowerShell Trinity  Where itall begins and ends, Get-Help , Get-Command ,Get- member
  • 7.
    Hello World •  Variables • String Types •  Loops •  Running a script •  ISE , Yes is comes with a ISE :P
  • 8.
    Poking the Systemwith PowerShell  One Liners – Because everyone has to count their keystrokes till doom  Accessing windows through WMI and COM  Making use of Active Directory to index machines on the network  What can we do with more than one line
  • 9.
    Knock Knock –Is that port open  No direct PowerShell interfaces so we have to resort to .Net  Making socket connections in PowerShell   $tcpclient = new-Object system.Net.Sockets.TcpClient   $tcpclient.Connect('localhost','80')  Creating and using a Port Scanner in PowerShell  Finally setting up a basic bind interface to listen on our port of choice i.e Basic netcat
  • 10.
    Breaking Down thefront door  Brute Forcing RDP/SQL with PowerShell
  • 11.
    Popped The Cork  So now that you have access to a PC/Server what can you do ?   Dumping Hashes   Complete control over IIS from the command line   Setting up a bot with PowerShell   Setting up backdoor access in 60 seconds, Assuming you have physical access (Still possible without physical access as well )
  • 12.
    Questions and ContactInfo Twi3er  :  h3p://twi3er.com/RC1140   Mail            :  jameel@superuser.co.za   IRC          :  #ZaCon  (On  Atrum)                #PowerShell  (On  FreeNode)   Code          :  h3p://github.com/rc1140/zacon