modules/post/windows/gather/enum_unattend.rb
#
# Extract sensitive data from Deployment Services.
# We can only seem to add one <Login> with Windows System Image Manager, so
# we'll only enum one.
#
Extract sensitive data from Deployment Services.
We can only seem to add one  with Windows System Image Manager, so
we'll only enum one.
Extract sensitive data from Deployment Services . We can only seem to add one with Windows System Image Manager so we ' ll only enum one .
def extract_deployment(deployment)
		return [] if deployment.nil?
		domain    = deployment.elements['Login/Credentials/Domain'].get_text.value rescue ''
		username  = deployment.elements['Login/Credentials/Username'].get_text.value rescue ''
		password  = deployment.elements['Login/Credentials/Password'].get_text.value rescue ''
		plaintext = deployment.elements['Login/Credentials/Password/PlainText'].get_text.value rescue 'true'
		if plaintext == 'false'
			password = Rex::Text.decode_base64(password)
			password = password.gsub(/#{Rex::Text.to_unicode('Password')}$/, '')
		end
		table = Rex::Ui::Text::Table.new({
			'Header' => 'WindowsDeploymentServices',
			'Indent' => 1,
			'Columns' => ['Domain', 'Username', 'Password']
		})
		table << [domain, username, password]
		return [table]
	end
def extract_deployment ( deployment ) return [ ] if deployment . nil? domain = deployment . elements [ 'Login/Credentials/Domain' ] . get_text . value rescue '' username = deployment . elements [ 'Login/Credentials/Username' ] . get_text . value rescue '' password = deployment . elements [ 'Login/Credentials/Password' ] . get_text . value rescue '' plaintext = deployment . elements [ 'Login/Credentials/Password/PlainText' ] . get_text . value rescue 'true' if plaintext == 'false' password = Rex :: Text . decode_base64 ( password ) password = password . gsub ( / #{ Rex :: Text . to_unicode ( 'Password' ) } $ / , '' ) end table = Rex :: Ui :: Text :: Table . new ( { 'Header' => 'WindowsDeploymentServices' , 'Indent' => 1 , 'Columns' => [ 'Domain' , 'Username' , 'Password' ] } ) table << [ domain , username , password ] return [ table ] end
Extract sensitive data from Deployment Services.
Extract sensitive data from Deployment Services .
deployment
<not_specific>