PoshCode Archive  Artifact [d5651fb888]

Artifact d5651fb888fe02de702a301aebf16d4a5965e0fe08745606d17f5e05446c8bd3:

  • File Please-hep.ps1 — part of check-in [63fc734ab0] at 2018-06-10 14:02:25 on branch trunk — Can someone explain to me what the following code is used to do? And how many it will produce? and How would the output be used? (user: VARRum size: 856)

# encoding: ascii
# api: powershell
# title: Please hep
# description: Can someone explain to me what the following code is used to do? And how many it will produce? and How would the output be used?
# version: 0.1
# author: VARRum
# license: CC0
# x-poshcode-id: 5837
# x-archived: 2015-05-01T17:57:39
# x-published: 2015-04-29T13:57:00
#
# What is the following code used to do? 
# maybe a password cracker for 4-chars passwords containing only chars from $chars
# How many will this produce? 
# 21^4
# How would the output be used? 
# crack a password
#
$chars = "b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z" 

foreach($char1 in $chars){ 
foreach($char2 in $chars){ 
foreach($char3 in $chars){ 
foreach($char4 in $chars){ 
$pw = $char1+$char2+$char3+$char4 
write-host $pw 
} 
} 
}	
}