SQL Developer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

SQL Developer

L4 Transporter
51 REPLIES 51

L1 Bithead

@Himanshu Pandey​ Could you share me the script for PSM SQL Developer ? my email: [email protected]

L4 Transporter

Hi Guys,

AutoIT3 finder tools is unable to capture the Basic Control Info? Any one experiencing the same issue.

 

Do we have a sample script for SQL Developer.

 

Thanks

PY

L4 Transporter

Hi Guys,

 

I have managed to fixed it and PSM-SQLDeveloper is working for me. Please let me know if you need any help.

 

Thanks

PY

L4 Transporter

Hi Guys,

 

I have managed to fixed it and PSM-SQLDeveloper is working for me. Please let me know if you need any help.

 

Thanks

PY

Hi @PY (Community Member)​ 

 

Can you share your solution?

[email protected]

 

Thanks

Jochen

Hi I am facing so issues working to fix them. Will try and fix ASAP Apologies PY Regards Prem Yadav +61434798145 Get Outlook< aka.ms="" qtex0l=""> for iOS Prem Yadav Security Engineer a9-11 Dickson AvenueArtarmonNSW2064 p1300 865 865 os+61 2 8436 8585 wthemissinglink.com.au ​CAUTION - This message may contain privileged and confidential information intended only for the use of the addressee named above. If you are not the intended recipient of this message you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error please notify The Missing Link immediately. Any views expressed in this message are those of the individual sender and may not necessarily reflect the views of The Missing Link.

@Himanshu Pandey​  Hi HP !!!Do you have SQL Developer script ? Can you provide it to me ?

@Himanshu Pandey​  Hi HP !!!Do you have SQL Developer script ? Can you provide it to me ?

L0 Member

thanks I would love the script as well!

L3 Networker

Hi @Prem Yadav​  are you able to share the working SQL developer script? [email protected]

Hi ,

 

is anyone have any idea about this error..I am getting this error in one of the PSM server.

 

Field_Content_versions_oct20__0682J000009eB5rQAE.png

L3 Networker

Can you please share the AutoIT script for PSM-SQLDeveloper? Please and thank you!

[email protected]

#AutoIt3Wrapper_UseX64=n

Opt("MustDeclareVars", 1)

AutoItSetOption("WinTitleMatchMode", 1) ; Match prefix

;============================================================

;      PSM AutoIt SQL Developer Dispatcher

;============================================================

#include "PSMGenericClientWrapper.au3"

;=======================================

; Consts & Globals

;=======================================

Global Const $DISPATCHER_NAME   = "SQL Developer"

Global Const $CLIENT_EXECUTABLE   = "D:\Program Files (x86)\sqldeveloper\sqldeveloper.exe"

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 $TargetDatabase

Global $ConnectionClientPID = 0

;=======================================

; Code

;=======================================

Exit Main()

;=======================================

; Main

;=======================================

Func Main()

; Init PSM Dispatcher utils wrapper

ToolTip ("Initializing...")

LogWrite("successfully initialized tooltip")

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

; Send PID to PSM as early as possible so recording/monitoring can begin

LogWrite("sending PID to PSM")

if (PSMGenericClient_SendPID($ConnectionClientPID) <> $PSM_ERROR_SUCCESS) Then

Error(PSMGenericClient_PSMGetLastErrorString())

EndIf

; ------------------

;Block all input for the remainder of the SQL Developer application interaction

 LogWrite("Starting Customized Plugin Code...")

Local $hWnd

$hWnd = WinWaitActive("[REGEXPTITLE:(Oracle SQL Developer.*|Confirm Import Preferences|Oracle Usage Tracking)]", "", 10)

 ; Check if the "Confirm Import Preferences" dialog is displayed

 If (WinGetTitle($hWnd) == "Confirm Import Preferences") Then

 ; Get rid of it

 Send("!n")

 ; Wait for the main window again

 $hWnd = WinWaitActive("[REGEXPTITLE:(Oracle SQL Developer.*|Oracle Usage Tracking)]", "", 10)

EndIf

 ; The "Oracle Usage Tracking" dialog may appear after the main window becomes active - we need to wait a bit and check again.

 Sleep(400)

$hWnd = WinWaitActive("[REGEXPTITLE:(Oracle SQL Developer.*|Oracle Usage Tracking)]", "", 10)

 ; Check if the "Oracle Usage Tracking" dialog is displayed

If (WinGetTitle($hWnd) == "Oracle Usage Tracking") Then

; Get rid of it

Send("{SPACE}")

Sleep(400)

Send("{ENTER}")

; Wait for the main window again

$hWnd = WinWaitActive("Oracle SQL Developer", "", 10)

EndIf

;if ($hWnd == 0) Then

;Error("SQL Developer initialization timed out")

;EndIf

;Sleep(1000)

;Send("!w")

;Send("!f")

;Send("{ENTER}")

;Sleep(3000)

;$hWnd = WinWaitActive("Oracle SQL Developer", "", 10)

;if ($hWnd == 0) Then

;Error("SQL Developer initialization timed out")

;EndIf

Send("{ENTER}")

WinWaitActive("Oracle SQL Developer : Start Page")

WinSetState("Oracle SQL Developer", "", @SW_MAXIMIZE)

Send("{ENTER}")

Sleep(100)

MouseClick("left", 15, 117)

$hWnd = WinWaitActive("New / Select Database Connection", "", 5) ; Should not take more than a second to appear

if ($hWnd == 0) Then

Error("Failed to click on connection button")

EndIf

Send("PSM UC [" & $TargetUsername & "@" & $TargetAddress & "]")

Sleep(100)

Send("{TAB}")

Sleep(100)

Send($TargetUsername)

Sleep(100)

Send("{TAB}")

Sleep(1000)

Send($TargetPassword, 1)

Sleep(100)

Send("{TAB}")

Sleep(100)

Send("{TAB}")

Sleep(100)

Send("{TAB}")

Sleep(100)

Send("{TAB}")

Sleep(100)

Send("{TAB}")

Sleep(100)

Send($TargetAddress)

Sleep(100)

Send("{TAB}")

Sleep(100)

Send($TargetPort)

Sleep(100)

Send("{TAB}")

Sleep(100)

Send("{TAB}")

Sleep(100)

Send("{TAB}")

Sleep(100)

Send("{SPACE}")

Sleep(100)

Send("{TAB}")

Sleep(100)

Send($TargetDatabase)

Send("!o")

;-- if we get the overwrite dialog, send 'Yes'

Sleep(500)

If WinActive("Connection Name in use") Then

Send("!y")

EndIf

; ------------------

; Terminate PSM Dispatcher utils wrapper

LogWrite("Terminating Dispatcher Utils Wrapper")

PSMGenericClient_Term()

Return $PSM_ERROR_SUCCESS

EndFunc

;==================================

; Functions

;==================================

; #FUNCTION# =============================================================================

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

;================

Func FetchSessionProperties()

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

$TargetPort =

EndIf

if (PSMGenericClient_GetSessionProperty("Database", $TargetDatabase) <> $PSM_ERROR_SUCCESS) Then

Error(PSMGenericClient_PSMGetLastErrorString())

EndIf

EndFunc

;Func _Quit()

;MsgBox("","Quitting","Something's wrong")

; Exit

;EndFunc

 

Let me know if it works

L3 Networker

@Prem Yadav​ 

I tried attaching the script to the connection component and I am hitting errors. Can you send me screenshots of what your connection component looks like in general? I have it setup like this:

 

PSM-SQLDeveloper

target settings:

Protocol - VNC

ClientApp - dummy.exe

ClientDispatcher - "C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "{PSMComponentsFolder}\PSMsqldeveloperdispatcher.au3" "{PSMComponentsFolder}\"

ClientInvokeType - Dispatcher

 

PSMsqldeveloperdispatcher.au3 is the autoIT script that you sent me

  • 1940 Views
  • 51 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!