Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Browser Saved Passwords Automation #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Programs/WebBrowserPassView.exe
Binary file not shown.
Binary file added Programs/psget.zip
Binary file not shown.
24 changes: 24 additions & 0 deletions READ ME.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This Script is designed to run in Syncro and to take Passwords saved in all browsers and import them into ITGlue.

There are 2 global variables input through Syncro, $asset_name and $account_name which take the asset_name and account_name from Syncro respectively.

All programs go to the Path "C:\TechTools\pw" for ease of access and cleanup.
Programs needed to run the Script:
WebBrowserPassView.exe
psget.zip


Windows Defender sometimes blocks the programs from running. If this happens the script will fail. When this happens just wait a minute or 2 then run again. Built into the script is a line of code that creates an exclution in Windows Defender to prevent it from stoping the script.
----------------------------------------------------------------------------------------------------------------------------
The script should do 5 functions:
1. export the passwords from all browsers into a CSV file format
2. If the Company doesn't exist in ITGlue Inform the User to syncronize the Syncro Company to ITGlue
3. Import the CSV into the ITGlue using the API PowershellWrapper
4. Upload the CSV to the Asset on Syncro
5. Cleanup all the new programs and files added from running this script, with the exeption of the TechTools folder

---------------------------------------------------------------------------------------------------------------------------
Even though the script is designed to work with the SyncroMSP it can be adapted to run on any MSP or even straight on Powershell.
To do this you need to add in the global variables $asset_name and $account_name
Next you need to have the computer in question store the programs psget.zip and WebBrowserPassView.exe in the path "C:\TechTools\pw"
And with that it has been adapted to whatever form is needed.
57 changes: 57 additions & 0 deletions Syncro ITGlue Intigration.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Import-Module $env:SyncroModule
##

#Adds an exclusion to Windows Defender for Path C:\Techtools
Add-MpPreference -ExclusionPath "C:\Techtools"

#Disables Windows Defender
$defenderOptions = Get-MpComputerStatus
$defenderOn = $defenderOptions.RealTimeProtectionEnabled

if($defenderOn = $true){
Set-MpPreference -DisableRealtimeMonitoring $true
}

Start-Process -FilePath "C:\TechTools\pw\WebBrowserPassView.exe" -ArgumentList "/LoadPasswordsIE 1 /LoadPasswordsFirefox 1 /LoadPasswordsChrome 1 /LoadPasswordsOpera 1 /LoadPasswordsSafari 1 /scomma C:\TechTools\pw\WebBrowserPassView.csv"
Upload-File -Subdomain "supportit" -FilePath "C:\TechTools\pw\WebBrowserPassView.csv"

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module -Name ITGlueAPI -Force
Import-Module ITGlueAPI -DisableNameChecking
Add-ITGlueAPIKey -Api_Key ITG.64f6ed5ede23d9bfb823590c01d642fb.dFS-UVh2Nq-dlKFy5c8N1lg0CtEUDx2ai1FHOMbScPpoaeKrSGjmVqDE3qCWxEm3

Write-Host "Searching for $account_name in ITGlue"

$results = Get-ITGlueOrganizations -filter_name $account_name

$org_id = $results.data.id
#Add error check for if the orginization exists in Syncro. If not prompt user to syncronize the Syncro user to ITGlue and exit the script.

if($org_id -eq $null){
Write-Host "Company doesn't exist in ITGlue. Go to ITGlue and synchronize the Company from Syncro into ITGlue."
#Exit 2
}
Write-Host "$org_id"

$csv = Import-csv 'C:\TechTools\pw\WebBrowserPassView.csv'
$import_payload = @()
foreach($item in $csv)
{
$import_payload += @{'type' = 'passwords'
'attributes' = @{'url' = $item.URL
'name' = $item.'User Name' + ' ' + $item.URL
'username' = $item.'User Name'
'password' = $item.Password
'notes' = 'Created at: ' + $item.'Created Time' + ' from asset: ' + $asset_name
}}
}
$import_payload
New-ITGluePasswords -organization_id $org_id -data $import_payload

#Delete PW Directory
Remove-Item -Path 'C:\TechTools\pw' -recurse -force

#Enables Windows Defender
if($defenderOn = $true){
Set-MpPreference -DisableRealtimeMonitoring $false
}