- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
07-24-2019 08:58 PM
Hello,
I've an issue while initiate a PSM web connection, an error is displayed as an image below.
In the login page, before typing the username and password process, there is a pop-up window explaining an instruction about the login usage. Therefore, that pop-up must be closed first before input username and password.
This is WebFormFields setting I'm used in this connection component.
btnAccept>(Click)(SearchBy=id)
inputUsername>(Validation)(Searchby=id)
inputUsername>{Username}(SearchBy=id)
inputPassword>{Password}(SearchBy=id)
I wondered that whether I missed some line or having incorrect command. Is there any suggestion for this?
Thanks.
07-24-2019 09:17 PM
I dont think you can handle pop-up window prior to login page via Webapp connector. You need to go for universal custom connector. However you can try with Plugin Generator Utility 1.3.2 once otherwise I'd suggest to go with autoIT based custom connector.
07-25-2019 12:47 AM
Can you post the settings and trying to achieve and target webpage requirement?
07-25-2019 02:35 AM
This case I used PGU 1.3.2 to generate those command out, but it didn't work.
07-25-2019 03:53 AM
Ok seems @Nirmalkumar Dhanaraj is correct, with ootb settings, I doubt you can achieve it and AutoIT based custom connector is your solution.
Btw, can't disable pop-up from application side or on the browser side?
07-25-2019 03:53 AM
Ok seems @Nirmalkumar Dhanaraj is correct, with ootb settings, I doubt you can achieve it and AutoIT based custom connector is your solution.
Btw, can't disable pop-up from application side or on the browser side?
07-25-2019 08:41 PM
Now, I've used AutoIt instead but still got an error
I've enabled chrome in an AppLocker.xml file as well, but still got this error
07-25-2019 09:19 PM
could you please paste your script here?
07-25-2019 09:25 PM
#AutoIt3Wrapper_UseX64=n
Opt("MustDeclareVars", 1)
AutoItSetOption("WinTitleMatchMode", 3) ; EXACT_MATCH!
;============================================================
; PSM AutoIt Dispatcher Skeleton
; ------------------------------
;
; Use this skeleton to create your own
; connection components integrated with the PSM.
; Areas you may want to modify are marked
; with the string "CHANGE_ME".
;
; Created : April 2013
; Cyber-Ark Software Ltd.
;============================================================
#include "PSMGenericClientWrapper.au3"
;=======================================
; Consts & Globals
;=======================================
Global Const $DISPATCHER_NAME = "NutanixDispatcher" ; CHANGE_ME
Global Const $CLIENT_EXECUTABLE = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ; CHANGE_ME
Global Const $ERROR_MESSAGE_TITLE = "PSM " & $DISPATCHER_NAME & " Dispatcher error message"
Global Const $LOG_MESSAGE_PREFIX = $DISPATCHER_NAME & " Dispatcher - "
Global $TargetUsername
Global $TargetPassword
Global $TargetAddress
Global $TargetPort
Global $ConnectionClientPID = 0
;=======================================
; Code
;=======================================
Exit Main()
;=======================================
; Main
;=======================================
Func Main()
; Init PSM Dispatcher utils wrapper
ToolTip ("Initializing...")
if (PSMGenericClient_Init() <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
LogWrite("successfully initialized Dispatcher Utils Wrapper")
; Get the dispatcher parameters
FetchSessionProperties()
LogWrite("mapping local drives")
if (PSMGenericClient_MapTSDrives() <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
LogWrite("starting client application")
ToolTip ("Starting " & $DISPATCHER_NAME & "...")
$ConnectionClientPID = Run($CLIENT_EXECUTABLE)
if ($ConnectionClientPID == 0) Then
Error(StringFormat("Failed to execute process [%s]", $CLIENT_EXECUTABLE, @error))
EndIf
; ------------------
; Handle login here! ; CHANGE_ME
Sleep(1000)
Send($TargerAddress)
Sleep(1500)
Send("{ENTER}")
Sleep(3000)
Send("{TAB}")
Sleep(300)
Send("{Enter}")
Sleep(2000)
Send($TargerUsername)
Sleep(3000)
Send("{Tab}")
Sleep(300)
Send($TargerPassword)
Sleep(3000)
send("{Enter}")
; ------------------
; Send PID to PSM so recording/monitoring can begin
; Notice that until we send the PID, PSM blocks all user input.
LogWrite("sending PID to PSM")
if (PSMGenericClient_SendPID($ConnectionClientPID) <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
; Terminate PSM Dispatcher utils wrapper
LogWrite("Terminating Dispatcher Utils Wrapper")
PSMGenericClient_Term()
Return $PSM_ERROR_SUCCESS
EndFunc
;==================================
; Functions
;==================================
; #FUNCTION# ====================================================================================================================
; Name...........: Error
; Description ...: An exception handler - displays an error message and terminates the dispatcher
; Parameters ....: $ErrorMessage - Error message to display
; $Code - [Optional] Exit error code
; ===============================================================================================================================
Func Error($ErrorMessage, $Code = -1)
; If the dispatcher utils DLL was already initialized, write an error log message and terminate the wrapper
if (PSMGenericClient_IsInitialized()) Then
LogWrite($ErrorMessage, True)
PSMGenericClient_Term()
EndIf
Local $MessageFlags = BitOr(0, 16, 262144) ; 0=OK button, 16=Stop-sign icon, 262144=MsgBox has top-most attribute set
MsgBox($MessageFlags, $ERROR_MESSAGE_TITLE, $ErrorMessage)
; If the connection component was already invoked, terminate it
if ($ConnectionClientPID <> 0) Then
ProcessClose($ConnectionClientPID)
$ConnectionClientPID = 0
EndIf
Exit $Code
EndFunc
; #FUNCTION# ====================================================================================================================
; Name...........: LogWrite
; Description ...: Write a PSMWinSCPDispatcher log message to standard PSM log file
; Parameters ....: $sMessage - [IN] The message to write
; $LogLevel - [Optional] [IN] Defined if the message should be handled as an error message or as a trace messge
; Return values .: $PSM_ERROR_SUCCESS - Success, otherwise error - Use PSMGenericClient_PSMGetLastErrorString for details.
; ===============================================================================================================================
Func LogWrite($sMessage, $LogLevel = $LOG_LEVEL_TRACE)
Return PSMGenericClient_LogWrite($LOG_MESSAGE_PREFIX & $sMessage, $LogLevel)
EndFunc
; #FUNCTION# ====================================================================================================================
; Name...........: PSMGenericClient_GetSessionProperty
; Description ...: Fetches properties required for the session
; Parameters ....: None
; Return values .: None
; ===============================================================================================================================
Func FetchSessionProperties() ; CHANGE_ME
if (PSMGenericClient_GetSessionProperty("Username", $TargetUsername) <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
if (PSMGenericClient_GetSessionProperty("Password", $TargetPassword) <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
if (PSMGenericClient_GetSessionProperty("Address", $TargetAddress) <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
if (PSMGenericClient_GetSessionProperty("Port", $TargetPort) <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
EndFunc
07-25-2019 09:49 PM
Can you please try like below while you are opening your target url? let me know how it goes.. Hope you've done the hardening with enabling webapps .. and your target url is ssl based
Local $ProgramFilesDir = EnvGet('ProgramFiles(x86)') ; for 64bit Win it will return a valid path.
If not $ProgramFilesDir Then $ProgramFilesDir = @ProgramFilesDir ; for 32bit Win this will "repair" the broken return from above.
Local $URL = $ProgramFilesDir &"\Google\Chrome\Application\chrome.exe --start-fullscreen --app=https://" & $Address;
$ConnectionClientPID = Run($URL);
07-25-2019 10:04 PM
@Nirmalkumar Dhanaraj Currently, Chrome is unable to access. At first, after PSM hardening, Chrome works well. But now it is inaccessible. Is there anything else to configure after PSMHardening, excluding change DeveloperToolsDisabled, REG_DWORD,1 into DeveloperToolsDisabled, REG_DWORD,0 in PSMChromeHardening.csv file
07-25-2019 10:26 PM
have your enabled SUPPORT_WEB_APPLICATIONS falg in the psm hardening powershel script? it should modified as bellow :
$SUPPORT_WEB_APPLICATIONS = $true
no need to change anything on the xml files ..
try to access your target portal via chrome from the psm server.. if it is success then you can test your connector
07-25-2019 10:32 PM
have your enabled SUPPORT_WEB_APPLICATIONS falg in the psm hardening powershel script? it should modified as bellow :
$SUPPORT_WEB_APPLICATIONS = $true
no need to change anything on the xml files ..
try to access your target portal via chrome from the psm server.. if it is success then you can test your connector
By the way, why dont you try with IE? instead of Chrome .. in chrome DeveloperTools were disabled for obvious reasons.. if you try with IE it will work straight away .. think about it
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

