2024-02-07 21:45:40 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2024-03-01 16:38:56 +05:30
|
|
|
* IsRsync checks if a host is running a Rsync server.
|
2024-02-07 21:45:40 +05:30
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const rsync = require('nuclei/rsync');
|
2024-03-01 16:38:56 +05:30
|
|
|
* const isRsync = rsync.IsRsync('acme.com', 873);
|
|
|
|
|
* log(toJSON(isRsync));
|
2024-02-07 21:45:40 +05:30
|
|
|
* ```
|
|
|
|
|
*/
|
2024-03-01 16:38:56 +05:30
|
|
|
export function IsRsync(host: string, port: number): IsRsyncResponse | null {
|
|
|
|
|
return null;
|
2024-02-07 21:45:40 +05:30
|
|
|
}
|
|
|
|
|
|
2025-08-21 20:05:14 +02:00
|
|
|
/**
|
|
|
|
|
* RsyncClient is a client for RSYNC servers.
|
|
|
|
|
* Internally client uses https://github.com/gokrazy/rsync driver.
|
|
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const rsync = require('nuclei/rsync');
|
|
|
|
|
* const client = new rsync.RsyncClient();
|
|
|
|
|
* ```
|
|
|
|
|
*/
|
|
|
|
|
export class RsyncClient {
|
|
|
|
|
|
|
|
|
|
// Constructor of RsyncClient
|
|
|
|
|
constructor() {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Connect establishes a connection to the rsync server with authentication.
|
|
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const rsync = require('nuclei/rsync');
|
|
|
|
|
* const client = new rsync.RsyncClient();
|
|
|
|
|
* const connected = client.Connect('acme.com', 873, 'username', 'password', 'backup');
|
|
|
|
|
* ```
|
|
|
|
|
*/
|
|
|
|
|
public Connect(host: string, port: number, username: string, password: string, module: string): boolean | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ListModules lists available modules on the rsync server.
|
|
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const rsync = require('nuclei/rsync');
|
|
|
|
|
* const client = new rsync.RsyncClient();
|
|
|
|
|
* const modules = client.ListModules('acme.com', 873, 'username', 'password');
|
|
|
|
|
* log(toJSON(modules));
|
|
|
|
|
* ```
|
|
|
|
|
*/
|
|
|
|
|
public ListModules(host: string, port: number, username: string, password: string): string[] | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ListFilesInModule lists files in a specific module on the rsync server.
|
|
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const rsync = require('nuclei/rsync');
|
|
|
|
|
* const client = new rsync.RsyncClient();
|
|
|
|
|
* const files = client.ListFilesInModule('acme.com', 873, 'username', 'password', 'backup');
|
|
|
|
|
* log(toJSON(files));
|
|
|
|
|
* ```
|
|
|
|
|
*/
|
|
|
|
|
public ListFilesInModule(host: string, port: number, username: string, password: string, module: string): string[] | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-02-07 21:45:40 +05:30
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* IsRsyncResponse is the response from the IsRsync function.
|
|
|
|
|
* this is returned by IsRsync function.
|
|
|
|
|
* @example
|
|
|
|
|
* ```javascript
|
|
|
|
|
* const rsync = require('nuclei/rsync');
|
|
|
|
|
* const isRsync = rsync.IsRsync('acme.com', 873);
|
|
|
|
|
* log(toJSON(isRsync));
|
|
|
|
|
* ```
|
|
|
|
|
*/
|
|
|
|
|
export interface IsRsyncResponse {
|
|
|
|
|
|
|
|
|
|
IsRsync?: boolean,
|
|
|
|
|
|
|
|
|
|
Banner?: string,
|
|
|
|
|
}
|
|
|
|
|
|