2024-02-07 21:45:40 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2025-09-12 10:29:42 +02:00
|
|
|
* IsOracleResponse is the response from the IsOracle function.
|
|
|
|
|
* this is returned by IsOracle function.
|
2024-02-07 21:45:40 +05:30
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const oracle = require('nuclei/oracle');
|
2025-09-12 10:29:42 +02:00
|
|
|
* const client = new oracle.OracleClient();
|
|
|
|
|
* const isOracle = client.IsOracle('acme.com', 1521);
|
2024-02-07 21:45:40 +05:30
|
|
|
* ```
|
|
|
|
|
*/
|
2025-09-12 10:29:42 +02:00
|
|
|
export interface IsOracleResponse {
|
|
|
|
|
IsOracle?: boolean,
|
|
|
|
|
Banner?: string,
|
2024-02-07 21:45:40 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2025-09-12 10:29:42 +02:00
|
|
|
* Client is a client for Oracle database.
|
|
|
|
|
* Internally client uses go-ora driver.
|
2024-02-07 21:45:40 +05:30
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const oracle = require('nuclei/oracle');
|
2025-09-12 10:29:42 +02:00
|
|
|
* const client = new oracle.OracleClient();
|
2024-02-07 21:45:40 +05:30
|
|
|
* ```
|
|
|
|
|
*/
|
2025-09-12 10:29:42 +02:00
|
|
|
export class OracleClient {
|
|
|
|
|
// Constructor of OracleClient
|
|
|
|
|
constructor() {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Connect connects to an Oracle database
|
|
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const oracle = require('nuclei/oracle');
|
|
|
|
|
* const client = new oracle.OracleClient();
|
|
|
|
|
* client.Connect('acme.com', 1521, 'XE', 'user', 'password');
|
|
|
|
|
* ```
|
|
|
|
|
*/
|
|
|
|
|
public Connect(host: string, port: number, serviceName: string, username: string, password: string): boolean | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ConnectWithDSN connects to an Oracle database using a DSN string
|
|
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const oracle = require('nuclei/oracle');
|
|
|
|
|
* const client = new oracle.OracleClient();
|
|
|
|
|
* client.ConnectWithDSN('oracle://user:password@host:port/service', 'SELECT @@version');
|
|
|
|
|
* ```
|
|
|
|
|
*/
|
|
|
|
|
public ConnectWithDSN(dsn: string): boolean | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* IsOracle checks if a host is running an Oracle server
|
|
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const oracle = require('nuclei/oracle');
|
|
|
|
|
* const isOracle = oracle.IsOracle('acme.com', 1521);
|
|
|
|
|
* ```
|
|
|
|
|
*/
|
|
|
|
|
public IsOracle(host: string, port: number): IsOracleResponse | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ExecuteQuery connects to Oracle database using given credentials and executes a query.
|
|
|
|
|
* It returns the results of the query or an error if something goes wrong.
|
|
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const oracle = require('nuclei/oracle');
|
|
|
|
|
* const client = new oracle.OracleClient();
|
|
|
|
|
* const result = client.ExecuteQuery('acme.com', 1521, 'username', 'password', 'XE', 'SELECT * FROM dual');
|
|
|
|
|
* log(to_json(result));
|
|
|
|
|
* ```
|
|
|
|
|
*/
|
|
|
|
|
public ExecuteQuery(host: string, port: number, username: string, password: string, dbName: string, query: string): SQLResult | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ExecuteQueryWithDSN executes a query on an Oracle database using a DSN
|
|
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const oracle = require('nuclei/oracle');
|
|
|
|
|
* const client = new oracle.OracleClient();
|
|
|
|
|
* const result = client.ExecuteQueryWithDSN('oracle://user:password@host:port/service', 'SELECT * FROM dual');
|
|
|
|
|
* log(to_json(result));
|
|
|
|
|
* ```
|
|
|
|
|
*/
|
|
|
|
|
public ExecuteQueryWithDSN(dsn: string, query: string): SQLResult | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2024-02-07 21:45:40 +05:30
|
|
|
}
|
|
|
|
|
|
2025-09-12 10:29:42 +02:00
|
|
|
/**
|
|
|
|
|
* SQLResult Interface
|
|
|
|
|
*/
|
|
|
|
|
export interface SQLResult {
|
|
|
|
|
Count?: number,
|
|
|
|
|
Columns?: string[],
|
|
|
|
|
Rows?: any[],
|
|
|
|
|
}
|