From 415f2161ef5eb9ff4a902b1b4facf475b8d8da38 Mon Sep 17 00:00:00 2001 From: Tarun Koyalwar Date: Wed, 7 Feb 2024 21:28:12 +0530 Subject: [PATCH] feat: new doc generator using typescript files --- .github/workflows/build-js-proto-docs.yaml | 11 +- .gitignore | 2 + mint.json | 2 - static/docsbuilder/generate.sh | 59 ++ static/docsbuilder/package-lock.json | 223 +++++++ static/docsbuilder/package.json | 35 + static/docsbuilder/tsconfig.json | 16 + .../protocols/javascript/modules/Exports.mdx | 27 + .../protocols/javascript/modules/Home.mdx | 43 ++ .../protocols/javascript/modules/_Sidebar.mdx | 28 + .../javascript/modules/bytes.Buffer.mdx | 268 ++++++++ .../protocols/javascript/modules/bytes.mdx | 175 +---- templates/protocols/javascript/modules/fs.mdx | 184 ++++-- .../protocols/javascript/modules/global.mdx | 130 ---- .../modules/goconsole.GoConsolePrinter.mdx | 95 +++ .../javascript/modules/goconsole.mdx | 87 +-- .../javascript/modules/ikev2.IKEMessage.mdx | 139 ++++ .../javascript/modules/ikev2.IKENonce.mdx | 30 + .../modules/ikev2.IKENotification.mdx | 42 ++ .../protocols/javascript/modules/ikev2.mdx | 127 ++-- .../kerberos.AuthorizationDataEntry.mdx | 32 + .../javascript/modules/kerberos.BitString.mdx | 36 + .../javascript/modules/kerberos.Client.mdx | 193 ++++++ .../javascript/modules/kerberos.Config.mdx | 115 ++++ .../modules/kerberos.EncTicketPart.mdx | 131 ++++ .../modules/kerberos.EncryptedData.mdx | 43 ++ .../modules/kerberos.EncryptionKey.mdx | 32 + .../kerberos.EnumerateUserResponse.mdx | 43 ++ .../modules/kerberos.HostAddress.mdx | 32 + .../modules/kerberos.LibDefaults.mdx | 379 +++++++++++ .../modules/kerberos.PrincipalName.mdx | 32 + .../javascript/modules/kerberos.Realm.mdx | 76 +++ .../javascript/modules/kerberos.TGS.mdx | 43 ++ .../javascript/modules/kerberos.Ticket.mdx | 65 ++ .../modules/kerberos.TransitedEncoding.mdx | 32 + .../protocols/javascript/modules/kerberos.mdx | 183 +++++- .../javascript/modules/ldap.ADObject.mdx | 84 +++ .../javascript/modules/ldap.Client.mdx | 620 ++++++++++++++++++ .../javascript/modules/ldap.Config.mdx | 55 ++ .../javascript/modules/ldap.Entry.mdx | 32 + .../modules/ldap.EntryAttribute.mdx | 43 ++ .../javascript/modules/ldap.Metadata.mdx | 88 +++ .../javascript/modules/ldap.SearchResult.mdx | 32 + .../protocols/javascript/modules/ldap.mdx | 566 ++++++++++++++-- .../javascript/modules/mssql.MSSQLClient.mdx | 141 ++++ .../protocols/javascript/modules/mssql.mdx | 97 +-- .../javascript/modules/mysql.MySQLClient.mdx | 274 ++++++++ .../javascript/modules/mysql.MySQLInfo.mdx | 110 ++++ .../javascript/modules/mysql.MySQLOptions.mdx | 108 +++ .../javascript/modules/mysql.SQLResult.mdx | 32 + .../javascript/modules/mysql.ServiceMySQL.mdx | 43 ++ .../protocols/javascript/modules/mysql.mdx | 135 +--- .../javascript/modules/net.NetConn.mdx | 318 +++++++++ .../protocols/javascript/modules/net.mdx | 250 ++----- .../modules/oracle.IsOracleResponse.mdx | 40 ++ .../modules/oracle.OracleClient.mdx | 67 ++ .../protocols/javascript/modules/oracle.mdx | 45 +- .../modules/pop3.IsPOP3Response.mdx | 41 ++ .../javascript/modules/pop3.Pop3Client.mdx | 67 ++ .../protocols/javascript/modules/pop3.mdx | 45 +- .../javascript/modules/postgres.PGClient.mdx | 177 +++++ .../javascript/modules/postgres.SQLResult.mdx | 32 + .../protocols/javascript/modules/postgres.mdx | 126 +--- .../modules/rdp.CheckRDPAuthResponse.mdx | 41 ++ .../javascript/modules/rdp.IsRDPResponse.mdx | 41 ++ .../javascript/modules/rdp.RDPClient.mdx | 104 +++ .../javascript/modules/rdp.ServiceRDP.mdx | 98 +++ .../protocols/javascript/modules/rdp.mdx | 83 +-- .../protocols/javascript/modules/redis.mdx | 203 +++--- .../modules/rsync.IsRsyncResponse.mdx | 41 ++ .../javascript/modules/rsync.RsyncClient.mdx | 67 ++ .../protocols/javascript/modules/rsync.mdx | 45 +- .../javascript/modules/smb.HeaderLog.mdx | 65 ++ .../javascript/modules/smb.NegotiationLog.mdx | 98 +++ .../modules/smb.SMBCapabilities.mdx | 87 +++ .../javascript/modules/smb.SMBClient.mdx | 181 +++++ .../javascript/modules/smb.SMBLog.mdx | 109 +++ .../javascript/modules/smb.SMBVersions.mdx | 54 ++ .../javascript/modules/smb.ServiceSMB.mdx | 98 +++ .../modules/smb.SessionSetupLog.mdx | 54 ++ .../protocols/javascript/modules/smb.mdx | 139 +--- .../modules/smtp.IsSMTPResponse.mdx | 40 ++ .../javascript/modules/smtp.SMTPClient.mdx | 141 ++++ .../javascript/modules/smtp.SMTPMessage.mdx | 220 +++++++ .../protocols/javascript/modules/smtp.mdx | 221 +------ .../javascript/modules/ssh.Algorithms.mdx | 54 ++ .../modules/ssh.DirectionAlgorithms.mdx | 43 ++ .../javascript/modules/ssh.EndpointId.mdx | 54 ++ .../javascript/modules/ssh.HandshakeLog.mdx | 87 +++ .../javascript/modules/ssh.KexInitMsg.mdx | 155 +++++ .../javascript/modules/ssh.SSHClient.mdx | 243 +++++++ .../protocols/javascript/modules/ssh.mdx | 170 +---- .../protocols/javascript/modules/structs.mdx | 124 ++-- .../modules/telnet.IsTelnetResponse.mdx | 41 ++ .../modules/telnet.TelnetClient.mdx | 67 ++ .../protocols/javascript/modules/telnet.mdx | 45 +- .../javascript/modules/vnc.IsVNCResponse.mdx | 40 ++ .../javascript/modules/vnc.VNCClient.mdx | 69 ++ .../protocols/javascript/modules/vnc.mdx | 45 +- 99 files changed, 8335 insertions(+), 1990 deletions(-) create mode 100755 static/docsbuilder/generate.sh create mode 100644 static/docsbuilder/package-lock.json create mode 100644 static/docsbuilder/package.json create mode 100644 static/docsbuilder/tsconfig.json create mode 100644 templates/protocols/javascript/modules/Exports.mdx create mode 100644 templates/protocols/javascript/modules/Home.mdx create mode 100644 templates/protocols/javascript/modules/_Sidebar.mdx create mode 100644 templates/protocols/javascript/modules/bytes.Buffer.mdx delete mode 100644 templates/protocols/javascript/modules/global.mdx create mode 100644 templates/protocols/javascript/modules/goconsole.GoConsolePrinter.mdx create mode 100644 templates/protocols/javascript/modules/ikev2.IKEMessage.mdx create mode 100644 templates/protocols/javascript/modules/ikev2.IKENonce.mdx create mode 100644 templates/protocols/javascript/modules/ikev2.IKENotification.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.AuthorizationDataEntry.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.BitString.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.Client.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.Config.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.EncTicketPart.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.EncryptedData.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.EncryptionKey.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.EnumerateUserResponse.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.HostAddress.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.LibDefaults.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.PrincipalName.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.Realm.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.TGS.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.Ticket.mdx create mode 100644 templates/protocols/javascript/modules/kerberos.TransitedEncoding.mdx create mode 100644 templates/protocols/javascript/modules/ldap.ADObject.mdx create mode 100644 templates/protocols/javascript/modules/ldap.Client.mdx create mode 100644 templates/protocols/javascript/modules/ldap.Config.mdx create mode 100644 templates/protocols/javascript/modules/ldap.Entry.mdx create mode 100644 templates/protocols/javascript/modules/ldap.EntryAttribute.mdx create mode 100644 templates/protocols/javascript/modules/ldap.Metadata.mdx create mode 100644 templates/protocols/javascript/modules/ldap.SearchResult.mdx create mode 100644 templates/protocols/javascript/modules/mssql.MSSQLClient.mdx create mode 100644 templates/protocols/javascript/modules/mysql.MySQLClient.mdx create mode 100644 templates/protocols/javascript/modules/mysql.MySQLInfo.mdx create mode 100644 templates/protocols/javascript/modules/mysql.MySQLOptions.mdx create mode 100644 templates/protocols/javascript/modules/mysql.SQLResult.mdx create mode 100644 templates/protocols/javascript/modules/mysql.ServiceMySQL.mdx create mode 100644 templates/protocols/javascript/modules/net.NetConn.mdx create mode 100644 templates/protocols/javascript/modules/oracle.IsOracleResponse.mdx create mode 100644 templates/protocols/javascript/modules/oracle.OracleClient.mdx create mode 100644 templates/protocols/javascript/modules/pop3.IsPOP3Response.mdx create mode 100644 templates/protocols/javascript/modules/pop3.Pop3Client.mdx create mode 100644 templates/protocols/javascript/modules/postgres.PGClient.mdx create mode 100644 templates/protocols/javascript/modules/postgres.SQLResult.mdx create mode 100644 templates/protocols/javascript/modules/rdp.CheckRDPAuthResponse.mdx create mode 100644 templates/protocols/javascript/modules/rdp.IsRDPResponse.mdx create mode 100644 templates/protocols/javascript/modules/rdp.RDPClient.mdx create mode 100644 templates/protocols/javascript/modules/rdp.ServiceRDP.mdx create mode 100644 templates/protocols/javascript/modules/rsync.IsRsyncResponse.mdx create mode 100644 templates/protocols/javascript/modules/rsync.RsyncClient.mdx create mode 100644 templates/protocols/javascript/modules/smb.HeaderLog.mdx create mode 100644 templates/protocols/javascript/modules/smb.NegotiationLog.mdx create mode 100644 templates/protocols/javascript/modules/smb.SMBCapabilities.mdx create mode 100644 templates/protocols/javascript/modules/smb.SMBClient.mdx create mode 100644 templates/protocols/javascript/modules/smb.SMBLog.mdx create mode 100644 templates/protocols/javascript/modules/smb.SMBVersions.mdx create mode 100644 templates/protocols/javascript/modules/smb.ServiceSMB.mdx create mode 100644 templates/protocols/javascript/modules/smb.SessionSetupLog.mdx create mode 100644 templates/protocols/javascript/modules/smtp.IsSMTPResponse.mdx create mode 100644 templates/protocols/javascript/modules/smtp.SMTPClient.mdx create mode 100644 templates/protocols/javascript/modules/smtp.SMTPMessage.mdx create mode 100644 templates/protocols/javascript/modules/ssh.Algorithms.mdx create mode 100644 templates/protocols/javascript/modules/ssh.DirectionAlgorithms.mdx create mode 100644 templates/protocols/javascript/modules/ssh.EndpointId.mdx create mode 100644 templates/protocols/javascript/modules/ssh.HandshakeLog.mdx create mode 100644 templates/protocols/javascript/modules/ssh.KexInitMsg.mdx create mode 100644 templates/protocols/javascript/modules/ssh.SSHClient.mdx create mode 100644 templates/protocols/javascript/modules/telnet.IsTelnetResponse.mdx create mode 100644 templates/protocols/javascript/modules/telnet.TelnetClient.mdx create mode 100644 templates/protocols/javascript/modules/vnc.IsVNCResponse.mdx create mode 100644 templates/protocols/javascript/modules/vnc.VNCClient.mdx diff --git a/.github/workflows/build-js-proto-docs.yaml b/.github/workflows/build-js-proto-docs.yaml index fa2464f..671844e 100644 --- a/.github/workflows/build-js-proto-docs.yaml +++ b/.github/workflows/build-js-proto-docs.yaml @@ -1,4 +1,4 @@ -name: Build JS Protocol Docs +name: Build JS Proto Modules Docs on: schedule: @@ -16,11 +16,14 @@ jobs: - name: Setup Node Environment uses: actions/setup-node@v4.0.0 - - name: Install jsdoc-to-markdown - run: npm install -g jsdoc-to-markdown + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.21.x - name: Build JS Proto Docs - run: ./bin/jsdocs.sh + run: ./generate.sh + working-directory: static/docsbuilder - name: Commit results to Github run: | diff --git a/.gitignore b/.gitignore index 4e0f6f6..b33005c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .DS_Store ./nuclei/ +/static/docsbuilder/node_modules/ +/static/docsbuilder/src/ diff --git a/mint.json b/mint.json index 432dc93..5f07086 100644 --- a/mint.json +++ b/mint.json @@ -236,8 +236,6 @@ "pages": [ "templates/protocols/javascript/modules/bytes", "templates/protocols/javascript/modules/fs", - "templates/protocols/javascript/modules/global", - "templates/protocols/javascript/modules/goconsole", "templates/protocols/javascript/modules/ikev2", "templates/protocols/javascript/modules/kerberos", "templates/protocols/javascript/modules/ldap", diff --git a/static/docsbuilder/generate.sh b/static/docsbuilder/generate.sh new file mode 100755 index 0000000..d27a3a1 --- /dev/null +++ b/static/docsbuilder/generate.sh @@ -0,0 +1,59 @@ +printf "\n\e[32m[*] Updating Nuclei Javascript Modules ...\e[0m\n" +# clone nuclei +git clone https://github.com/projectdiscovery/nuclei.git +# branch +export BRANCH=issue-4248-ts-docs + +# change directory +cd nuclei +# checkout to branch +git checkout $BRANCH + +# generate documentation +printf "\n\e[32m[*] Generating Typescript Files ...\e[0m\n" +# generate typescript files +make ts +cd .. # change directory to root + +# copy typescript files +printf "\n\e[32m[*] Copying Typescript Files ...\e[0m\n" +cp -r nuclei/pkg/js/generated/ts src + +# setup typescript project +printf "\n\e[32m[*] Download Typescript project dependencies ...\e[0m\n" +npm install + +# run npm run build +printf "\n\e[32m[*] Building Nuclei Typescript Modules ...\e[0m\n" +npm run build + +# generate docs +printf "\n\e[32m[*] Generate documentation ...\e[0m\n" +npm run docs + + +# post processing (rename .md to .mdx and remove .md in links) +printf "\n\e[32m[*] Post Processing ...\e[0m\n" + +# rename .md to .mdx +cd docs +printf "\n\e[32m[*] Change extension from .md to .mdx ...\e[0m\n" +for file in *.md; do mv "$file" "${file%.md}.mdx"; done + +# remove .md in links +printf "\n\e[32m[*] Remove .md in links ...\e[0m\n" +sed -i '' 's/\.md//g' *.mdx + +# move to appropriate directory +cd ../../.. #project root +mv static/docsbuilder/docs/* templates/protocols/javascript/modules/ + +# remove nuclei +printf "\n\e[32m[*] Cleanup ...\e[0m\n" +rm -rf static/docsbuilder/nuclei +rm -rf static/docsbuilder/docs +rm -rf static/docsbuilder/src +rm -rf static/docsbuilder/node_modules + +# done +printf "\n\e[32m[*] Done\e[0m\n" diff --git a/static/docsbuilder/package-lock.json b/static/docsbuilder/package-lock.json new file mode 100644 index 0000000..558be33 --- /dev/null +++ b/static/docsbuilder/package-lock.json @@ -0,0 +1,223 @@ +{ + "name": "nuclei", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "nuclei", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "typedoc": "^0.25.7", + "typedoc-github-wiki-theme": "^1.1.0", + "typedoc-plugin-markdown": "^3.17.1" + } + }, + "node_modules/ansi-sequence-parser": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", + "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", + "dev": true + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true + }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true + }, + "node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/shiki": { + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", + "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", + "dev": true, + "dependencies": { + "ansi-sequence-parser": "^1.1.0", + "jsonc-parser": "^3.2.0", + "vscode-oniguruma": "^1.7.0", + "vscode-textmate": "^8.0.0" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/typedoc": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.7.tgz", + "integrity": "sha512-m6A6JjQRg39p2ZVRIN3NKXgrN8vzlHhOS+r9ymUYtcUP/TIQPvWSq7YgE5ZjASfv5Vd5BW5xrir6Gm2XNNcOow==", + "dev": true, + "dependencies": { + "lunr": "^2.3.9", + "marked": "^4.3.0", + "minimatch": "^9.0.3", + "shiki": "^0.14.7" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 16" + }, + "peerDependencies": { + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x" + } + }, + "node_modules/typedoc-github-wiki-theme": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/typedoc-github-wiki-theme/-/typedoc-github-wiki-theme-1.1.0.tgz", + "integrity": "sha512-VyFmz8ZV2j/qEsCjD5EtR6FgZsCoy64Zr6SS9kCTcq7zx69Cx4UJBx8Ga/naxqs08TDggE6myIfODY6awwAGcA==", + "dev": true, + "peerDependencies": { + "typedoc": ">=0.24.0", + "typedoc-plugin-markdown": ">=3.15.0" + } + }, + "node_modules/typedoc-plugin-markdown": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.1.tgz", + "integrity": "sha512-QzdU3fj0Kzw2XSdoL15ExLASt2WPqD7FbLeaqwT70+XjKyTshBnUlQA5nNREO1C2P8Uen0CDjsBLMsCQ+zd0lw==", + "dev": true, + "dependencies": { + "handlebars": "^4.7.7" + }, + "peerDependencies": { + "typedoc": ">=0.24.0" + } + }, + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/vscode-oniguruma": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", + "dev": true + }, + "node_modules/vscode-textmate": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", + "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", + "dev": true + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true + } + } +} diff --git a/static/docsbuilder/package.json b/static/docsbuilder/package.json new file mode 100644 index 0000000..b66655f --- /dev/null +++ b/static/docsbuilder/package.json @@ -0,0 +1,35 @@ +{ + "name": "nuclei", + "version": "1.0.0", + "description": "Nuclei Javascript protocol Modules", + "main": "index.js", + "types": "./index.d.ts", + "exports": { + ".": "./index.js" + }, + "scripts": { + "build": "tsc", + "docs": "node_modules/typedoc/bin/typedoc --plugin typedoc-plugin-markdown --plugin typedoc-github-wiki-theme --out docs --publicPath '/templates/protocols/javascript/modules/' src/index.ts" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/projectdiscovery/nuclei-js-types.git" + }, + "keywords": [ + "nuclei", + "js", + "protocol", + "types" + ], + "author": "projectdiscovery", + "license": "MIT", + "bugs": { + "url": "https://github.com/projectdiscovery/nuclei-js-types/issues" + }, + "homepage": "https://github.com/projectdiscovery/nuclei-js-types#readme", + "devDependencies": { + "typedoc": "^0.25.7", + "typedoc-github-wiki-theme": "^1.1.0", + "typedoc-plugin-markdown": "^3.17.1" + } +} diff --git a/static/docsbuilder/tsconfig.json b/static/docsbuilder/tsconfig.json new file mode 100644 index 0000000..2ca3c36 --- /dev/null +++ b/static/docsbuilder/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + // "outDir": "./", // Output directory for all emitted files + // "declaration": true, // Generates corresponding '.d.ts' file + // "declarationDir": "./", // Output directory for declaration files + "rootDir": "./src", // Specifies the root directory of input files + // ... other options like "module", "target", etc. + }, + "include": [ + "src/**/*.ts" // Include all TypeScript files in the src folder + ], + "exclude": [ + "node_modules", // Exclude the node_modules folder + "**/*.test.ts" // Exclude test files + ] + } \ No newline at end of file diff --git a/templates/protocols/javascript/modules/Exports.mdx b/templates/protocols/javascript/modules/Exports.mdx new file mode 100644 index 0000000..42ef4cb --- /dev/null +++ b/templates/protocols/javascript/modules/Exports.mdx @@ -0,0 +1,27 @@ +# nuclei + +## Table of contents + +### Namespaces + +- [bytes](/templates/protocols/javascript/modules/bytes) +- [fs](/templates/protocols/javascript/modules/fs) +- [goconsole](/templates/protocols/javascript/modules/goconsole) +- [ikev2](/templates/protocols/javascript/modules/ikev2) +- [kerberos](/templates/protocols/javascript/modules/kerberos) +- [ldap](/templates/protocols/javascript/modules/ldap) +- [mssql](/templates/protocols/javascript/modules/mssql) +- [mysql](/templates/protocols/javascript/modules/mysql) +- [net](/templates/protocols/javascript/modules/net) +- [oracle](/templates/protocols/javascript/modules/oracle) +- [pop3](/templates/protocols/javascript/modules/pop3) +- [postgres](/templates/protocols/javascript/modules/postgres) +- [rdp](/templates/protocols/javascript/modules/rdp) +- [redis](/templates/protocols/javascript/modules/redis) +- [rsync](/templates/protocols/javascript/modules/rsync) +- [smb](/templates/protocols/javascript/modules/smb) +- [smtp](/templates/protocols/javascript/modules/smtp) +- [ssh](/templates/protocols/javascript/modules/ssh) +- [structs](/templates/protocols/javascript/modules/structs) +- [telnet](/templates/protocols/javascript/modules/telnet) +- [vnc](/templates/protocols/javascript/modules/vnc) diff --git a/templates/protocols/javascript/modules/Home.mdx b/templates/protocols/javascript/modules/Home.mdx new file mode 100644 index 0000000..68c142d --- /dev/null +++ b/templates/protocols/javascript/modules/Home.mdx @@ -0,0 +1,43 @@ +# ProjectDiscovery Documentation + +

+ This is the source code for the ProjectDiscovery documentation located at https://docs.projectdiscovery.io +

+ +

+ + + +

+ +

+ Development • + Deploying • + Join Discord +

+ +--- + +## Development + +1. Checkout this repository +1. Install mintlify with `npm i -g mintlify@latest` +1. Run `mintlify dev` + +## Deploying + +To build the final product, we have a couple of additional steps: + +1. Build the JS Protocol Docs + +- `npm install -g jsdoc-to-markdown` +- `./bin/jsdocs.sh` + +2. Build the PDCP API reference documentation + +- Either download the latest `openapi.yaml` manually or run `./bin/download-api.sh` +- Run `./bin/generate-api.sh` to generate any new API files + +3. Deployment + +After those, Mintlify handles the deployment automatically. diff --git a/templates/protocols/javascript/modules/_Sidebar.mdx b/templates/protocols/javascript/modules/_Sidebar.mdx new file mode 100644 index 0000000..e4011bb --- /dev/null +++ b/templates/protocols/javascript/modules/_Sidebar.mdx @@ -0,0 +1,28 @@ +## nuclei + +- [Home](../wiki/Home) +- [Exports](../wiki/Exports) + +### Namespaces + +- [bytes](../wiki/bytes) +- [fs](../wiki/fs) +- [goconsole](../wiki/goconsole) +- [ikev2](../wiki/ikev2) +- [kerberos](../wiki/kerberos) +- [ldap](../wiki/ldap) +- [mssql](../wiki/mssql) +- [mysql](../wiki/mysql) +- [net](../wiki/net) +- [oracle](../wiki/oracle) +- [pop3](../wiki/pop3) +- [postgres](../wiki/postgres) +- [rdp](../wiki/rdp) +- [redis](../wiki/redis) +- [rsync](../wiki/rsync) +- [smb](../wiki/smb) +- [smtp](../wiki/smtp) +- [ssh](../wiki/ssh) +- [structs](../wiki/structs) +- [telnet](../wiki/telnet) +- [vnc](../wiki/vnc) diff --git a/templates/protocols/javascript/modules/bytes.Buffer.mdx b/templates/protocols/javascript/modules/bytes.Buffer.mdx new file mode 100644 index 0000000..3b887be --- /dev/null +++ b/templates/protocols/javascript/modules/bytes.Buffer.mdx @@ -0,0 +1,268 @@ +# Class: Buffer + +[bytes](/templates/protocols/javascript/modules/bytes).Buffer + +Buffer is a bytes/Uint8Array type in javascript + +**`Example`** + +```javascript +const bytes = require('nuclei/bytes'); +const bytes = new bytes.Buffer(); +``` + +**`Example`** + +```javascript +const bytes = require('nuclei/bytes'); +// optionally it can accept existing byte/Uint8Array as input +const bytes = new bytes.Buffer([1, 2, 3]); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/bytes.Buffer#constructor) + +### Methods + +- [Bytes](/templates/protocols/javascript/modules/bytes.Buffer#bytes) +- [Hex](/templates/protocols/javascript/modules/bytes.Buffer#hex) +- [Hexdump](/templates/protocols/javascript/modules/bytes.Buffer#hexdump) +- [Len](/templates/protocols/javascript/modules/bytes.Buffer#len) +- [Pack](/templates/protocols/javascript/modules/bytes.Buffer#pack) +- [String](/templates/protocols/javascript/modules/bytes.Buffer#string) +- [Write](/templates/protocols/javascript/modules/bytes.Buffer#write) +- [WriteString](/templates/protocols/javascript/modules/bytes.Buffer#writestring) + +## Constructors + +### constructor + +• **new Buffer**(): [`Buffer`](/templates/protocols/javascript/modules/bytes.Buffer) + +#### Returns + +[`Buffer`](/templates/protocols/javascript/modules/bytes.Buffer) + +#### Defined in + +bytes.ts:21 + +## Methods + +### Bytes + +▸ **Bytes**(): `Uint8Array` + +Bytes returns the byte representation of the buffer. + +#### Returns + +`Uint8Array` + +**`Example`** + +```javascript +const bytes = require('nuclei/bytes'); +const buffer = new bytes.Buffer(); +buffer.WriteString('hello'); +log(buffer.Bytes()); +``` + +#### Defined in + +bytes.ts:60 + +___ + +### Hex + +▸ **Hex**(): `string` + +Hex returns the hex representation of the buffer. + +#### Returns + +`string` + +**`Example`** + +```javascript +const bytes = require('nuclei/bytes'); +const buffer = new bytes.Buffer(); +buffer.WriteString('hello'); +log(buffer.Hex()); +``` + +#### Defined in + +bytes.ts:105 + +___ + +### Hexdump + +▸ **Hexdump**(): `string` + +Hexdump returns the hexdump representation of the buffer. + +#### Returns + +`string` + +**`Example`** + +```javascript +const bytes = require('nuclei/bytes'); +const buffer = new bytes.Buffer(); +buffer.WriteString('hello'); +log(buffer.Hexdump()); +``` + +#### Defined in + +bytes.ts:120 + +___ + +### Len + +▸ **Len**(): `number` + +Len returns the length of the buffer. + +#### Returns + +`number` + +**`Example`** + +```javascript +const bytes = require('nuclei/bytes'); +const buffer = new bytes.Buffer(); +buffer.WriteString('hello'); +log(buffer.Len()); +``` + +#### Defined in + +bytes.ts:90 + +___ + +### Pack + +▸ **Pack**(`formatStr`, `msg`): `void` + +Pack uses structs.Pack and packs given data and appends it to the buffer. +it packs the data according to the given format. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `formatStr` | `string` | +| `msg` | `any` | + +#### Returns + +`void` + +**`Example`** + +```javascript +const bytes = require('nuclei/bytes'); +const buffer = new bytes.Buffer(); +buffer.Pack('I', 123); +``` + +#### Defined in + +bytes.ts:135 + +___ + +### String + +▸ **String**(): `string` + +String returns the string representation of the buffer. + +#### Returns + +`string` + +**`Example`** + +```javascript +const bytes = require('nuclei/bytes'); +const buffer = new bytes.Buffer(); +buffer.WriteString('hello'); +log(buffer.String()); +``` + +#### Defined in + +bytes.ts:75 + +___ + +### Write + +▸ **Write**(`data`): [`Buffer`](/templates/protocols/javascript/modules/bytes.Buffer) + +Write appends the given data to the buffer. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `Uint8Array` | + +#### Returns + +[`Buffer`](/templates/protocols/javascript/modules/bytes.Buffer) + +**`Example`** + +```javascript +const bytes = require('nuclei/bytes'); +const buffer = new bytes.Buffer(); +buffer.Write([1, 2, 3]); +``` + +#### Defined in + +bytes.ts:31 + +___ + +### WriteString + +▸ **WriteString**(`data`): [`Buffer`](/templates/protocols/javascript/modules/bytes.Buffer) + +WriteString appends the given string data to the buffer. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `string` | + +#### Returns + +[`Buffer`](/templates/protocols/javascript/modules/bytes.Buffer) + +**`Example`** + +```javascript +const bytes = require('nuclei/bytes'); +const buffer = new bytes.Buffer(); +buffer.WriteString('hello'); +``` + +#### Defined in + +bytes.ts:45 diff --git a/templates/protocols/javascript/modules/bytes.mdx b/templates/protocols/javascript/modules/bytes.mdx index c609230..b23ae6b 100644 --- a/templates/protocols/javascript/modules/bytes.mdx +++ b/templates/protocols/javascript/modules/bytes.mdx @@ -1,174 +1,7 @@ - +# Namespace: bytes -## bytes +## Table of contents -* [bytes](#module_bytes) - * [`Buffer`](#module_bytes..Buffer) - * [`.Bytes()`](#module_bytes..Buffer+Bytes) ⇒ Uint8Array - * [`.Hex()`](#module_bytes..Buffer+Hex) ⇒ string - * [`.Hexdump()`](#module_bytes..Buffer+Hexdump) ⇒ string - * [`.Len()`](#module_bytes..Buffer+Len) ⇒ number - * [`.Pack(formatStr, msg)`](#module_bytes..Buffer+Pack) ⇒ Buffer - * [`.String()`](#module_bytes..Buffer+String) ⇒ string - * [`.Write(data)`](#module_bytes..Buffer+Write) ⇒ Buffer - * [`.WriteString(data)`](#module_bytes..Buffer+WriteString) ⇒ Buffer - * [`NewBuffer(call)`](#module_bytes..NewBuffer) ⇒ Buffer +### Classes - - -### (bytes).Buffer -Buffer is a minimal buffer implementation to store and retrieve data - -**Kind**: inner class of [bytes](#module_bytes) - -* [`Buffer`](#module_bytes..Buffer) - * [`.Bytes()`](#module_bytes..Buffer+Bytes) ⇒ Uint8Array - * [`.Hex()`](#module_bytes..Buffer+Hex) ⇒ string - * [`.Hexdump()`](#module_bytes..Buffer+Hexdump) ⇒ string - * [`.Len()`](#module_bytes..Buffer+Len) ⇒ number - * [`.Pack(formatStr, msg)`](#module_bytes..Buffer+Pack) ⇒ Buffer - * [`.String()`](#module_bytes..Buffer+String) ⇒ string - * [`.Write(data)`](#module_bytes..Buffer+Write) ⇒ Buffer - * [`.WriteString(data)`](#module_bytes..Buffer+WriteString) ⇒ Buffer - - - -#### buffer.Bytes() ⇒ Uint8Array -Bytes returns the byte slice of the buffer. - -**Kind**: instance method of [Buffer](#module_bytes..Buffer) -**Returns**: Uint8Array - - The byte slice of the buffer. -**Example** -```js -let m = require('nuclei/bytes'); -let b = m.Buffer(); -let bytes = b.Bytes(); -``` - - -#### buffer.Hex() ⇒ string -Hex returns the hex representation of the buffer. - -**Kind**: instance method of [Buffer](#module_bytes..Buffer) -**Returns**: string - - The hex representation of the buffer. -**Example** -```js -let m = require('nuclei/bytes'); -let b = m.Buffer(); -let hex = b.Hex(); -``` - - -#### buffer.Hexdump() ⇒ string -Hexdump returns the hexdump representation of the buffer. - -**Kind**: instance method of [Buffer](#module_bytes..Buffer) -**Returns**: string - - The hexdump representation of the buffer. -**Example** -```js -let m = require('nuclei/bytes'); -let b = m.Buffer(); -let hexdump = b.Hexdump(); -``` - - -#### buffer.Len() ⇒ number -Len returns the length of the buffer. - -**Kind**: instance method of [Buffer](#module_bytes..Buffer) -**Returns**: number - - The length of the buffer. -**Example** -```js -let m = require('nuclei/bytes'); -let b = m.Buffer(); -let length = b.Len(); -``` - - -#### buffer.Pack(formatStr, msg) ⇒ Buffer -Pack uses structs.Pack and packs given data and appends it to the buffer. It packs the data according to the given format. - -**Kind**: instance method of [Buffer](#module_bytes..Buffer) -**Returns**: Buffer - - The buffer after packing the data. -**Throws**: - -- error - The error encountered during packing. - - -| Param | Type | Description | -| --- | --- | --- | -| formatStr | string | The format string to pack the data. | -| msg | string | The message to pack. | - -**Example** -```js -let m = require('nuclei/bytes'); -let b = m.Buffer(); -b.Pack('format', 'message'); -``` - - -#### buffer.String() ⇒ string -String returns the string representation of the buffer. - -**Kind**: instance method of [Buffer](#module_bytes..Buffer) -**Returns**: string - - The string representation of the buffer. -**Example** -```js -let m = require('nuclei/bytes'); -let b = m.Buffer(); -let str = b.String(); -``` - - -#### buffer.Write(data) ⇒ Buffer -Write appends a byte slice to the buffer. - -**Kind**: instance method of [Buffer](#module_bytes..Buffer) -**Returns**: Buffer - - The buffer after appending the byte slice. - -| Param | Type | Description | -| --- | --- | --- | -| data | Uint8Array | The byte slice to append to the buffer. | - -**Example** -```js -let m = require('nuclei/bytes'); -let b = m.Buffer(); -b.Write(new Uint8Array([1, 2, 3])); -``` - - -#### buffer.WriteString(data) ⇒ Buffer -WriteString appends a string to the buffer. - -**Kind**: instance method of [Buffer](#module_bytes..Buffer) -**Returns**: Buffer - - The buffer after appending the string. - -| Param | Type | Description | -| --- | --- | --- | -| data | string | The string to append to the buffer. | - -**Example** -```js -let m = require('nuclei/bytes'); -let b = m.Buffer(); -b.WriteString('data'); -``` - - -### (bytes).NewBuffer(call) ⇒ Buffer -NewBuffer creates a new buffer from a byte slice. - -**Kind**: inner method of [bytes](#module_bytes) -**Returns**: Buffer - - The new buffer created from the byte slice. - -| Param | Type | Description | -| --- | --- | --- | -| call | Uint8Array | The byte slice to create the buffer from. | - -**Example** -```js -let m = require('nuclei/bytes'); -let buffer = m.NewBuffer(new Uint8Array([1, 2, 3])); -``` +- [Buffer](/templates/protocols/javascript/modules/bytes.Buffer) diff --git a/templates/protocols/javascript/modules/fs.mdx b/templates/protocols/javascript/modules/fs.mdx index db58eda..332302e 100644 --- a/templates/protocols/javascript/modules/fs.mdx +++ b/templates/protocols/javascript/modules/fs.mdx @@ -1,95 +1,153 @@ - +# Namespace: fs -## fs +## Table of contents -* [fs](#module_fs) - * [`ListDir(path, itemType)`](#module_fs..ListDir) ⇒ Array.<string> - * [`ReadFile(path)`](#module_fs..ReadFile) ⇒ Uint8Array - * [`ReadFileAsString(path)`](#module_fs..ReadFileAsString) ⇒ string - * [`ReadFilesFromDir(dir)`](#module_fs..ReadFilesFromDir) ⇒ Array.<string> +### Functions - +- [ListDir](/templates/protocols/javascript/modules/fs#listdir) +- [ReadFile](/templates/protocols/javascript/modules/fs#readfile) +- [ReadFileAsString](/templates/protocols/javascript/modules/fs#readfileasstring) +- [ReadFilesFromDir](/templates/protocols/javascript/modules/fs#readfilesfromdir) -### (fs).ListDir(path, itemType) ⇒ Array.<string> -ListDir lists all files and directories within a path depending on the itemType provided. itemType can be any one of ['file','dir','all'] +## Functions -**Kind**: inner method of [fs](#module_fs) -**Returns**: Array.<string> - - The list of files and directories. -**Throws**: +### ListDir -- error - The error encountered during listing. +▸ **ListDir**(`path`, `itemType`): `string`[] \| ``null`` +ListDir lists itemType values within a directory +depending on the itemType provided +itemType can be any one of ['file','dir',”] -| Param | Type | Description | -| --- | --- | --- | -| path | string | The path to list files and directories from. | -| itemType | string | The type of items to list. Can be 'file', 'dir', or 'all'. | +#### Parameters -**Example** -```js -let m = require('nuclei/fs'); -let items = m.ListDir('/tmp', 'all'); +| Name | Type | +| :------ | :------ | +| `path` | `string` | +| `itemType` | `string` | + +#### Returns + +`string`[] \| ``null`` + +**`Example`** + +```javascript +const fs = require('nuclei/fs'); +// this will only return files in /tmp directory +const files = fs.ListDir('/tmp', 'file'); ``` - -### (fs).ReadFile(path) ⇒ Uint8Array +**`Example`** + +```javascript +const fs = require('nuclei/fs'); +// this will only return directories in /tmp directory +const dirs = fs.ListDir('/tmp', 'dir'); +``` + +**`Example`** + +```javascript +const fs = require('nuclei/fs'); +// when no itemType is provided, it will return both files and directories +const items = fs.ListDir('/tmp'); +``` + +#### Defined in + +fs.ts:26 + +___ + +### ReadFile + +▸ **ReadFile**(`path`): `Uint8Array` \| ``null`` + ReadFile reads file contents within permitted paths +and returns content as byte array -**Kind**: inner method of [fs](#module_fs) -**Returns**: Uint8Array - - The contents of the file. -**Throws**: +#### Parameters -- error - The error encountered during reading. +| Name | Type | +| :------ | :------ | +| `path` | `string` | +#### Returns -| Param | Type | Description | -| --- | --- | --- | -| path | string | The path to the file to read. | +`Uint8Array` \| ``null`` -**Example** -```js -let m = require('nuclei/fs'); -let content = m.ReadFile('/tmp/myfile.txt'); +**`Example`** + +```javascript +const fs = require('nuclei/fs'); +// here permitted directories are $HOME/nuclei-templates/* +const content = fs.ReadFile('helpers/usernames.txt'); ``` - -### (fs).ReadFileAsString(path) ⇒ string -ReadFileAsString reads file contents within permitted paths and returns content as string +#### Defined in + +fs.ts:42 + +___ + +### ReadFileAsString -**Kind**: inner method of [fs](#module_fs) -**Returns**: string - - The contents of the file as a string. -**Throws**: +▸ **ReadFileAsString**(`path`): `string` \| ``null`` -- error - The error encountered during reading. +ReadFileAsString reads file contents within permitted paths +and returns content as string +#### Parameters -| Param | Type | Description | -| --- | --- | --- | -| path | string | The path to the file to read. | +| Name | Type | +| :------ | :------ | +| `path` | `string` | -**Example** -```js -let m = require('nuclei/fs'); -let content = m.ReadFileAsString('/tmp/myfile.txt'); +#### Returns + +`string` \| ``null`` + +**`Example`** + +```javascript +const fs = require('nuclei/fs'); +// here permitted directories are $HOME/nuclei-templates/* +const content = fs.ReadFileAsString('helpers/usernames.txt'); ``` - -### (fs).ReadFilesFromDir(dir) ⇒ Array.<string> -ReadFilesFromDir reads all files from a directory and returns a array with file contents of all files +#### Defined in + +fs.ts:58 -**Kind**: inner method of [fs](#module_fs) -**Returns**: Array.<string> - - The contents of all files in the directory. -**Throws**: +___ -- error - The error encountered during reading. +### ReadFilesFromDir +▸ **ReadFilesFromDir**(`dir`): `string`[] \| ``null`` -| Param | Type | Description | -| --- | --- | --- | -| dir | string | The directory to read files from. | +ReadFilesFromDir reads all files from a directory +and returns a string array with file contents of all files -**Example** -```js -let m = require('nuclei/fs'); -let contentArray = m.ReadFilesFromDir('/tmp'); +#### Parameters + +| Name | Type | +| :------ | :------ | +| `dir` | `string` | + +#### Returns + +`string`[] \| ``null`` + +**`Example`** + +```javascript +const fs = require('nuclei/fs'); +// here permitted directories are $HOME/nuclei-templates/* +const contents = fs.ReadFilesFromDir('helpers/ssh-keys'); +log(contents); ``` + +#### Defined in + +fs.ts:75 diff --git a/templates/protocols/javascript/modules/global.mdx b/templates/protocols/javascript/modules/global.mdx deleted file mode 100644 index eba4b53..0000000 --- a/templates/protocols/javascript/modules/global.mdx +++ /dev/null @@ -1,130 +0,0 @@ -## Functions - -
-
Rand(n)Uint8Array
-

Rand returns a random byte slice of length n

-
RandInt()number
-

RandInt returns a random int

-
log(msg)
-

log prints given input to stdout with [JS] prefix for debugging purposes

-
getNetworkPort(port, defaultPort)string
-

getNetworkPort registers defaultPort and returns defaultPort if it is a colliding port with other protocols

-
isPortOpen(host, port, [timeout])boolean
-

isPortOpen checks if given port is open on host. timeout is optional and defaults to 5 seconds

-
ToBytes(...args)Uint8Array
-

ToBytes converts given input to byte slice

-
ToString(...args)string
-

ToString converts given input to string

-
- - - -## Rand(n) ⇒ Uint8Array -Rand returns a random byte slice of length n - -**Kind**: global function -**Returns**: Uint8Array - - The random byte slice. - -| Param | Type | Description | -| --- | --- | --- | -| n | number | The length of the byte slice. | - -**Example** -```js -let randbytes = Rand(10); // returns a random byte slice of length 10 -``` - - -## RandInt() ⇒ number -RandInt returns a random int - -**Kind**: global function -**Returns**: number - - The random integer. -**Example** -```js -let myint = m.RandInt(); // returns a random int -``` - - -## log(msg) -log prints given input to stdout with [JS] prefix for debugging purposes - -**Kind**: global function - -| Param | Type | Description | -| --- | --- | --- | -| msg | string \| Object | The message to print. | - -**Example** -```js -log("Hello World!"); -log({"Hello": "World!"}); -``` - - -## getNetworkPort(port, defaultPort) ⇒ string -getNetworkPort registers defaultPort and returns defaultPort if it is a colliding port with other protocols - -**Kind**: global function -**Returns**: string - - The default port if the given port is colliding, otherwise the given port. - -| Param | Type | Description | -| --- | --- | --- | -| port | string | The port to check. | -| defaultPort | string | The default port to return if the given port is colliding. | - -**Example** -```js -let port = getNetworkPort(Port, "2843"); // 2843 is default port (even if 80,443 etc is given in Port from input) -``` - - -## isPortOpen(host, port, [timeout]) ⇒ boolean -isPortOpen checks if given port is open on host. timeout is optional and defaults to 5 seconds - -**Kind**: global function -**Returns**: boolean - - True if the port is open, false otherwise. - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| host | string | | The host to check. | -| port | string | | The port to check. | -| [timeout] | number | 5 | The timeout in seconds. | - -**Example** -```js -let open = isPortOpen("localhost", "80"); // returns true if port 80 is open on localhost -let open = isPortOpen("localhost", "80", 10); // returns true if port 80 is open on localhost within 10 seconds -``` - - -## ToBytes(...args) ⇒ Uint8Array -ToBytes converts given input to byte slice - -**Kind**: global function -**Returns**: Uint8Array - - The byte slice. - -| Param | Type | Description | -| --- | --- | --- | -| ...args | any | The input to convert. | - -**Example** -```js -let mybytes = ToBytes("Hello World!"); // returns byte slice of "Hello World!" -``` - - -## ToString(...args) ⇒ string -ToString converts given input to string - -**Kind**: global function -**Returns**: string - - The string. - -| Param | Type | Description | -| --- | --- | --- | -| ...args | any | The input to convert. | - -**Example** -```js -let mystr = ToString([0x48, 0x65, 0x6c, 0x6c, 0x6f]); // returns "Hello" -``` diff --git a/templates/protocols/javascript/modules/goconsole.GoConsolePrinter.mdx b/templates/protocols/javascript/modules/goconsole.GoConsolePrinter.mdx new file mode 100644 index 0000000..36426f0 --- /dev/null +++ b/templates/protocols/javascript/modules/goconsole.GoConsolePrinter.mdx @@ -0,0 +1,95 @@ +# Class: GoConsolePrinter + +[goconsole](/templates/protocols/javascript/modules/goconsole).GoConsolePrinter + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/goconsole.GoConsolePrinter#constructor) + +### Methods + +- [Error](/templates/protocols/javascript/modules/goconsole.GoConsolePrinter#error) +- [Log](/templates/protocols/javascript/modules/goconsole.GoConsolePrinter#log) +- [Warn](/templates/protocols/javascript/modules/goconsole.GoConsolePrinter#warn) + +## Constructors + +### constructor + +• **new GoConsolePrinter**(): [`GoConsolePrinter`](/templates/protocols/javascript/modules/goconsole.GoConsolePrinter) + +#### Returns + +[`GoConsolePrinter`](/templates/protocols/javascript/modules/goconsole.GoConsolePrinter) + +#### Defined in + +goconsole.ts:18 + +## Methods + +### Error + +▸ **Error**(`msg`): `void` + +Error Method + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `msg` | `string` | + +#### Returns + +`void` + +#### Defined in + +goconsole.ts:38 + +___ + +### Log + +▸ **Log**(`msg`): `void` + +Log Method + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `msg` | `string` | + +#### Returns + +`void` + +#### Defined in + +goconsole.ts:22 + +___ + +### Warn + +▸ **Warn**(`msg`): `void` + +Warn Method + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `msg` | `string` | + +#### Returns + +`void` + +#### Defined in + +goconsole.ts:30 diff --git a/templates/protocols/javascript/modules/goconsole.mdx b/templates/protocols/javascript/modules/goconsole.mdx index 55878bd..1168e0c 100644 --- a/templates/protocols/javascript/modules/goconsole.mdx +++ b/templates/protocols/javascript/modules/goconsole.mdx @@ -1,86 +1,27 @@ - +# Namespace: goconsole -## goconsole +## Table of contents -* [goconsole](#module_goconsole) - * [`GoConsolePrinter`](#module_goconsole..GoConsolePrinter) - * [`.Error(msg)`](#module_goconsole..GoConsolePrinter+Error) - * [`.Log(msg)`](#module_goconsole..GoConsolePrinter+Log) - * [`.Warn(msg)`](#module_goconsole..GoConsolePrinter+Warn) - * [`NewGoConsolePrinter()`](#module_goconsole..NewGoConsolePrinter) ⇒ GoConsolePrinter +### Classes - +- [GoConsolePrinter](/templates/protocols/javascript/modules/goconsole.GoConsolePrinter) -### (goconsole).GoConsolePrinter -GoConsolePrinter is a console printer for nuclei using gologger +### Functions -**Kind**: inner class of [goconsole](#module_goconsole) +- [NewGoConsolePrinter](/templates/protocols/javascript/modules/goconsole#newgoconsoleprinter) -* [`GoConsolePrinter`](#module_goconsole..GoConsolePrinter) - * [`.Error(msg)`](#module_goconsole..GoConsolePrinter+Error) - * [`.Log(msg)`](#module_goconsole..GoConsolePrinter+Log) - * [`.Warn(msg)`](#module_goconsole..GoConsolePrinter+Warn) +## Functions - +### NewGoConsolePrinter -#### goConsolePrinter.Error(msg) -Error logs an error message +▸ **NewGoConsolePrinter**(): [`GoConsolePrinter`](/templates/protocols/javascript/modules/goconsole.GoConsolePrinter) -**Kind**: instance method of [GoConsolePrinter](#module_goconsole..GoConsolePrinter) +NewGoConsolePrinter Function -| Param | Type | Description | -| --- | --- | --- | -| msg | string | The message to log. | +#### Returns -**Example** -```js -let m = require('nuclei/goconsole'); -let c = m.GoConsolePrinter(); -c.Error('This is an error message'); -``` - +[`GoConsolePrinter`](/templates/protocols/javascript/modules/goconsole.GoConsolePrinter) -#### goConsolePrinter.Log(msg) -Log logs a message +#### Defined in -**Kind**: instance method of [GoConsolePrinter](#module_goconsole..GoConsolePrinter) - -| Param | Type | Description | -| --- | --- | --- | -| msg | string | The message to log. | - -**Example** -```js -let m = require('nuclei/goconsole'); -let c = m.GoConsolePrinter(); -c.Log('This is a log message'); -``` - - -#### goConsolePrinter.Warn(msg) -Warn logs a warning message - -**Kind**: instance method of [GoConsolePrinter](#module_goconsole..GoConsolePrinter) - -| Param | Type | Description | -| --- | --- | --- | -| msg | string | The message to log. | - -**Example** -```js -let m = require('nuclei/goconsole'); -let c = m.GoConsolePrinter(); -c.Warn('This is a warning message'); -``` - - -### (goconsole).NewGoConsolePrinter() ⇒ GoConsolePrinter -NewGoConsolePrinter creates a new instance of GoConsolePrinter - -**Kind**: inner method of [goconsole](#module_goconsole) -**Returns**: GoConsolePrinter - - The new instance of GoConsolePrinter. -**Example** -```js -let m = require('nuclei/goconsole'); -let printer = m.NewGoConsolePrinter(); -``` +goconsole.ts:6 diff --git a/templates/protocols/javascript/modules/ikev2.IKEMessage.mdx b/templates/protocols/javascript/modules/ikev2.IKEMessage.mdx new file mode 100644 index 0000000..9fd84c9 --- /dev/null +++ b/templates/protocols/javascript/modules/ikev2.IKEMessage.mdx @@ -0,0 +1,139 @@ +# Class: IKEMessage + +[ikev2](/templates/protocols/javascript/modules/ikev2).IKEMessage + +IKEMessage is the IKEv2 message +IKEv2 implements a limited subset of IKEv2 Protocol, specifically +the IKE_NOTIFY and IKE_NONCE payloads and the IKE_SA_INIT exchange. + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/ikev2.IKEMessage#constructor) + +### Properties + +- [ExchangeType](/templates/protocols/javascript/modules/ikev2.IKEMessage#exchangetype) +- [Flags](/templates/protocols/javascript/modules/ikev2.IKEMessage#flags) +- [InitiatorSPI](/templates/protocols/javascript/modules/ikev2.IKEMessage#initiatorspi) +- [Version](/templates/protocols/javascript/modules/ikev2.IKEMessage#version) + +### Methods + +- [AppendPayload](/templates/protocols/javascript/modules/ikev2.IKEMessage#appendpayload) +- [Encode](/templates/protocols/javascript/modules/ikev2.IKEMessage#encode) + +## Constructors + +### constructor + +• **new IKEMessage**(): [`IKEMessage`](/templates/protocols/javascript/modules/ikev2.IKEMessage) + +#### Returns + +[`IKEMessage`](/templates/protocols/javascript/modules/ikev2.IKEMessage) + +#### Defined in + +ikev2.ts:52 + +## Properties + +### ExchangeType + +• `Optional` **ExchangeType**: `number` + +#### Defined in + +ikev2.ts:44 + +___ + +### Flags + +• `Optional` **Flags**: `number` + +#### Defined in + +ikev2.ts:48 + +___ + +### InitiatorSPI + +• `Optional` **InitiatorSPI**: `number` + +#### Defined in + +ikev2.ts:36 + +___ + +### Version + +• `Optional` **Version**: `number` + +#### Defined in + +ikev2.ts:40 + +## Methods + +### AppendPayload + +▸ **AppendPayload**(`payload`): `void` + +AppendPayload appends a payload to the IKE message +payload can be any of the payloads like IKENotification, IKENonce, etc. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `payload` | `any` | + +#### Returns + +`void` + +**`Example`** + +```javascript +const ikev2 = require('nuclei/ikev2'); +const message = new ikev2.IKEMessage(); +const nonce = new ikev2.IKENonce(); +nonce.NonceData = [1, 2, 3]; +message.AppendPayload(nonce); +``` + +#### Defined in + +ikev2.ts:65 + +___ + +### Encode + +▸ **Encode**(): `Uint8Array` + +Encode encodes the final IKE message + +#### Returns + +`Uint8Array` + +**`Example`** + +```javascript +const ikev2 = require('nuclei/ikev2'); +const message = new ikev2.IKEMessage(); +const nonce = new ikev2.IKENonce(); +nonce.NonceData = [1, 2, 3]; +message.AppendPayload(nonce); +log(message.Encode()); +``` + +#### Defined in + +ikev2.ts:82 diff --git a/templates/protocols/javascript/modules/ikev2.IKENonce.mdx b/templates/protocols/javascript/modules/ikev2.IKENonce.mdx new file mode 100644 index 0000000..291156a --- /dev/null +++ b/templates/protocols/javascript/modules/ikev2.IKENonce.mdx @@ -0,0 +1,30 @@ +# Interface: IKENonce + +[ikev2](/templates/protocols/javascript/modules/ikev2).IKENonce + +IKENonce is the IKEv2 Nonce payload +this implements the IKEPayload interface + +**`Example`** + +```javascript +const ikev2 = require('nuclei/ikev2'); +const nonce = new ikev2.IKENonce(); +nonce.NonceData = [1, 2, 3]; +``` + +## Table of contents + +### Properties + +- [NonceData](/templates/protocols/javascript/modules/ikev2.IKENonce#noncedata) + +## Properties + +### NonceData + +• `Optional` **NonceData**: `Uint8Array` + +#### Defined in + +ikev2.ts:103 diff --git a/templates/protocols/javascript/modules/ikev2.IKENotification.mdx b/templates/protocols/javascript/modules/ikev2.IKENotification.mdx new file mode 100644 index 0000000..d2c99f2 --- /dev/null +++ b/templates/protocols/javascript/modules/ikev2.IKENotification.mdx @@ -0,0 +1,42 @@ +# Interface: IKENotification + +[ikev2](/templates/protocols/javascript/modules/ikev2).IKENotification + +IKEv2Notify is the IKEv2 Notification payload +this implements the IKEPayload interface + +**`Example`** + +```javascript +const ikev2 = require('nuclei/ikev2'); +const notify = new ikev2.IKENotification(); +notify.NotifyMessageType = ikev2.IKE_NOTIFY_NO_PROPOSAL_CHOSEN; +notify.NotificationData = [1, 2, 3]; +``` + +## Table of contents + +### Properties + +- [NotificationData](/templates/protocols/javascript/modules/ikev2.IKENotification#notificationdata) +- [NotifyMessageType](/templates/protocols/javascript/modules/ikev2.IKENotification#notifymessagetype) + +## Properties + +### NotificationData + +• `Optional` **NotificationData**: `Uint8Array` + +#### Defined in + +ikev2.ts:123 + +___ + +### NotifyMessageType + +• `Optional` **NotifyMessageType**: `number` + +#### Defined in + +ikev2.ts:121 diff --git a/templates/protocols/javascript/modules/ikev2.mdx b/templates/protocols/javascript/modules/ikev2.mdx index 08d8665..64695f1 100644 --- a/templates/protocols/javascript/modules/ikev2.mdx +++ b/templates/protocols/javascript/modules/ikev2.mdx @@ -1,54 +1,103 @@ - +# Namespace: ikev2 -## ikev2 +## Table of contents -* [ikev2](#module_ikev2) - * [`IKEMessage`](#module_ikev2..IKEMessage) - * [`.AppendPayload(payload)`](#module_ikev2..IKEMessage+AppendPayload) - * [`.Encode()`](#module_ikev2..IKEMessage+Encode) ⇒ Uint8Array +### Classes - +- [IKEMessage](/templates/protocols/javascript/modules/ikev2.IKEMessage) -### (ikev2).IKEMessage -IKEMessage is the IKEv2 message. IKEv2 implements a limited subset of IKEv2 Protocol, specifically the IKE_NOTIFY and IKE_NONCE payloads and the IKE_SA_INIT exchange. +### Interfaces -**Kind**: inner class of [ikev2](#module_ikev2) +- [IKENonce](/templates/protocols/javascript/modules/ikev2.IKENonce) +- [IKENotification](/templates/protocols/javascript/modules/ikev2.IKENotification) -* [`IKEMessage`](#module_ikev2..IKEMessage) - * [`.AppendPayload(payload)`](#module_ikev2..IKEMessage+AppendPayload) - * [`.Encode()`](#module_ikev2..IKEMessage+Encode) ⇒ Uint8Array +### Variables - +- [IKE\_EXCHANGE\_AUTH](/templates/protocols/javascript/modules/ikev2#ike_exchange_auth) +- [IKE\_EXCHANGE\_CREATE\_CHILD\_SA](/templates/protocols/javascript/modules/ikev2#ike_exchange_create_child_sa) +- [IKE\_EXCHANGE\_INFORMATIONAL](/templates/protocols/javascript/modules/ikev2#ike_exchange_informational) +- [IKE\_EXCHANGE\_SA\_INIT](/templates/protocols/javascript/modules/ikev2#ike_exchange_sa_init) +- [IKE\_FLAGS\_InitiatorBitCheck](/templates/protocols/javascript/modules/ikev2#ike_flags_initiatorbitcheck) +- [IKE\_NOTIFY\_NO\_PROPOSAL\_CHOSEN](/templates/protocols/javascript/modules/ikev2#ike_notify_no_proposal_chosen) +- [IKE\_NOTIFY\_USE\_TRANSPORT\_MODE](/templates/protocols/javascript/modules/ikev2#ike_notify_use_transport_mode) +- [IKE\_VERSION\_2](/templates/protocols/javascript/modules/ikev2#ike_version_2) -#### ikeMessage.AppendPayload(payload) -AppendPayload appends a payload to the IKE message +## Variables -**Kind**: instance method of [IKEMessage](#module_ikev2..IKEMessage) +### IKE\_EXCHANGE\_AUTH -| Param | Type | Description | -| --- | --- | --- | -| payload | object | The payload to append to the IKE message. | +• `Const` **IKE\_EXCHANGE\_AUTH**: ``35`` -**Example** -```js -let m = require('nuclei/ikev2'); -let ike = m.IKEMessage(); -ike.AppendPayload({data: 'test'}); -``` - +#### Defined in -#### ikeMessage.Encode() ⇒ Uint8Array -Encode encodes the final IKE message +ikev2.ts:4 -**Kind**: instance method of [IKEMessage](#module_ikev2..IKEMessage) -**Returns**: Uint8Array - - The encoded IKE message. -**Throws**: +___ -- error - The error encountered during encoding. +### IKE\_EXCHANGE\_CREATE\_CHILD\_SA -**Example** -```js -let m = require('nuclei/ikev2'); -let ike = m.IKEMessage(); -let encoded = ike.Encode(); -``` +• `Const` **IKE\_EXCHANGE\_CREATE\_CHILD\_SA**: ``36`` + +#### Defined in + +ikev2.ts:7 + +___ + +### IKE\_EXCHANGE\_INFORMATIONAL + +• `Const` **IKE\_EXCHANGE\_INFORMATIONAL**: ``37`` + +#### Defined in + +ikev2.ts:10 + +___ + +### IKE\_EXCHANGE\_SA\_INIT + +• `Const` **IKE\_EXCHANGE\_SA\_INIT**: ``34`` + +#### Defined in + +ikev2.ts:13 + +___ + +### IKE\_FLAGS\_InitiatorBitCheck + +• `Const` **IKE\_FLAGS\_InitiatorBitCheck**: ``8`` + +#### Defined in + +ikev2.ts:16 + +___ + +### IKE\_NOTIFY\_NO\_PROPOSAL\_CHOSEN + +• `Const` **IKE\_NOTIFY\_NO\_PROPOSAL\_CHOSEN**: ``14`` + +#### Defined in + +ikev2.ts:19 + +___ + +### IKE\_NOTIFY\_USE\_TRANSPORT\_MODE + +• `Const` **IKE\_NOTIFY\_USE\_TRANSPORT\_MODE**: ``16391`` + +#### Defined in + +ikev2.ts:22 + +___ + +### IKE\_VERSION\_2 + +• `Const` **IKE\_VERSION\_2**: ``32`` + +#### Defined in + +ikev2.ts:25 diff --git a/templates/protocols/javascript/modules/kerberos.AuthorizationDataEntry.mdx b/templates/protocols/javascript/modules/kerberos.AuthorizationDataEntry.mdx new file mode 100644 index 0000000..15c4d8e --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.AuthorizationDataEntry.mdx @@ -0,0 +1,32 @@ +# Interface: AuthorizationDataEntry + +[kerberos](/templates/protocols/javascript/modules/kerberos).AuthorizationDataEntry + +AuthorizationDataEntry Interface + +## Table of contents + +### Properties + +- [ADData](/templates/protocols/javascript/modules/kerberos.AuthorizationDataEntry#addata) +- [ADType](/templates/protocols/javascript/modules/kerberos.AuthorizationDataEntry#adtype) + +## Properties + +### ADData + +• `Optional` **ADData**: `Uint8Array` + +#### Defined in + +kerberos.ts:191 + +___ + +### ADType + +• `Optional` **ADType**: `number` + +#### Defined in + +kerberos.ts:193 diff --git a/templates/protocols/javascript/modules/kerberos.BitString.mdx b/templates/protocols/javascript/modules/kerberos.BitString.mdx new file mode 100644 index 0000000..3a2aa3d --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.BitString.mdx @@ -0,0 +1,36 @@ +# Interface: BitString + +[kerberos](/templates/protocols/javascript/modules/kerberos).BitString + +BitString Interface + +## Table of contents + +### Properties + +- [BitLength](/templates/protocols/javascript/modules/kerberos.BitString#bitlength) +- [Bytes](/templates/protocols/javascript/modules/kerberos.BitString#bytes) + +## Properties + +### BitLength + +• `Optional` **BitLength**: `number` + +#### Defined in + +kerberos.ts:203 + +kerberos.ts:217 + +___ + +### Bytes + +• `Optional` **Bytes**: `Uint8Array` + +#### Defined in + +kerberos.ts:205 + +kerberos.ts:215 diff --git a/templates/protocols/javascript/modules/kerberos.Client.mdx b/templates/protocols/javascript/modules/kerberos.Client.mdx new file mode 100644 index 0000000..e9de87c --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.Client.mdx @@ -0,0 +1,193 @@ +# Class: Client + +[kerberos](/templates/protocols/javascript/modules/kerberos).Client + +Known Issues: +Hardcoded timeout in gokrb5 library +TGT / Session Handling not exposed +Client is kerberos client + +**`Example`** + +```javascript +const kerberos = require('nuclei/kerberos'); +// if controller is empty a dns lookup for default kdc server will be performed +const client = new kerberos.Client('acme.com', 'kdc.acme.com'); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/kerberos.Client#constructor) + +### Properties + +- [Krb5Config](/templates/protocols/javascript/modules/kerberos.Client#krb5config) +- [Realm](/templates/protocols/javascript/modules/kerberos.Client#realm) +- [controller](/templates/protocols/javascript/modules/kerberos.Client#controller) +- [domain](/templates/protocols/javascript/modules/kerberos.Client#domain) + +### Methods + +- [EnumerateUser](/templates/protocols/javascript/modules/kerberos.Client#enumerateuser) +- [GetServiceTicket](/templates/protocols/javascript/modules/kerberos.Client#getserviceticket) +- [SetConfig](/templates/protocols/javascript/modules/kerberos.Client#setconfig) + +## Constructors + +### constructor + +• **new Client**(`domain`, `controller?`): [`Client`](/templates/protocols/javascript/modules/kerberos.Client) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `domain` | `string` | +| `controller?` | `string` | + +#### Returns + +[`Client`](/templates/protocols/javascript/modules/kerberos.Client) + +#### Defined in + +kerberos.ts:90 + +## Properties + +### Krb5Config + +• `Optional` **Krb5Config**: [`Config`](/templates/protocols/javascript/modules/kerberos.Config) + +#### Defined in + +kerberos.ts:82 + +___ + +### Realm + +• `Optional` **Realm**: `string` + +#### Defined in + +kerberos.ts:86 + +___ + +### controller + +• `Optional` **controller**: `string` + +#### Defined in + +kerberos.ts:90 + +___ + +### domain + +• **domain**: `string` + +#### Defined in + +kerberos.ts:90 + +## Methods + +### EnumerateUser + +▸ **EnumerateUser**(`username`): [`EnumerateUserResponse`](/templates/protocols/javascript/modules/kerberos.EnumerateUserResponse) + +EnumerateUser and attempt to get AS-REP hash by disabling PA-FX-FAST + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `username` | `string` | + +#### Returns + +[`EnumerateUserResponse`](/templates/protocols/javascript/modules/kerberos.EnumerateUserResponse) + +**`Example`** + +```javascript +const kerberos = require('nuclei/kerberos'); +const client = new kerberos.Client('acme.com', 'kdc.acme.com'); +const resp = client.EnumerateUser('pdtm'); +log(resp); +``` + +#### Defined in + +kerberos.ts:122 + +___ + +### GetServiceTicket + +▸ **GetServiceTicket**(`User`): [`TGS`](/templates/protocols/javascript/modules/kerberos.TGS) + +GetServiceTicket returns a TGS for a given user, password and SPN + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `User` | `string` | + +#### Returns + +[`TGS`](/templates/protocols/javascript/modules/kerberos.TGS) + +**`Example`** + +```javascript +const kerberos = require('nuclei/kerberos'); +const client = new kerberos.Client('acme.com', 'kdc.acme.com'); +const resp = client.GetServiceTicket('pdtm', 'password', 'HOST/CLIENT1'); +log(resp); +``` + +#### Defined in + +kerberos.ts:137 + +___ + +### SetConfig + +▸ **SetConfig**(`cfg`): `void` + +SetConfig sets additional config for the kerberos client +Note: as of now ip and timeout overrides are only supported +in EnumerateUser due to fastdialer but can be extended to other methods currently + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cfg` | [`Config`](/templates/protocols/javascript/modules/kerberos.Config) | + +#### Returns + +`void` + +**`Example`** + +```javascript +const kerberos = require('nuclei/kerberos'); +const client = new kerberos.Client('acme.com', 'kdc.acme.com'); +const cfg = new kerberos.Config(); +cfg.SetIPAddress('192.168.100.22'); +cfg.SetTimeout(5); +client.SetConfig(cfg); +``` + +#### Defined in + +kerberos.ts:107 diff --git a/templates/protocols/javascript/modules/kerberos.Config.mdx b/templates/protocols/javascript/modules/kerberos.Config.mdx new file mode 100644 index 0000000..d2b7ffc --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.Config.mdx @@ -0,0 +1,115 @@ +# Class: Config + +[kerberos](/templates/protocols/javascript/modules/kerberos).Config + +Config is extra configuration for the kerberos client + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/kerberos.Config#constructor) + +### Properties + +- [LibDefaults](/templates/protocols/javascript/modules/kerberos.Config#libdefaults) +- [Realms](/templates/protocols/javascript/modules/kerberos.Config#realms) + +### Methods + +- [SetIPAddress](/templates/protocols/javascript/modules/kerberos.Config#setipaddress) +- [SetTimeout](/templates/protocols/javascript/modules/kerberos.Config#settimeout) + +## Constructors + +### constructor + +• **new Config**(): [`Config`](/templates/protocols/javascript/modules/kerberos.Config) + +#### Returns + +[`Config`](/templates/protocols/javascript/modules/kerberos.Config) + +#### Defined in + +kerberos.ts:153 + +## Properties + +### LibDefaults + +• `Optional` **LibDefaults**: [`LibDefaults`](/templates/protocols/javascript/modules/kerberos.LibDefaults) + +#### Defined in + +kerberos.ts:227 + +___ + +### Realms + +• `Optional` **Realms**: [`Realm`](/templates/protocols/javascript/modules/kerberos.Realm) + +#### Defined in + +kerberos.ts:229 + +## Methods + +### SetIPAddress + +▸ **SetIPAddress**(`ip`): [`Config`](/templates/protocols/javascript/modules/kerberos.Config) + +SetIPAddress sets the IP address for the kerberos client + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ip` | `string` | + +#### Returns + +[`Config`](/templates/protocols/javascript/modules/kerberos.Config) + +**`Example`** + +```javascript +const kerberos = require('nuclei/kerberos'); +const cfg = new kerberos.Config(); +cfg.SetIPAddress('10.10.10.1'); +``` + +#### Defined in + +kerberos.ts:163 + +___ + +### SetTimeout + +▸ **SetTimeout**(`timeout`): [`Config`](/templates/protocols/javascript/modules/kerberos.Config) + +SetTimeout sets the RW timeout for the kerberos client + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `timeout` | `number` | + +#### Returns + +[`Config`](/templates/protocols/javascript/modules/kerberos.Config) + +**`Example`** + +```javascript +const kerberos = require('nuclei/kerberos'); +const cfg = new kerberos.Config(); +cfg.SetTimeout(5); +``` + +#### Defined in + +kerberos.ts:177 diff --git a/templates/protocols/javascript/modules/kerberos.EncTicketPart.mdx b/templates/protocols/javascript/modules/kerberos.EncTicketPart.mdx new file mode 100644 index 0000000..8ff2cba --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.EncTicketPart.mdx @@ -0,0 +1,131 @@ +# Interface: EncTicketPart + +[kerberos](/templates/protocols/javascript/modules/kerberos).EncTicketPart + +EncTicketPart Interface + +## Table of contents + +### Properties + +- [AuthTime](/templates/protocols/javascript/modules/kerberos.EncTicketPart#authtime) +- [AuthorizationData](/templates/protocols/javascript/modules/kerberos.EncTicketPart#authorizationdata) +- [CAddr](/templates/protocols/javascript/modules/kerberos.EncTicketPart#caddr) +- [CName](/templates/protocols/javascript/modules/kerberos.EncTicketPart#cname) +- [CRealm](/templates/protocols/javascript/modules/kerberos.EncTicketPart#crealm) +- [EndTime](/templates/protocols/javascript/modules/kerberos.EncTicketPart#endtime) +- [Flags](/templates/protocols/javascript/modules/kerberos.EncTicketPart#flags) +- [Key](/templates/protocols/javascript/modules/kerberos.EncTicketPart#key) +- [RenewTill](/templates/protocols/javascript/modules/kerberos.EncTicketPart#renewtill) +- [StartTime](/templates/protocols/javascript/modules/kerberos.EncTicketPart#starttime) +- [Transited](/templates/protocols/javascript/modules/kerberos.EncTicketPart#transited) + +## Properties + +### AuthTime + +• `Optional` **AuthTime**: `Date` + +#### Defined in + +kerberos.ts:241 + +___ + +### AuthorizationData + +• `Optional` **AuthorizationData**: [`AuthorizationDataEntry`](/templates/protocols/javascript/modules/kerberos.AuthorizationDataEntry) + +#### Defined in + +kerberos.ts:249 + +___ + +### CAddr + +• `Optional` **CAddr**: [`HostAddress`](/templates/protocols/javascript/modules/kerberos.HostAddress) + +#### Defined in + +kerberos.ts:259 + +___ + +### CName + +• `Optional` **CName**: [`PrincipalName`](/templates/protocols/javascript/modules/kerberos.PrincipalName) + +#### Defined in + +kerberos.ts:255 + +___ + +### CRealm + +• `Optional` **CRealm**: `string` + +#### Defined in + +kerberos.ts:239 + +___ + +### EndTime + +• `Optional` **EndTime**: `Date` + +#### Defined in + +kerberos.ts:245 + +___ + +### Flags + +• `Optional` **Flags**: [`BitString`](/templates/protocols/javascript/modules/kerberos.BitString) + +#### Defined in + +kerberos.ts:251 + +___ + +### Key + +• `Optional` **Key**: [`EncryptionKey`](/templates/protocols/javascript/modules/kerberos.EncryptionKey) + +#### Defined in + +kerberos.ts:253 + +___ + +### RenewTill + +• `Optional` **RenewTill**: `Date` + +#### Defined in + +kerberos.ts:247 + +___ + +### StartTime + +• `Optional` **StartTime**: `Date` + +#### Defined in + +kerberos.ts:243 + +___ + +### Transited + +• `Optional` **Transited**: [`TransitedEncoding`](/templates/protocols/javascript/modules/kerberos.TransitedEncoding) + +#### Defined in + +kerberos.ts:257 diff --git a/templates/protocols/javascript/modules/kerberos.EncryptedData.mdx b/templates/protocols/javascript/modules/kerberos.EncryptedData.mdx new file mode 100644 index 0000000..0794ade --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.EncryptedData.mdx @@ -0,0 +1,43 @@ +# Interface: EncryptedData + +[kerberos](/templates/protocols/javascript/modules/kerberos).EncryptedData + +EncryptedData Interface + +## Table of contents + +### Properties + +- [Cipher](/templates/protocols/javascript/modules/kerberos.EncryptedData#cipher) +- [EType](/templates/protocols/javascript/modules/kerberos.EncryptedData#etype) +- [KVNO](/templates/protocols/javascript/modules/kerberos.EncryptedData#kvno) + +## Properties + +### Cipher + +• `Optional` **Cipher**: `Uint8Array` + +#### Defined in + +kerberos.ts:273 + +___ + +### EType + +• `Optional` **EType**: `number` + +#### Defined in + +kerberos.ts:269 + +___ + +### KVNO + +• `Optional` **KVNO**: `number` + +#### Defined in + +kerberos.ts:271 diff --git a/templates/protocols/javascript/modules/kerberos.EncryptionKey.mdx b/templates/protocols/javascript/modules/kerberos.EncryptionKey.mdx new file mode 100644 index 0000000..33a60fb --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.EncryptionKey.mdx @@ -0,0 +1,32 @@ +# Interface: EncryptionKey + +[kerberos](/templates/protocols/javascript/modules/kerberos).EncryptionKey + +EncryptionKey Interface + +## Table of contents + +### Properties + +- [KeyType](/templates/protocols/javascript/modules/kerberos.EncryptionKey#keytype) +- [KeyValue](/templates/protocols/javascript/modules/kerberos.EncryptionKey#keyvalue) + +## Properties + +### KeyType + +• `Optional` **KeyType**: `number` + +#### Defined in + +kerberos.ts:283 + +___ + +### KeyValue + +• `Optional` **KeyValue**: `Uint8Array` + +#### Defined in + +kerberos.ts:285 diff --git a/templates/protocols/javascript/modules/kerberos.EnumerateUserResponse.mdx b/templates/protocols/javascript/modules/kerberos.EnumerateUserResponse.mdx new file mode 100644 index 0000000..4387937 --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.EnumerateUserResponse.mdx @@ -0,0 +1,43 @@ +# Interface: EnumerateUserResponse + +[kerberos](/templates/protocols/javascript/modules/kerberos).EnumerateUserResponse + +EnumerateUserResponse is the response from EnumerateUser + +## Table of contents + +### Properties + +- [ASREPHash](/templates/protocols/javascript/modules/kerberos.EnumerateUserResponse#asrephash) +- [Error](/templates/protocols/javascript/modules/kerberos.EnumerateUserResponse#error) +- [Valid](/templates/protocols/javascript/modules/kerberos.EnumerateUserResponse#valid) + +## Properties + +### ASREPHash + +• `Optional` **ASREPHash**: `string` + +#### Defined in + +kerberos.ts:297 + +___ + +### Error + +• `Optional` **Error**: `string` + +#### Defined in + +kerberos.ts:299 + +___ + +### Valid + +• `Optional` **Valid**: `boolean` + +#### Defined in + +kerberos.ts:295 diff --git a/templates/protocols/javascript/modules/kerberos.HostAddress.mdx b/templates/protocols/javascript/modules/kerberos.HostAddress.mdx new file mode 100644 index 0000000..85814e2 --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.HostAddress.mdx @@ -0,0 +1,32 @@ +# Interface: HostAddress + +[kerberos](/templates/protocols/javascript/modules/kerberos).HostAddress + +HostAddress Interface + +## Table of contents + +### Properties + +- [AddrType](/templates/protocols/javascript/modules/kerberos.HostAddress#addrtype) +- [Address](/templates/protocols/javascript/modules/kerberos.HostAddress#address) + +## Properties + +### AddrType + +• `Optional` **AddrType**: `number` + +#### Defined in + +kerberos.ts:311 + +___ + +### Address + +• `Optional` **Address**: `Uint8Array` + +#### Defined in + +kerberos.ts:309 diff --git a/templates/protocols/javascript/modules/kerberos.LibDefaults.mdx b/templates/protocols/javascript/modules/kerberos.LibDefaults.mdx new file mode 100644 index 0000000..1693cb6 --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.LibDefaults.mdx @@ -0,0 +1,379 @@ +# Interface: LibDefaults + +[kerberos](/templates/protocols/javascript/modules/kerberos).LibDefaults + +LibDefaults Interface + +## Table of contents + +### Properties + +- [AllowWeakCrypto](/templates/protocols/javascript/modules/kerberos.LibDefaults#allowweakcrypto) +- [CCacheType](/templates/protocols/javascript/modules/kerberos.LibDefaults#ccachetype) +- [Canonicalize](/templates/protocols/javascript/modules/kerberos.LibDefaults#canonicalize) +- [Clockskew](/templates/protocols/javascript/modules/kerberos.LibDefaults#clockskew) +- [DNSCanonicalizeHostname](/templates/protocols/javascript/modules/kerberos.LibDefaults#dnscanonicalizehostname) +- [DNSLookupKDC](/templates/protocols/javascript/modules/kerberos.LibDefaults#dnslookupkdc) +- [DNSLookupRealm](/templates/protocols/javascript/modules/kerberos.LibDefaults#dnslookuprealm) +- [DefaultClientKeytabName](/templates/protocols/javascript/modules/kerberos.LibDefaults#defaultclientkeytabname) +- [DefaultKeytabName](/templates/protocols/javascript/modules/kerberos.LibDefaults#defaultkeytabname) +- [DefaultRealm](/templates/protocols/javascript/modules/kerberos.LibDefaults#defaultrealm) +- [DefaultTGSEnctypeIDs](/templates/protocols/javascript/modules/kerberos.LibDefaults#defaulttgsenctypeids) +- [DefaultTGSEnctypes](/templates/protocols/javascript/modules/kerberos.LibDefaults#defaulttgsenctypes) +- [DefaultTktEnctypeIDs](/templates/protocols/javascript/modules/kerberos.LibDefaults#defaulttktenctypeids) +- [DefaultTktEnctypes](/templates/protocols/javascript/modules/kerberos.LibDefaults#defaulttktenctypes) +- [ExtraAddresses](/templates/protocols/javascript/modules/kerberos.LibDefaults#extraaddresses) +- [Forwardable](/templates/protocols/javascript/modules/kerberos.LibDefaults#forwardable) +- [IgnoreAcceptorHostname](/templates/protocols/javascript/modules/kerberos.LibDefaults#ignoreacceptorhostname) +- [K5LoginAuthoritative](/templates/protocols/javascript/modules/kerberos.LibDefaults#k5loginauthoritative) +- [K5LoginDirectory](/templates/protocols/javascript/modules/kerberos.LibDefaults#k5logindirectory) +- [KDCDefaultOptions](/templates/protocols/javascript/modules/kerberos.LibDefaults#kdcdefaultoptions) +- [KDCTimeSync](/templates/protocols/javascript/modules/kerberos.LibDefaults#kdctimesync) +- [NoAddresses](/templates/protocols/javascript/modules/kerberos.LibDefaults#noaddresses) +- [PermittedEnctypeIDs](/templates/protocols/javascript/modules/kerberos.LibDefaults#permittedenctypeids) +- [PermittedEnctypes](/templates/protocols/javascript/modules/kerberos.LibDefaults#permittedenctypes) +- [PreferredPreauthTypes](/templates/protocols/javascript/modules/kerberos.LibDefaults#preferredpreauthtypes) +- [Proxiable](/templates/protocols/javascript/modules/kerberos.LibDefaults#proxiable) +- [RDNS](/templates/protocols/javascript/modules/kerberos.LibDefaults#rdns) +- [RealmTryDomains](/templates/protocols/javascript/modules/kerberos.LibDefaults#realmtrydomains) +- [RenewLifetime](/templates/protocols/javascript/modules/kerberos.LibDefaults#renewlifetime) +- [SafeChecksumType](/templates/protocols/javascript/modules/kerberos.LibDefaults#safechecksumtype) +- [TicketLifetime](/templates/protocols/javascript/modules/kerberos.LibDefaults#ticketlifetime) +- [UDPPreferenceLimit](/templates/protocols/javascript/modules/kerberos.LibDefaults#udppreferencelimit) +- [VerifyAPReqNofail](/templates/protocols/javascript/modules/kerberos.LibDefaults#verifyapreqnofail) + +## Properties + +### AllowWeakCrypto + +• `Optional` **AllowWeakCrypto**: `boolean` + +#### Defined in + +kerberos.ts:357 + +___ + +### CCacheType + +• `Optional` **CCacheType**: `number` + +#### Defined in + +kerberos.ts:381 + +___ + +### Canonicalize + +• `Optional` **Canonicalize**: `boolean` + +#### Defined in + +kerberos.ts:325 + +___ + +### Clockskew + +• `Optional` **Clockskew**: `number` + +time in nanoseconds + +#### Defined in + +kerberos.ts:387 + +___ + +### DNSCanonicalizeHostname + +• `Optional` **DNSCanonicalizeHostname**: `boolean` + +#### Defined in + +kerberos.ts:353 + +___ + +### DNSLookupKDC + +• `Optional` **DNSLookupKDC**: `boolean` + +#### Defined in + +kerberos.ts:375 + +___ + +### DNSLookupRealm + +• `Optional` **DNSLookupRealm**: `boolean` + +#### Defined in + +kerberos.ts:377 + +___ + +### DefaultClientKeytabName + +• `Optional` **DefaultClientKeytabName**: `string` + +#### Defined in + +kerberos.ts:327 + +___ + +### DefaultKeytabName + +• `Optional` **DefaultKeytabName**: `string` + +#### Defined in + +kerberos.ts:329 + +___ + +### DefaultRealm + +• `Optional` **DefaultRealm**: `string` + +#### Defined in + +kerberos.ts:351 + +___ + +### DefaultTGSEnctypeIDs + +• `Optional` **DefaultTGSEnctypeIDs**: `number`[] + +#### Defined in + +kerberos.ts:367 + +___ + +### DefaultTGSEnctypes + +• `Optional` **DefaultTGSEnctypes**: `string`[] + +#### Defined in + +kerberos.ts:373 + +___ + +### DefaultTktEnctypeIDs + +• `Optional` **DefaultTktEnctypeIDs**: `number`[] + +#### Defined in + +kerberos.ts:391 + +___ + +### DefaultTktEnctypes + +• `Optional` **DefaultTktEnctypes**: `string`[] + +#### Defined in + +kerberos.ts:389 + +___ + +### ExtraAddresses + +• `Optional` **ExtraAddresses**: `Uint8Array` + +#### Defined in + +kerberos.ts:369 + +___ + +### Forwardable + +• `Optional` **Forwardable**: `boolean` + +#### Defined in + +kerberos.ts:359 + +___ + +### IgnoreAcceptorHostname + +• `Optional` **IgnoreAcceptorHostname**: `boolean` + +#### Defined in + +kerberos.ts:393 + +___ + +### K5LoginAuthoritative + +• `Optional` **K5LoginAuthoritative**: `boolean` + +#### Defined in + +kerberos.ts:361 + +___ + +### K5LoginDirectory + +• `Optional` **K5LoginDirectory**: `string` + +#### Defined in + +kerberos.ts:339 + +___ + +### KDCDefaultOptions + +• `Optional` **KDCDefaultOptions**: [`BitString`](/templates/protocols/javascript/modules/kerberos.BitString) + +#### Defined in + +kerberos.ts:397 + +___ + +### KDCTimeSync + +• `Optional` **KDCTimeSync**: `number` + +#### Defined in + +kerberos.ts:363 + +___ + +### NoAddresses + +• `Optional` **NoAddresses**: `boolean` + +#### Defined in + +kerberos.ts:355 + +___ + +### PermittedEnctypeIDs + +• `Optional` **PermittedEnctypeIDs**: `number`[] + +#### Defined in + +kerberos.ts:379 + +___ + +### PermittedEnctypes + +• `Optional` **PermittedEnctypes**: `string`[] + +#### Defined in + +kerberos.ts:365 + +___ + +### PreferredPreauthTypes + +• `Optional` **PreferredPreauthTypes**: `number`[] + +#### Defined in + +kerberos.ts:341 + +___ + +### Proxiable + +• `Optional` **Proxiable**: `boolean` + +#### Defined in + +kerberos.ts:331 + +___ + +### RDNS + +• `Optional` **RDNS**: `boolean` + +#### Defined in + +kerberos.ts:321 + +___ + +### RealmTryDomains + +• `Optional` **RealmTryDomains**: `number` + +#### Defined in + +kerberos.ts:323 + +___ + +### RenewLifetime + +• `Optional` **RenewLifetime**: `number` + +time in nanoseconds + +#### Defined in + +kerberos.ts:337 + +___ + +### SafeChecksumType + +• `Optional` **SafeChecksumType**: `number` + +#### Defined in + +kerberos.ts:371 + +___ + +### TicketLifetime + +• `Optional` **TicketLifetime**: `number` + +time in nanoseconds + +#### Defined in + +kerberos.ts:347 + +___ + +### UDPPreferenceLimit + +• `Optional` **UDPPreferenceLimit**: `number` + +#### Defined in + +kerberos.ts:349 + +___ + +### VerifyAPReqNofail + +• `Optional` **VerifyAPReqNofail**: `boolean` + +#### Defined in + +kerberos.ts:395 diff --git a/templates/protocols/javascript/modules/kerberos.PrincipalName.mdx b/templates/protocols/javascript/modules/kerberos.PrincipalName.mdx new file mode 100644 index 0000000..2b11adc --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.PrincipalName.mdx @@ -0,0 +1,32 @@ +# Interface: PrincipalName + +[kerberos](/templates/protocols/javascript/modules/kerberos).PrincipalName + +PrincipalName Interface + +## Table of contents + +### Properties + +- [NameString](/templates/protocols/javascript/modules/kerberos.PrincipalName#namestring) +- [NameType](/templates/protocols/javascript/modules/kerberos.PrincipalName#nametype) + +## Properties + +### NameString + +• `Optional` **NameString**: `string`[] + +#### Defined in + +kerberos.ts:409 + +___ + +### NameType + +• `Optional` **NameType**: `number` + +#### Defined in + +kerberos.ts:407 diff --git a/templates/protocols/javascript/modules/kerberos.Realm.mdx b/templates/protocols/javascript/modules/kerberos.Realm.mdx new file mode 100644 index 0000000..f997ae2 --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.Realm.mdx @@ -0,0 +1,76 @@ +# Interface: Realm + +[kerberos](/templates/protocols/javascript/modules/kerberos).Realm + +Realm Interface + +## Table of contents + +### Properties + +- [AdminServer](/templates/protocols/javascript/modules/kerberos.Realm#adminserver) +- [DefaultDomain](/templates/protocols/javascript/modules/kerberos.Realm#defaultdomain) +- [KDC](/templates/protocols/javascript/modules/kerberos.Realm#kdc) +- [KPasswdServer](/templates/protocols/javascript/modules/kerberos.Realm#kpasswdserver) +- [MasterKDC](/templates/protocols/javascript/modules/kerberos.Realm#masterkdc) +- [Realm](/templates/protocols/javascript/modules/kerberos.Realm#realm) + +## Properties + +### AdminServer + +• `Optional` **AdminServer**: `string`[] + +#### Defined in + +kerberos.ts:425 + +___ + +### DefaultDomain + +• `Optional` **DefaultDomain**: `string` + +#### Defined in + +kerberos.ts:427 + +___ + +### KDC + +• `Optional` **KDC**: `string`[] + +#### Defined in + +kerberos.ts:429 + +___ + +### KPasswdServer + +• `Optional` **KPasswdServer**: `string`[] + +#### Defined in + +kerberos.ts:419 + +___ + +### MasterKDC + +• `Optional` **MasterKDC**: `string`[] + +#### Defined in + +kerberos.ts:421 + +___ + +### Realm + +• `Optional` **Realm**: `string` + +#### Defined in + +kerberos.ts:423 diff --git a/templates/protocols/javascript/modules/kerberos.TGS.mdx b/templates/protocols/javascript/modules/kerberos.TGS.mdx new file mode 100644 index 0000000..459769f --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.TGS.mdx @@ -0,0 +1,43 @@ +# Interface: TGS + +[kerberos](/templates/protocols/javascript/modules/kerberos).TGS + +TGS is the response from GetServiceTicket + +## Table of contents + +### Properties + +- [ErrMsg](/templates/protocols/javascript/modules/kerberos.TGS#errmsg) +- [Hash](/templates/protocols/javascript/modules/kerberos.TGS#hash) +- [Ticket](/templates/protocols/javascript/modules/kerberos.TGS#ticket) + +## Properties + +### ErrMsg + +• `Optional` **ErrMsg**: `string` + +#### Defined in + +kerberos.ts:443 + +___ + +### Hash + +• `Optional` **Hash**: `string` + +#### Defined in + +kerberos.ts:441 + +___ + +### Ticket + +• `Optional` **Ticket**: [`Ticket`](/templates/protocols/javascript/modules/kerberos.Ticket) + +#### Defined in + +kerberos.ts:439 diff --git a/templates/protocols/javascript/modules/kerberos.Ticket.mdx b/templates/protocols/javascript/modules/kerberos.Ticket.mdx new file mode 100644 index 0000000..328a47a --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.Ticket.mdx @@ -0,0 +1,65 @@ +# Interface: Ticket + +[kerberos](/templates/protocols/javascript/modules/kerberos).Ticket + +Ticket Interface + +## Table of contents + +### Properties + +- [DecryptedEncPart](/templates/protocols/javascript/modules/kerberos.Ticket#decryptedencpart) +- [EncPart](/templates/protocols/javascript/modules/kerberos.Ticket#encpart) +- [Realm](/templates/protocols/javascript/modules/kerberos.Ticket#realm) +- [SName](/templates/protocols/javascript/modules/kerberos.Ticket#sname) +- [TktVNO](/templates/protocols/javascript/modules/kerberos.Ticket#tktvno) + +## Properties + +### DecryptedEncPart + +• `Optional` **DecryptedEncPart**: [`EncTicketPart`](/templates/protocols/javascript/modules/kerberos.EncTicketPart) + +#### Defined in + +kerberos.ts:461 + +___ + +### EncPart + +• `Optional` **EncPart**: [`EncryptedData`](/templates/protocols/javascript/modules/kerberos.EncryptedData) + +#### Defined in + +kerberos.ts:459 + +___ + +### Realm + +• `Optional` **Realm**: `string` + +#### Defined in + +kerberos.ts:455 + +___ + +### SName + +• `Optional` **SName**: [`PrincipalName`](/templates/protocols/javascript/modules/kerberos.PrincipalName) + +#### Defined in + +kerberos.ts:457 + +___ + +### TktVNO + +• `Optional` **TktVNO**: `number` + +#### Defined in + +kerberos.ts:453 diff --git a/templates/protocols/javascript/modules/kerberos.TransitedEncoding.mdx b/templates/protocols/javascript/modules/kerberos.TransitedEncoding.mdx new file mode 100644 index 0000000..8716eaa --- /dev/null +++ b/templates/protocols/javascript/modules/kerberos.TransitedEncoding.mdx @@ -0,0 +1,32 @@ +# Interface: TransitedEncoding + +[kerberos](/templates/protocols/javascript/modules/kerberos).TransitedEncoding + +TransitedEncoding Interface + +## Table of contents + +### Properties + +- [Contents](/templates/protocols/javascript/modules/kerberos.TransitedEncoding#contents) +- [TRType](/templates/protocols/javascript/modules/kerberos.TransitedEncoding#trtype) + +## Properties + +### Contents + +• `Optional` **Contents**: `Uint8Array` + +#### Defined in + +kerberos.ts:471 + +___ + +### TRType + +• `Optional` **TRType**: `number` + +#### Defined in + +kerberos.ts:473 diff --git a/templates/protocols/javascript/modules/kerberos.mdx b/templates/protocols/javascript/modules/kerberos.mdx index 6302013..15d9888 100644 --- a/templates/protocols/javascript/modules/kerberos.mdx +++ b/templates/protocols/javascript/modules/kerberos.mdx @@ -1,45 +1,166 @@ - +# Namespace: kerberos -## kerberos +## Table of contents -* [kerberos](#module_kerberos) - * [`KerberosClient`](#module_kerberos..KerberosClient) - * [`.EnumerateUser(domain, controller, username)`](#module_kerberos..KerberosClient+EnumerateUser) ⇒ EnumerateUserResponse - * [`EnumerateUserResponse`](#module_kerberos..EnumerateUserResponse) : object +### Classes - +- [Client](/templates/protocols/javascript/modules/kerberos.Client) +- [Config](/templates/protocols/javascript/modules/kerberos.Config) -### (kerberos).KerberosClient -KerberosClient is a kerberos client +### Interfaces -**Kind**: inner class of [kerberos](#module_kerberos) - +- [AuthorizationDataEntry](/templates/protocols/javascript/modules/kerberos.AuthorizationDataEntry) +- [BitString](/templates/protocols/javascript/modules/kerberos.BitString) +- [EncTicketPart](/templates/protocols/javascript/modules/kerberos.EncTicketPart) +- [EncryptedData](/templates/protocols/javascript/modules/kerberos.EncryptedData) +- [EncryptionKey](/templates/protocols/javascript/modules/kerberos.EncryptionKey) +- [EnumerateUserResponse](/templates/protocols/javascript/modules/kerberos.EnumerateUserResponse) +- [HostAddress](/templates/protocols/javascript/modules/kerberos.HostAddress) +- [LibDefaults](/templates/protocols/javascript/modules/kerberos.LibDefaults) +- [PrincipalName](/templates/protocols/javascript/modules/kerberos.PrincipalName) +- [Realm](/templates/protocols/javascript/modules/kerberos.Realm) +- [TGS](/templates/protocols/javascript/modules/kerberos.TGS) +- [Ticket](/templates/protocols/javascript/modules/kerberos.Ticket) +- [TransitedEncoding](/templates/protocols/javascript/modules/kerberos.TransitedEncoding) -#### kerberosClient.EnumerateUser(domain, controller, username) ⇒ EnumerateUserResponse -EnumerateUser returns true if the user exists in the domain. If the user is not found, false is returned. If the user is found, true is returned. Optionally, the AS-REP hash is also returned if discovered. +### Functions -**Kind**: instance method of [KerberosClient](#module_kerberos..KerberosClient) -**Returns**: EnumerateUserResponse - - The response of the enumeration. -**Throws**: +- [ASRepToHashcat](/templates/protocols/javascript/modules/kerberos#asreptohashcat) +- [CheckKrbError](/templates/protocols/javascript/modules/kerberos#checkkrberror) +- [NewKerberosClientFromString](/templates/protocols/javascript/modules/kerberos#newkerberosclientfromstring) +- [SendToKDC](/templates/protocols/javascript/modules/kerberos#sendtokdc) +- [TGStoHashcat](/templates/protocols/javascript/modules/kerberos#tgstohashcat) -- error - The error encountered during enumeration. +## Functions +### ASRepToHashcat -| Param | Type | Description | -| --- | --- | --- | -| domain | string | The domain to check. | -| controller | string | The controller to use. | -| username | string | The username to check. | +▸ **ASRepToHashcat**(`asrep`): `string` \| ``null`` -**Example** -```js -let m = require('nuclei/kerberos'); -let c = m.KerberosClient(); -let response = c.EnumerateUser('domain', 'controller', 'username'); +ASRepToHashcat converts an AS-REP message to a hashcat format + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `asrep` | `any` | + +#### Returns + +`string` \| ``null`` + +#### Defined in + +kerberos.ts:6 + +___ + +### CheckKrbError + +▸ **CheckKrbError**(`b`): `Uint8Array` \| ``null`` + +CheckKrbError checks if the response bytes from the KDC are a KRBError. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `Uint8Array` | + +#### Returns + +`Uint8Array` \| ``null`` + +#### Defined in + +kerberos.ts:15 + +___ + +### NewKerberosClientFromString + +▸ **NewKerberosClientFromString**(`cfg`): [`Client`](/templates/protocols/javascript/modules/kerberos.Client) \| ``null`` + +NewKerberosClientFromString creates a new kerberos client from a string +by parsing krb5.conf + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cfg` | `string` | + +#### Returns + +[`Client`](/templates/protocols/javascript/modules/kerberos.Client) \| ``null`` + +**`Example`** + +```javascript +const kerberos = require('nuclei/kerberos'); +const client = kerberos.NewKerberosClientFromString(` +[libdefaults] +default_realm = ACME.COM +dns_lookup_kdc = true +`); +``` + +#### Defined in + +kerberos.ts:34 + +___ + +### SendToKDC + +▸ **SendToKDC**(`kclient`, `msg`): `string` \| ``null`` + +sendtokdc.go deals with actual sending and receiving responses from KDC +SendToKDC sends a message to the KDC and returns the response. +It first tries to send the message over TCP, and if that fails, it falls back to UDP.(and vice versa) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `kclient` | [`Client`](/templates/protocols/javascript/modules/kerberos.Client) | +| `msg` | `string` | + +#### Returns + +`string` \| ``null`` + +**`Example`** + +```javascript +const kerberos = require('nuclei/kerberos'); +const client = new kerberos.Client('acme.com'); +const response = kerberos.SendToKDC(client, 'message'); ``` - -### (kerberos).EnumerateUserResponse : object -EnumerateUserResponse is the response object from the EnumerateUser method. +#### Defined in + +kerberos.ts:51 + +___ + +### TGStoHashcat + +▸ **TGStoHashcat**(`tgs`, `username`): `string` \| ``null`` + +TGStoHashcat converts a TGS to a hashcat format. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `tgs` | `any` | +| `username` | `string` | + +#### Returns + +`string` \| ``null`` + +#### Defined in -**Kind**: inner typedef of [kerberos](#module_kerberos) +kerberos.ts:60 diff --git a/templates/protocols/javascript/modules/ldap.ADObject.mdx b/templates/protocols/javascript/modules/ldap.ADObject.mdx new file mode 100644 index 0000000..01fe6f9 --- /dev/null +++ b/templates/protocols/javascript/modules/ldap.ADObject.mdx @@ -0,0 +1,84 @@ +# Interface: ADObject + +[ldap](/templates/protocols/javascript/modules/ldap).ADObject + +ADObject represents an Active Directory object + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const users = client.GetADUsers(); +log(to_json(users)); + +## Table of contents + +### Properties + +- [DistinguishedName](/templates/protocols/javascript/modules/ldap.ADObject#distinguishedname) +- [LastLogon](/templates/protocols/javascript/modules/ldap.ADObject#lastlogon) +- [MemberOf](/templates/protocols/javascript/modules/ldap.ADObject#memberof) +- [PWDLastSet](/templates/protocols/javascript/modules/ldap.ADObject#pwdlastset) +- [SAMAccountName](/templates/protocols/javascript/modules/ldap.ADObject#samaccountname) +- [ServicePrincipalName](/templates/protocols/javascript/modules/ldap.ADObject#serviceprincipalname) + +## Properties + +### DistinguishedName + +• `Optional` **DistinguishedName**: `string` + +#### Defined in + +ldap.ts:479 + +___ + +### LastLogon + +• `Optional` **LastLogon**: `string` + +#### Defined in + +ldap.ts:485 + +___ + +### MemberOf + +• `Optional` **MemberOf**: `string`[] + +#### Defined in + +ldap.ts:487 + +___ + +### PWDLastSet + +• `Optional` **PWDLastSet**: `string` + +#### Defined in + +ldap.ts:483 + +___ + +### SAMAccountName + +• `Optional` **SAMAccountName**: `string` + +#### Defined in + +ldap.ts:481 + +___ + +### ServicePrincipalName + +• `Optional` **ServicePrincipalName**: `string`[] + +#### Defined in + +ldap.ts:489 diff --git a/templates/protocols/javascript/modules/ldap.Client.mdx b/templates/protocols/javascript/modules/ldap.Client.mdx new file mode 100644 index 0000000..dea2261 --- /dev/null +++ b/templates/protocols/javascript/modules/ldap.Client.mdx @@ -0,0 +1,620 @@ +# Class: Client + +[ldap](/templates/protocols/javascript/modules/ldap).Client + +Client is a client for ldap protocol in nuclei + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +// here ldap.example.com is the ldap server and acme.com is the realm +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +``` + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const cfg = new ldap.Config(); +cfg.Timeout = 10; +cfg.ServerName = 'ldap.internal.acme.com'; +// optional config can be passed as third argument +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com', cfg); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/ldap.Client#constructor) + +### Properties + +- [BaseDN](/templates/protocols/javascript/modules/ldap.Client#basedn) +- [Host](/templates/protocols/javascript/modules/ldap.Client#host) +- [Port](/templates/protocols/javascript/modules/ldap.Client#port) +- [Realm](/templates/protocols/javascript/modules/ldap.Client#realm) +- [config](/templates/protocols/javascript/modules/ldap.Client#config) +- [ldapUrl](/templates/protocols/javascript/modules/ldap.Client#ldapurl) +- [realm](/templates/protocols/javascript/modules/ldap.Client#realm-1) + +### Methods + +- [AdvancedSearch](/templates/protocols/javascript/modules/ldap.Client#advancedsearch) +- [Authenticate](/templates/protocols/javascript/modules/ldap.Client#authenticate) +- [AuthenticateWithNTLMHash](/templates/protocols/javascript/modules/ldap.Client#authenticatewithntlmhash) +- [Close](/templates/protocols/javascript/modules/ldap.Client#close) +- [CollectMetadata](/templates/protocols/javascript/modules/ldap.Client#collectmetadata) +- [FindADObjects](/templates/protocols/javascript/modules/ldap.Client#findadobjects) +- [GetADActiveUsers](/templates/protocols/javascript/modules/ldap.Client#getadactiveusers) +- [GetADAdmins](/templates/protocols/javascript/modules/ldap.Client#getadadmins) +- [GetADDCList](/templates/protocols/javascript/modules/ldap.Client#getaddclist) +- [GetADDomainSID](/templates/protocols/javascript/modules/ldap.Client#getaddomainsid) +- [GetADGroups](/templates/protocols/javascript/modules/ldap.Client#getadgroups) +- [GetADUserKerberoastable](/templates/protocols/javascript/modules/ldap.Client#getaduserkerberoastable) +- [GetADUserTrustedForDelegation](/templates/protocols/javascript/modules/ldap.Client#getadusertrustedfordelegation) +- [GetADUserWithNeverExpiringPasswords](/templates/protocols/javascript/modules/ldap.Client#getaduserwithneverexpiringpasswords) +- [GetADUserWithPasswordNotRequired](/templates/protocols/javascript/modules/ldap.Client#getaduserwithpasswordnotrequired) +- [GetADUsers](/templates/protocols/javascript/modules/ldap.Client#getadusers) +- [Search](/templates/protocols/javascript/modules/ldap.Client#search) + +## Constructors + +### constructor + +• **new Client**(`ldapUrl`, `realm`, `config?`): [`Client`](/templates/protocols/javascript/modules/ldap.Client) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ldapUrl` | `string` | +| `realm` | `string` | +| `config?` | [`Config`](/templates/protocols/javascript/modules/ldap.Config) | + +#### Returns + +[`Client`](/templates/protocols/javascript/modules/ldap.Client) + +#### Defined in + +ldap.ts:198 + +## Properties + +### BaseDN + +• `Optional` **BaseDN**: `string` + +#### Defined in + +ldap.ts:194 + +___ + +### Host + +• `Optional` **Host**: `string` + +#### Defined in + +ldap.ts:182 + +___ + +### Port + +• `Optional` **Port**: `number` + +#### Defined in + +ldap.ts:186 + +___ + +### Realm + +• `Optional` **Realm**: `string` + +#### Defined in + +ldap.ts:190 + +___ + +### config + +• `Optional` **config**: [`Config`](/templates/protocols/javascript/modules/ldap.Config) + +#### Defined in + +ldap.ts:198 + +___ + +### ldapUrl + +• **ldapUrl**: `string` + +#### Defined in + +ldap.ts:198 + +___ + +### realm + +• **realm**: `string` + +#### Defined in + +ldap.ts:198 + +## Methods + +### AdvancedSearch + +▸ **AdvancedSearch**(`Scope`, `TypesOnly`, `Filter`, `Attributes`, `Controls`): [`SearchResult`](/templates/protocols/javascript/modules/ldap.SearchResult) + +AdvancedSearch accepts all values of search request type and return Ldap Entry +its up to user to handle the response + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `Scope` | `number` | +| `TypesOnly` | `boolean` | +| `Filter` | `string` | +| `Attributes` | `string`[] | +| `Controls` | `any` | + +#### Returns + +[`SearchResult`](/templates/protocols/javascript/modules/ldap.SearchResult) + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const results = client.AdvancedSearch(ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false, '(objectClass=*)', ['cn', 'mail'], []); +``` + +#### Defined in + +ldap.ts:430 + +___ + +### Authenticate + +▸ **Authenticate**(`username`): `void` + +Authenticate authenticates with the ldap server using the given username and password +performs NTLMBind first and then Bind/UnauthenticatedBind if NTLMBind fails + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `username` | `string` | + +#### Returns + +`void` + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +client.Authenticate('user', 'password'); +``` + +#### Defined in + +ldap.ts:386 + +___ + +### AuthenticateWithNTLMHash + +▸ **AuthenticateWithNTLMHash**(`username`): `void` + +AuthenticateWithNTLMHash authenticates with the ldap server using the given username and NTLM hash + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `username` | `string` | + +#### Returns + +`void` + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +client.AuthenticateWithNTLMHash('pdtm', 'hash'); +``` + +#### Defined in + +ldap.ts:400 + +___ + +### Close + +▸ **Close**(): `void` + +close the ldap connection + +#### Returns + +`void` + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +client.Close(); +``` + +#### Defined in + +ldap.ts:459 + +___ + +### CollectMetadata + +▸ **CollectMetadata**(): [`Metadata`](/templates/protocols/javascript/modules/ldap.Metadata) + +CollectLdapMetadata collects metadata from ldap server. + +#### Returns + +[`Metadata`](/templates/protocols/javascript/modules/ldap.Metadata) + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const metadata = client.CollectMetadata(); +log(to_json(metadata)); +``` + +#### Defined in + +ldap.ts:445 + +___ + +### FindADObjects + +▸ **FindADObjects**(`filter`): [`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +FindADObjects finds AD objects based on a filter +and returns them as a list of ADObject + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `filter` | `string` | + +#### Returns + +[`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const users = client.FindADObjects(ldap.FilterIsPerson); +log(to_json(users)); +``` + +#### Defined in + +ldap.ts:212 + +___ + +### GetADActiveUsers + +▸ **GetADActiveUsers**(): [`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +GetADActiveUsers returns all AD users +using FilterIsPerson and FilterAccountEnabled filter query + +#### Returns + +[`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const users = client.GetADActiveUsers(); +log(to_json(users)); +``` + +#### Defined in + +ldap.ts:244 + +___ + +### GetADAdmins + +▸ **GetADAdmins**(): [`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +GetADAdmins returns all AD admins +using FilterIsPerson, FilterAccountEnabled and FilterIsAdmin filter query + +#### Returns + +[`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const admins = client.GetADAdmins(); +log(to_json(admins)); +``` + +#### Defined in + +ldap.ts:340 + +___ + +### GetADDCList + +▸ **GetADDCList**(): [`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +GetADDCList returns all AD domain controllers +using FilterIsComputer, FilterAccountEnabled and FilterServerTrustAccount filter query + +#### Returns + +[`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const dcs = client.GetADDCList(); +log(to_json(dcs)); +``` + +#### Defined in + +ldap.ts:324 + +___ + +### GetADDomainSID + +▸ **GetADDomainSID**(): `string` + +GetADDomainSID returns the SID of the AD domain + +#### Returns + +`string` + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const domainSID = client.GetADDomainSID(); +log(domainSID); +``` + +#### Defined in + +ldap.ts:371 + +___ + +### GetADGroups + +▸ **GetADGroups**(): [`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +GetADGroups returns all AD groups +using FilterIsGroup filter query + +#### Returns + +[`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const groups = client.GetADGroups(); +log(to_json(groups)); +``` + +#### Defined in + +ldap.ts:308 + +___ + +### GetADUserKerberoastable + +▸ **GetADUserKerberoastable**(): [`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +GetADUserKerberoastable returns all AD users that are kerberoastable +using FilterIsPerson, FilterAccountEnabled and FilterHasServicePrincipalName filter query + +#### Returns + +[`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const kerberoastable = client.GetADUserKerberoastable(); +log(to_json(kerberoastable)); +``` + +#### Defined in + +ldap.ts:356 + +___ + +### GetADUserTrustedForDelegation + +▸ **GetADUserTrustedForDelegation**(): [`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +GetADUserTrustedForDelegation returns all AD users that are trusted for delegation +using FilterIsPerson and FilterTrustedForDelegation filter query + +#### Returns + +[`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const users = client.GetADUserTrustedForDelegation(); +log(to_json(users)); +``` + +#### Defined in + +ldap.ts:276 + +___ + +### GetADUserWithNeverExpiringPasswords + +▸ **GetADUserWithNeverExpiringPasswords**(): [`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +GetAdUserWithNeverExpiringPasswords returns all AD users +using FilterIsPerson and FilterDontExpirePassword filter query + +#### Returns + +[`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const users = client.GetADUserWithNeverExpiringPasswords(); +log(to_json(users)); +``` + +#### Defined in + +ldap.ts:260 + +___ + +### GetADUserWithPasswordNotRequired + +▸ **GetADUserWithPasswordNotRequired**(): [`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +GetADUserWithPasswordNotRequired returns all AD users that do not require a password +using FilterIsPerson and FilterPasswordNotRequired filter query + +#### Returns + +[`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const users = client.GetADUserWithPasswordNotRequired(); +log(to_json(users)); +``` + +#### Defined in + +ldap.ts:292 + +___ + +### GetADUsers + +▸ **GetADUsers**(): [`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +GetADUsers returns all AD users +using FilterIsPerson filter query + +#### Returns + +[`ADObject`](/templates/protocols/javascript/modules/ldap.ADObject)[] + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const users = client.GetADUsers(); +log(to_json(users)); +``` + +#### Defined in + +ldap.ts:228 + +___ + +### Search + +▸ **Search**(`filter`, `attributes`): `Record`\<`string`, `string`[]\>[] + +Search accepts whatever filter and returns a list of maps having provided attributes +as keys and associated values mirroring the ones returned by ldap + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `filter` | `string` | +| `attributes` | `any` | + +#### Returns + +`Record`\<`string`, `string`[]\>[] + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const client = new ldap.Client('ldap://ldap.example.com', 'acme.com'); +const results = client.Search('(objectClass=*)', 'cn', 'mail'); +``` + +#### Defined in + +ldap.ts:415 diff --git a/templates/protocols/javascript/modules/ldap.Config.mdx b/templates/protocols/javascript/modules/ldap.Config.mdx new file mode 100644 index 0000000..abaddc3 --- /dev/null +++ b/templates/protocols/javascript/modules/ldap.Config.mdx @@ -0,0 +1,55 @@ +# Interface: Config + +[ldap](/templates/protocols/javascript/modules/ldap).Config + +Config is extra configuration for the ldap client + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const cfg = new ldap.Config(); +cfg.Timeout = 10; +cfg.ServerName = 'ldap.internal.acme.com'; +cfg.Upgrade = true; // upgrade to tls +``` + +## Table of contents + +### Properties + +- [ServerName](/templates/protocols/javascript/modules/ldap.Config#servername) +- [Timeout](/templates/protocols/javascript/modules/ldap.Config#timeout) +- [Upgrade](/templates/protocols/javascript/modules/ldap.Config#upgrade) + +## Properties + +### ServerName + +• `Optional` **ServerName**: `string` + +#### Defined in + +ldap.ts:513 + +___ + +### Timeout + +• `Optional` **Timeout**: `number` + +Timeout is the timeout for the ldap client in seconds + +#### Defined in + +ldap.ts:511 + +___ + +### Upgrade + +• `Optional` **Upgrade**: `boolean` + +#### Defined in + +ldap.ts:515 diff --git a/templates/protocols/javascript/modules/ldap.Entry.mdx b/templates/protocols/javascript/modules/ldap.Entry.mdx new file mode 100644 index 0000000..a21d8ce --- /dev/null +++ b/templates/protocols/javascript/modules/ldap.Entry.mdx @@ -0,0 +1,32 @@ +# Interface: Entry + +[ldap](/templates/protocols/javascript/modules/ldap).Entry + +Entry Interface + +## Table of contents + +### Properties + +- [Attributes](/templates/protocols/javascript/modules/ldap.Entry#attributes) +- [DN](/templates/protocols/javascript/modules/ldap.Entry#dn) + +## Properties + +### Attributes + +• `Optional` **Attributes**: [`EntryAttribute`](/templates/protocols/javascript/modules/ldap.EntryAttribute) + +#### Defined in + +ldap.ts:527 + +___ + +### DN + +• `Optional` **DN**: `string` + +#### Defined in + +ldap.ts:525 diff --git a/templates/protocols/javascript/modules/ldap.EntryAttribute.mdx b/templates/protocols/javascript/modules/ldap.EntryAttribute.mdx new file mode 100644 index 0000000..bf60bc0 --- /dev/null +++ b/templates/protocols/javascript/modules/ldap.EntryAttribute.mdx @@ -0,0 +1,43 @@ +# Interface: EntryAttribute + +[ldap](/templates/protocols/javascript/modules/ldap).EntryAttribute + +EntryAttribute Interface + +## Table of contents + +### Properties + +- [ByteValues](/templates/protocols/javascript/modules/ldap.EntryAttribute#bytevalues) +- [Name](/templates/protocols/javascript/modules/ldap.EntryAttribute#name) +- [Values](/templates/protocols/javascript/modules/ldap.EntryAttribute#values) + +## Properties + +### ByteValues + +• `Optional` **ByteValues**: `Uint8Array` + +#### Defined in + +ldap.ts:541 + +___ + +### Name + +• `Optional` **Name**: `string` + +#### Defined in + +ldap.ts:537 + +___ + +### Values + +• `Optional` **Values**: `string`[] + +#### Defined in + +ldap.ts:539 diff --git a/templates/protocols/javascript/modules/ldap.Metadata.mdx b/templates/protocols/javascript/modules/ldap.Metadata.mdx new file mode 100644 index 0000000..9c0a3df --- /dev/null +++ b/templates/protocols/javascript/modules/ldap.Metadata.mdx @@ -0,0 +1,88 @@ +# Interface: Metadata + +[ldap](/templates/protocols/javascript/modules/ldap).Metadata + +Metadata is the metadata for ldap server. +this is returned by CollectMetadata method + +## Table of contents + +### Properties + +- [BaseDN](/templates/protocols/javascript/modules/ldap.Metadata#basedn) +- [DefaultNamingContext](/templates/protocols/javascript/modules/ldap.Metadata#defaultnamingcontext) +- [DnsHostName](/templates/protocols/javascript/modules/ldap.Metadata#dnshostname) +- [Domain](/templates/protocols/javascript/modules/ldap.Metadata#domain) +- [DomainControllerFunctionality](/templates/protocols/javascript/modules/ldap.Metadata#domaincontrollerfunctionality) +- [DomainFunctionality](/templates/protocols/javascript/modules/ldap.Metadata#domainfunctionality) +- [ForestFunctionality](/templates/protocols/javascript/modules/ldap.Metadata#forestfunctionality) + +## Properties + +### BaseDN + +• `Optional` **BaseDN**: `string` + +#### Defined in + +ldap.ts:552 + +___ + +### DefaultNamingContext + +• `Optional` **DefaultNamingContext**: `string` + +#### Defined in + +ldap.ts:556 + +___ + +### DnsHostName + +• `Optional` **DnsHostName**: `string` + +#### Defined in + +ldap.ts:564 + +___ + +### Domain + +• `Optional` **Domain**: `string` + +#### Defined in + +ldap.ts:554 + +___ + +### DomainControllerFunctionality + +• `Optional` **DomainControllerFunctionality**: `string` + +#### Defined in + +ldap.ts:562 + +___ + +### DomainFunctionality + +• `Optional` **DomainFunctionality**: `string` + +#### Defined in + +ldap.ts:558 + +___ + +### ForestFunctionality + +• `Optional` **ForestFunctionality**: `string` + +#### Defined in + +ldap.ts:560 diff --git a/templates/protocols/javascript/modules/ldap.SearchResult.mdx b/templates/protocols/javascript/modules/ldap.SearchResult.mdx new file mode 100644 index 0000000..fd834bc --- /dev/null +++ b/templates/protocols/javascript/modules/ldap.SearchResult.mdx @@ -0,0 +1,32 @@ +# Interface: SearchResult + +[ldap](/templates/protocols/javascript/modules/ldap).SearchResult + +SearchResult Interface + +## Table of contents + +### Properties + +- [Entries](/templates/protocols/javascript/modules/ldap.SearchResult#entries) +- [Referrals](/templates/protocols/javascript/modules/ldap.SearchResult#referrals) + +## Properties + +### Entries + +• `Optional` **Entries**: [`Entry`](/templates/protocols/javascript/modules/ldap.Entry) + +#### Defined in + +ldap.ts:576 + +___ + +### Referrals + +• `Optional` **Referrals**: `string`[] + +#### Defined in + +ldap.ts:574 diff --git a/templates/protocols/javascript/modules/ldap.mdx b/templates/protocols/javascript/modules/ldap.mdx index efa5d42..464d2e4 100644 --- a/templates/protocols/javascript/modules/ldap.mdx +++ b/templates/protocols/javascript/modules/ldap.mdx @@ -1,73 +1,539 @@ - +# Namespace: ldap -## ldap +## Table of contents -* [ldap](#module_ldap) - * [`LdapClient`](#module_ldap..LdapClient) - * [`.CollectLdapMetadata(domain, controller)`](#module_ldap..LdapClient+CollectLdapMetadata) ⇒ LDAPMetadata - * [`.IsLdap(host, port)`](#module_ldap..LdapClient+IsLdap) ⇒ boolean - * [`LDAPMetadata`](#module_ldap..LDAPMetadata) : object +### Classes - +- [Client](/templates/protocols/javascript/modules/ldap.Client) -### (ldap).LdapClient -LdapClient is a client for ldap protocol in golang. It is a wrapper around the standard library ldap package. +### Interfaces -**Kind**: inner class of [ldap](#module_ldap) +- [ADObject](/templates/protocols/javascript/modules/ldap.ADObject) +- [Config](/templates/protocols/javascript/modules/ldap.Config) +- [Entry](/templates/protocols/javascript/modules/ldap.Entry) +- [EntryAttribute](/templates/protocols/javascript/modules/ldap.EntryAttribute) +- [Metadata](/templates/protocols/javascript/modules/ldap.Metadata) +- [SearchResult](/templates/protocols/javascript/modules/ldap.SearchResult) -* [`LdapClient`](#module_ldap..LdapClient) - * [`.CollectLdapMetadata(domain, controller)`](#module_ldap..LdapClient+CollectLdapMetadata) ⇒ LDAPMetadata - * [`.IsLdap(host, port)`](#module_ldap..LdapClient+IsLdap) ⇒ boolean +### Variables - +- [FilterAccountDisabled](/templates/protocols/javascript/modules/ldap#filteraccountdisabled) +- [FilterAccountEnabled](/templates/protocols/javascript/modules/ldap#filteraccountenabled) +- [FilterCanSendEncryptedPassword](/templates/protocols/javascript/modules/ldap#filtercansendencryptedpassword) +- [FilterDontExpirePassword](/templates/protocols/javascript/modules/ldap#filterdontexpirepassword) +- [FilterDontRequirePreauth](/templates/protocols/javascript/modules/ldap#filterdontrequirepreauth) +- [FilterHasServicePrincipalName](/templates/protocols/javascript/modules/ldap#filterhasserviceprincipalname) +- [FilterHomedirRequired](/templates/protocols/javascript/modules/ldap#filterhomedirrequired) +- [FilterInterdomainTrustAccount](/templates/protocols/javascript/modules/ldap#filterinterdomaintrustaccount) +- [FilterIsAdmin](/templates/protocols/javascript/modules/ldap#filterisadmin) +- [FilterIsComputer](/templates/protocols/javascript/modules/ldap#filteriscomputer) +- [FilterIsDuplicateAccount](/templates/protocols/javascript/modules/ldap#filterisduplicateaccount) +- [FilterIsGroup](/templates/protocols/javascript/modules/ldap#filterisgroup) +- [FilterIsNormalAccount](/templates/protocols/javascript/modules/ldap#filterisnormalaccount) +- [FilterIsPerson](/templates/protocols/javascript/modules/ldap#filterisperson) +- [FilterLockout](/templates/protocols/javascript/modules/ldap#filterlockout) +- [FilterLogonScript](/templates/protocols/javascript/modules/ldap#filterlogonscript) +- [FilterMnsLogonAccount](/templates/protocols/javascript/modules/ldap#filtermnslogonaccount) +- [FilterNotDelegated](/templates/protocols/javascript/modules/ldap#filternotdelegated) +- [FilterPartialSecretsAccount](/templates/protocols/javascript/modules/ldap#filterpartialsecretsaccount) +- [FilterPasswordCantChange](/templates/protocols/javascript/modules/ldap#filterpasswordcantchange) +- [FilterPasswordExpired](/templates/protocols/javascript/modules/ldap#filterpasswordexpired) +- [FilterPasswordNotRequired](/templates/protocols/javascript/modules/ldap#filterpasswordnotrequired) +- [FilterServerTrustAccount](/templates/protocols/javascript/modules/ldap#filterservertrustaccount) +- [FilterSmartCardRequired](/templates/protocols/javascript/modules/ldap#filtersmartcardrequired) +- [FilterTrustedForDelegation](/templates/protocols/javascript/modules/ldap#filtertrustedfordelegation) +- [FilterTrustedToAuthForDelegation](/templates/protocols/javascript/modules/ldap#filtertrustedtoauthfordelegation) +- [FilterUseDesKeyOnly](/templates/protocols/javascript/modules/ldap#filterusedeskeyonly) +- [FilterWorkstationTrustAccount](/templates/protocols/javascript/modules/ldap#filterworkstationtrustaccount) -#### ldapClient.CollectLdapMetadata(domain, controller) ⇒ LDAPMetadata -CollectLdapMetadata collects metadata from ldap server. +### Functions -**Kind**: instance method of [LdapClient](#module_ldap..LdapClient) -**Returns**: LDAPMetadata - - The metadata from ldap server. -**Throws**: +- [DecodeADTimestamp](/templates/protocols/javascript/modules/ldap#decodeadtimestamp) +- [DecodeSID](/templates/protocols/javascript/modules/ldap#decodesid) +- [DecodeZuluTimestamp](/templates/protocols/javascript/modules/ldap#decodezulutimestamp) +- [JoinFilters](/templates/protocols/javascript/modules/ldap#joinfilters) +- [NegativeFilter](/templates/protocols/javascript/modules/ldap#negativefilter) -- error - The error encountered during metadata collection. +## Variables +### FilterAccountDisabled -| Param | Type | Description | -| --- | --- | --- | -| domain | string | The domain to collect metadata from. | -| controller | string | The controller to collect metadata from. | +• `Const` **FilterAccountDisabled**: ``"(userAccountControl:1.2.840.113556.1.4.803:=2)"`` -**Example** -```js -let m = require('nuclei/ldap'); -let c = m.LdapClient(); -let metadata = c.CollectLdapMetadata('example.com', 'controller1'); +The user account is disabled. + +#### Defined in + +ldap.ts:4 + +___ + +### FilterAccountEnabled + +• `Const` **FilterAccountEnabled**: ``"(!(userAccountControl:1.2.840.113556.1.4.803:=2))"`` + +The user account is enabled. + +#### Defined in + +ldap.ts:7 + +___ + +### FilterCanSendEncryptedPassword + +• `Const` **FilterCanSendEncryptedPassword**: ``"(userAccountControl:1.2.840.113556.1.4.803:=128)"`` + +The user can send an encrypted password. + +#### Defined in + +ldap.ts:10 + +___ + +### FilterDontExpirePassword + +• `Const` **FilterDontExpirePassword**: ``"(userAccountControl:1.2.840.113556.1.4.803:=65536)"`` + +Represents the password, which should never expire on the account. + +#### Defined in + +ldap.ts:13 + +___ + +### FilterDontRequirePreauth + +• `Const` **FilterDontRequirePreauth**: ``"(userAccountControl:1.2.840.113556.1.4.803:=4194304)"`` + +This account doesn't require Kerberos pre-authentication for logging on. + +#### Defined in + +ldap.ts:16 + +___ + +### FilterHasServicePrincipalName + +• `Const` **FilterHasServicePrincipalName**: ``"(servicePrincipalName=*)"`` + +The object has a service principal name. + +#### Defined in + +ldap.ts:19 + +___ + +### FilterHomedirRequired + +• `Const` **FilterHomedirRequired**: ``"(userAccountControl:1.2.840.113556.1.4.803:=8)"`` + +The home folder is required. + +#### Defined in + +ldap.ts:22 + +___ + +### FilterInterdomainTrustAccount + +• `Const` **FilterInterdomainTrustAccount**: ``"(userAccountControl:1.2.840.113556.1.4.803:=2048)"`` + +It's a permit to trust an account for a system domain that trusts other domains. + +#### Defined in + +ldap.ts:25 + +___ + +### FilterIsAdmin + +• `Const` **FilterIsAdmin**: ``"(adminCount=1)"`` + +The object is an admin. + +#### Defined in + +ldap.ts:28 + +___ + +### FilterIsComputer + +• `Const` **FilterIsComputer**: ``"(objectCategory=computer)"`` + +The object is a computer. + +#### Defined in + +ldap.ts:31 + +___ + +### FilterIsDuplicateAccount + +• `Const` **FilterIsDuplicateAccount**: ``"(userAccountControl:1.2.840.113556.1.4.803:=256)"`` + +It's an account for users whose primary account is in another domain. + +#### Defined in + +ldap.ts:34 + +___ + +### FilterIsGroup + +• `Const` **FilterIsGroup**: ``"(objectCategory=group)"`` + +The object is a group. + +#### Defined in + +ldap.ts:37 + +___ + +### FilterIsNormalAccount + +• `Const` **FilterIsNormalAccount**: ``"(userAccountControl:1.2.840.113556.1.4.803:=512)"`` + +It's a default account type that represents a typical user. + +#### Defined in + +ldap.ts:40 + +___ + +### FilterIsPerson + +• `Const` **FilterIsPerson**: ``"(objectCategory=person)"`` + +The object is a person. + +#### Defined in + +ldap.ts:43 + +___ + +### FilterLockout + +• `Const` **FilterLockout**: ``"(userAccountControl:1.2.840.113556.1.4.803:=16)"`` + +The user is locked out. + +#### Defined in + +ldap.ts:46 + +___ + +### FilterLogonScript + +• `Const` **FilterLogonScript**: ``"(userAccountControl:1.2.840.113556.1.4.803:=1)"`` + +The logon script will be run. + +#### Defined in + +ldap.ts:49 + +___ + +### FilterMnsLogonAccount + +• `Const` **FilterMnsLogonAccount**: ``"(userAccountControl:1.2.840.113556.1.4.803:=131072)"`` + +It's an MNS logon account. + +#### Defined in + +ldap.ts:52 + +___ + +### FilterNotDelegated + +• `Const` **FilterNotDelegated**: ``"(userAccountControl:1.2.840.113556.1.4.803:=1048576)"`` + +When this flag is set, the security context of the user isn't delegated to a service even if the service account is set as trusted for Kerberos delegation. + +#### Defined in + +ldap.ts:55 + +___ + +### FilterPartialSecretsAccount + +• `Const` **FilterPartialSecretsAccount**: ``"(userAccountControl:1.2.840.113556.1.4.803:=67108864)"`` + +The account is a read-only domain controller (RODC). + +#### Defined in + +ldap.ts:58 + +___ + +### FilterPasswordCantChange + +• `Const` **FilterPasswordCantChange**: ``"(userAccountControl:1.2.840.113556.1.4.803:=64)"`` + +The user can't change the password. + +#### Defined in + +ldap.ts:61 + +___ + +### FilterPasswordExpired + +• `Const` **FilterPasswordExpired**: ``"(userAccountControl:1.2.840.113556.1.4.803:=8388608)"`` + +The user's password has expired. + +#### Defined in + +ldap.ts:64 + +___ + +### FilterPasswordNotRequired + +• `Const` **FilterPasswordNotRequired**: ``"(userAccountControl:1.2.840.113556.1.4.803:=32)"`` + +No password is required. + +#### Defined in + +ldap.ts:67 + +___ + +### FilterServerTrustAccount + +• `Const` **FilterServerTrustAccount**: ``"(userAccountControl:1.2.840.113556.1.4.803:=8192)"`` + +It's a computer account for a domain controller that is a member of this domain. + +#### Defined in + +ldap.ts:70 + +___ + +### FilterSmartCardRequired + +• `Const` **FilterSmartCardRequired**: ``"(userAccountControl:1.2.840.113556.1.4.803:=262144)"`` + +When this flag is set, it forces the user to log on by using a smart card. + +#### Defined in + +ldap.ts:73 + +___ + +### FilterTrustedForDelegation + +• `Const` **FilterTrustedForDelegation**: ``"(userAccountControl:1.2.840.113556.1.4.803:=524288)"`` + +When this flag is set, the service account (the user or computer account) under which a service runs is trusted for Kerberos delegation. + +#### Defined in + +ldap.ts:76 + +___ + +### FilterTrustedToAuthForDelegation + +• `Const` **FilterTrustedToAuthForDelegation**: ``"(userAccountControl:1.2.840.113556.1.4.803:=16777216)"`` + +The account is enabled for delegation. + +#### Defined in + +ldap.ts:79 + +___ + +### FilterUseDesKeyOnly + +• `Const` **FilterUseDesKeyOnly**: ``"(userAccountControl:1.2.840.113556.1.4.803:=2097152)"`` + +Restrict this principal to use only Data Encryption Standard (DES) encryption types for keys. + +#### Defined in + +ldap.ts:82 + +___ + +### FilterWorkstationTrustAccount + +• `Const` **FilterWorkstationTrustAccount**: ``"(userAccountControl:1.2.840.113556.1.4.803:=4096)"`` + +It's a computer account for a computer that is running old Windows builds. + +#### Defined in + +ldap.ts:85 + +## Functions + +### DecodeADTimestamp + +▸ **DecodeADTimestamp**(`timestamp`): `string` + +DecodeADTimestamp decodes an Active Directory timestamp + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `timestamp` | `string` | + +#### Returns + +`string` + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const timestamp = ldap.DecodeADTimestamp('132036744000000000'); +log(timestamp); +``` + +#### Defined in + +ldap.ts:96 + +___ + +### DecodeSID + +▸ **DecodeSID**(`s`): `string` + +DecodeSID decodes a SID string + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `s` | `string` | + +#### Returns + +`string` + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const sid = ldap.DecodeSID('S-1-5-21-3623811015-3361044348-30300820-1013'); +log(sid); +``` + +#### Defined in + +ldap.ts:111 + +___ + +### DecodeZuluTimestamp + +▸ **DecodeZuluTimestamp**(`timestamp`): `string` + +DecodeZuluTimestamp decodes a Zulu timestamp + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `timestamp` | `string` | + +#### Returns + +`string` + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const timestamp = ldap.DecodeZuluTimestamp('2021-08-25T10:00:00Z'); +log(timestamp); ``` - -#### ldapClient.IsLdap(host, port) ⇒ boolean -IsLdap checks if the given host and port are running ldap server. +#### Defined in + +ldap.ts:126 + +___ + +### JoinFilters + +▸ **JoinFilters**(`filters`): `string` + +JoinFilters joins multiple filters into a single filter + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `filters` | `any` | + +#### Returns + +`string` + +**`Example`** + +```javascript +const ldap = require('nuclei/ldap'); +const filter = ldap.JoinFilters(ldap.FilterIsPerson, ldap.FilterAccountEnabled); +``` + +#### Defined in + +ldap.ts:140 + +___ + +### NegativeFilter + +▸ **NegativeFilter**(`filter`): `string` + +NegativeFilter returns a negative filter for a given filter + +#### Parameters -**Kind**: instance method of [LdapClient](#module_ldap..LdapClient) -**Returns**: boolean - - Whether the given host and port are running ldap server. -**Throws**: +| Name | Type | +| :------ | :------ | +| `filter` | `string` | -- error - The error encountered during the check. +#### Returns +`string` -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check. | -| port | int | The port to check. | +**`Example`** -**Example** -```js -let m = require('nuclei/ldap'); -let c = m.LdapClient(); -let isLdap = c.IsLdap('localhost', 389); +```javascript +const ldap = require('nuclei/ldap'); +const filter = ldap.NegativeFilter(ldap.FilterIsPerson); ``` - -### (ldap).LDAPMetadata : object -LDAPMetadata is an object containing metadata from ldap server. +#### Defined in -**Kind**: inner typedef of [ldap](#module_ldap) +ldap.ts:154 diff --git a/templates/protocols/javascript/modules/mssql.MSSQLClient.mdx b/templates/protocols/javascript/modules/mssql.MSSQLClient.mdx new file mode 100644 index 0000000..ade7cd6 --- /dev/null +++ b/templates/protocols/javascript/modules/mssql.MSSQLClient.mdx @@ -0,0 +1,141 @@ +# Class: MSSQLClient + +[mssql](/templates/protocols/javascript/modules/mssql).MSSQLClient + +Client is a client for MS SQL database. +Internally client uses denisenkom/go-mssqldb driver. + +**`Example`** + +```javascript +const mssql = require('nuclei/mssql'); +const client = new mssql.Client(); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/mssql.MSSQLClient#constructor) + +### Methods + +- [Connect](/templates/protocols/javascript/modules/mssql.MSSQLClient#connect) +- [ConnectWithDB](/templates/protocols/javascript/modules/mssql.MSSQLClient#connectwithdb) +- [IsMssql](/templates/protocols/javascript/modules/mssql.MSSQLClient#ismssql) + +## Constructors + +### constructor + +• **new MSSQLClient**(): [`MSSQLClient`](/templates/protocols/javascript/modules/mssql.MSSQLClient) + +#### Returns + +[`MSSQLClient`](/templates/protocols/javascript/modules/mssql.MSSQLClient) + +#### Defined in + +mssql.ts:16 + +## Methods + +### Connect + +▸ **Connect**(`host`, `port`, `username`): `boolean` + +Connect connects to MS SQL database using given credentials. +If connection is successful, it returns true. +If connection is unsuccessful, it returns false and error. +The connection is closed after the function returns. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `username` | `string` | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const mssql = require('nuclei/mssql'); +const client = new mssql.Client(); +const connected = client.Connect('acme.com', 1433, 'username', 'password'); +``` + +#### Defined in + +mssql.ts:29 + +___ + +### ConnectWithDB + +▸ **ConnectWithDB**(`host`, `port`, `username`): `boolean` + +ConnectWithDB connects to MS SQL database using given credentials and database name. +If connection is successful, it returns true. +If connection is unsuccessful, it returns false and error. +The connection is closed after the function returns. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `username` | `string` | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const mssql = require('nuclei/mssql'); +const client = new mssql.Client(); +const connected = client.ConnectWithDB('acme.com', 1433, 'username', 'password', 'master'); +``` + +#### Defined in + +mssql.ts:46 + +___ + +### IsMssql + +▸ **IsMssql**(`host`, `port`): `boolean` + +IsMssql checks if the given host is running MS SQL database. +If the host is running MS SQL database, it returns true. +If the host is not running MS SQL database, it returns false. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const mssql = require('nuclei/mssql'); +const isMssql = mssql.IsMssql('acme.com', 1433); +``` + +#### Defined in + +mssql.ts:61 diff --git a/templates/protocols/javascript/modules/mssql.mdx b/templates/protocols/javascript/modules/mssql.mdx index 261f409..429e41c 100644 --- a/templates/protocols/javascript/modules/mssql.mdx +++ b/templates/protocols/javascript/modules/mssql.mdx @@ -1,96 +1,7 @@ - +# Namespace: mssql -## mssql +## Table of contents -* [mssql](#module_mssql) - * [`MSSQLClient`](#module_mssql..MSSQLClient) - * [`.Connect(host, port, username, password)`](#module_mssql..MSSQLClient+Connect) ⇒ bool - * [`.ConnectWithDB(host, port, username, password, dbName)`](#module_mssql..MSSQLClient+ConnectWithDB) ⇒ bool - * [`.IsMssql(host, port)`](#module_mssql..MSSQLClient+IsMssql) ⇒ bool +### Classes - - -### (mssql).MSSQLClient -MSSQLClient is a client for MS SQL database. Internally client uses denisenkom/go-mssqldb driver. - -**Kind**: inner class of [mssql](#module_mssql) - -* [`MSSQLClient`](#module_mssql..MSSQLClient) - * [`.Connect(host, port, username, password)`](#module_mssql..MSSQLClient+Connect) ⇒ bool - * [`.ConnectWithDB(host, port, username, password, dbName)`](#module_mssql..MSSQLClient+ConnectWithDB) ⇒ bool - * [`.IsMssql(host, port)`](#module_mssql..MSSQLClient+IsMssql) ⇒ bool - - - -#### mssqlClient.Connect(host, port, username, password) ⇒ bool -Connect connects to MS SQL database using given credentials. If connection is successful, it returns true. If connection is unsuccessful, it returns false and error. The connection is closed after the function returns. - -**Kind**: instance method of [MSSQLClient](#module_mssql..MSSQLClient) -**Returns**: bool - - The status of the connection. -**Throws**: - -- error - The error encountered during connection. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the MS SQL database. | -| port | int | The port of the MS SQL database. | -| username | string | The username to connect to the MS SQL database. | -| password | string | The password to connect to the MS SQL database. | - -**Example** -```js -let m = require('nuclei/mssql'); -let c = m.MSSQLClient(); -let isConnected = c.Connect('localhost', 1433, 'username', 'password'); -``` - - -#### mssqlClient.ConnectWithDB(host, port, username, password, dbName) ⇒ bool -ConnectWithDB connects to MS SQL database using given credentials and database name. If connection is successful, it returns true. If connection is unsuccessful, it returns false and error. The connection is closed after the function returns. - -**Kind**: instance method of [MSSQLClient](#module_mssql..MSSQLClient) -**Returns**: bool - - The status of the connection. -**Throws**: - -- error - The error encountered during connection. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the MS SQL database. | -| port | int | The port of the MS SQL database. | -| username | string | The username to connect to the MS SQL database. | -| password | string | The password to connect to the MS SQL database. | -| dbName | string | The name of the database to connect to. | - -**Example** -```js -let m = require('nuclei/mssql'); -let c = m.MSSQLClient(); -let isConnected = c.ConnectWithDB('localhost', 1433, 'username', 'password', 'myDatabase'); -``` - - -#### mssqlClient.IsMssql(host, port) ⇒ bool -IsMssql checks if the given host is running MS SQL database. If the host is running MS SQL database, it returns true. If the host is not running MS SQL database, it returns false. - -**Kind**: instance method of [MSSQLClient](#module_mssql..MSSQLClient) -**Returns**: bool - - The status of the check. -**Throws**: - -- error - The error encountered during the check. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check. | -| port | int | The port to check. | - -**Example** -```js -let m = require('nuclei/mssql'); -let c = m.MSSQLClient(); -let isMssql = c.IsMssql('localhost', 1433); -``` +- [MSSQLClient](/templates/protocols/javascript/modules/mssql.MSSQLClient) diff --git a/templates/protocols/javascript/modules/mysql.MySQLClient.mdx b/templates/protocols/javascript/modules/mysql.MySQLClient.mdx new file mode 100644 index 0000000..342c175 --- /dev/null +++ b/templates/protocols/javascript/modules/mysql.MySQLClient.mdx @@ -0,0 +1,274 @@ +# Class: MySQLClient + +[mysql](/templates/protocols/javascript/modules/mysql).MySQLClient + +MySQLClient is a client for MySQL database. +Internally client uses go-sql-driver/mysql driver. + +**`Example`** + +```javascript +const mysql = require('nuclei/mysql'); +const client = new mysql.Client(); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/mysql.MySQLClient#constructor) + +### Methods + +- [Connect](/templates/protocols/javascript/modules/mysql.MySQLClient#connect) +- [ConnectWithDSN](/templates/protocols/javascript/modules/mysql.MySQLClient#connectwithdsn) +- [ExecuteQuery](/templates/protocols/javascript/modules/mysql.MySQLClient#executequery) +- [ExecuteQueryOnDB](/templates/protocols/javascript/modules/mysql.MySQLClient#executequeryondb) +- [ExecuteQueryWithOpts](/templates/protocols/javascript/modules/mysql.MySQLClient#executequerywithopts) +- [FingerprintMySQL](/templates/protocols/javascript/modules/mysql.MySQLClient#fingerprintmysql) +- [IsMySQL](/templates/protocols/javascript/modules/mysql.MySQLClient#ismysql) + +## Constructors + +### constructor + +• **new MySQLClient**(): [`MySQLClient`](/templates/protocols/javascript/modules/mysql.MySQLClient) + +#### Returns + +[`MySQLClient`](/templates/protocols/javascript/modules/mysql.MySQLClient) + +#### Defined in + +mysql.ts:33 + +## Methods + +### Connect + +▸ **Connect**(`host`, `port`, `username`): `boolean` + +Connect connects to MySQL database using given credentials. +If connection is successful, it returns true. +If connection is unsuccessful, it returns false and error. +The connection is closed after the function returns. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `username` | `string` | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const mysql = require('nuclei/mysql'); +const client = new mysql.Client(); +const connected = client.Connect('acme.com', 3306, 'username', 'password'); +``` + +#### Defined in + +mysql.ts:61 + +___ + +### ConnectWithDSN + +▸ **ConnectWithDSN**(`dsn`): `boolean` + +ConnectWithDSN connects to MySQL database using given DSN. +we override mysql dialer with fastdialer so it respects network policy +If connection is successful, it returns true. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `dsn` | `string` | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const mysql = require('nuclei/mysql'); +const client = new mysql.Client(); +const connected = client.ConnectWithDSN('username:password@tcp(acme.com:3306)/'); +``` + +#### Defined in + +mysql.ts:91 + +___ + +### ExecuteQuery + +▸ **ExecuteQuery**(`host`, `port`, `username`): [`SQLResult`](/templates/protocols/javascript/modules/mysql.SQLResult) + +ExecuteQuery connects to Mysql database using given credentials +and executes a query on the db. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `username` | `string` | + +#### Returns + +[`SQLResult`](/templates/protocols/javascript/modules/mysql.SQLResult) + +**`Example`** + +```javascript +const mysql = require('nuclei/mysql'); +const result = mysql.ExecuteQuery('acme.com', 3306, 'username', 'password', 'SELECT * FROM users'); +log(to_json(result)); +``` + +#### Defined in + +mysql.ts:124 + +___ + +### ExecuteQueryOnDB + +▸ **ExecuteQueryOnDB**(`host`, `port`, `username`): [`SQLResult`](/templates/protocols/javascript/modules/mysql.SQLResult) + +ExecuteQuery connects to Mysql database using given credentials +and executes a query on the db. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `username` | `string` | + +#### Returns + +[`SQLResult`](/templates/protocols/javascript/modules/mysql.SQLResult) + +**`Example`** + +```javascript +const mysql = require('nuclei/mysql'); +const result = mysql.ExecuteQueryOnDB('acme.com', 3306, 'username', 'password', 'dbname', 'SELECT * FROM users'); +log(to_json(result)); +``` + +#### Defined in + +mysql.ts:139 + +___ + +### ExecuteQueryWithOpts + +▸ **ExecuteQueryWithOpts**(`opts`, `query`): [`SQLResult`](/templates/protocols/javascript/modules/mysql.SQLResult) + +ExecuteQueryWithOpts connects to Mysql database using given credentials +and executes a query on the db. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`MySQLOptions`](/templates/protocols/javascript/modules/mysql.MySQLOptions) | +| `query` | `string` | + +#### Returns + +[`SQLResult`](/templates/protocols/javascript/modules/mysql.SQLResult) + +**`Example`** + +```javascript +const mysql = require('nuclei/mysql'); +const options = new mysql.MySQLOptions(); +options.Host = 'acme.com'; +options.Port = 3306; +const result = mysql.ExecuteQueryWithOpts(options, 'SELECT * FROM users'); +log(to_json(result)); +``` + +#### Defined in + +mysql.ts:109 + +___ + +### FingerprintMySQL + +▸ **FingerprintMySQL**(`host`, `port`): [`MySQLInfo`](/templates/protocols/javascript/modules/mysql.MySQLInfo) + +returns MySQLInfo when fingerpint is successful + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +[`MySQLInfo`](/templates/protocols/javascript/modules/mysql.MySQLInfo) + +**`Example`** + +```javascript +const mysql = require('nuclei/mysql'); +const info = mysql.FingerprintMySQL('acme.com', 3306); +log(to_json(info)); +``` + +#### Defined in + +mysql.ts:75 + +___ + +### IsMySQL + +▸ **IsMySQL**(`host`, `port`): `boolean` + +IsMySQL checks if the given host is running MySQL database. +If the host is running MySQL database, it returns true. +If the host is not running MySQL database, it returns false. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const mysql = require('nuclei/mysql'); +const isMySQL = mysql.IsMySQL('acme.com', 3306); +``` + +#### Defined in + +mysql.ts:44 diff --git a/templates/protocols/javascript/modules/mysql.MySQLInfo.mdx b/templates/protocols/javascript/modules/mysql.MySQLInfo.mdx new file mode 100644 index 0000000..39cd294 --- /dev/null +++ b/templates/protocols/javascript/modules/mysql.MySQLInfo.mdx @@ -0,0 +1,110 @@ +# Interface: MySQLInfo + +[mysql](/templates/protocols/javascript/modules/mysql).MySQLInfo + +MySQLInfo contains information about MySQL server. +this is returned when fingerprint is successful + +## Table of contents + +### Properties + +- [Debug](/templates/protocols/javascript/modules/mysql.MySQLInfo#debug) +- [Host](/templates/protocols/javascript/modules/mysql.MySQLInfo#host) +- [IP](/templates/protocols/javascript/modules/mysql.MySQLInfo#ip) +- [Port](/templates/protocols/javascript/modules/mysql.MySQLInfo#port) +- [Protocol](/templates/protocols/javascript/modules/mysql.MySQLInfo#protocol) +- [Raw](/templates/protocols/javascript/modules/mysql.MySQLInfo#raw) +- [TLS](/templates/protocols/javascript/modules/mysql.MySQLInfo#tls) +- [Transport](/templates/protocols/javascript/modules/mysql.MySQLInfo#transport) +- [Version](/templates/protocols/javascript/modules/mysql.MySQLInfo#version) + +## Properties + +### Debug + +• `Optional` **Debug**: [`ServiceMySQL`](/templates/protocols/javascript/modules/mysql.ServiceMySQL) + +#### Defined in + +mysql.ts:168 + +___ + +### Host + +• `Optional` **Host**: `string` + +#### Defined in + +mysql.ts:154 + +___ + +### IP + +• `Optional` **IP**: `string` + +#### Defined in + +mysql.ts:156 + +___ + +### Port + +• `Optional` **Port**: `number` + +#### Defined in + +mysql.ts:158 + +___ + +### Protocol + +• `Optional` **Protocol**: `string` + +#### Defined in + +mysql.ts:160 + +___ + +### Raw + +• `Optional` **Raw**: `string` + +#### Defined in + +mysql.ts:170 + +___ + +### TLS + +• `Optional` **TLS**: `boolean` + +#### Defined in + +mysql.ts:162 + +___ + +### Transport + +• `Optional` **Transport**: `string` + +#### Defined in + +mysql.ts:164 + +___ + +### Version + +• `Optional` **Version**: `string` + +#### Defined in + +mysql.ts:166 diff --git a/templates/protocols/javascript/modules/mysql.MySQLOptions.mdx b/templates/protocols/javascript/modules/mysql.MySQLOptions.mdx new file mode 100644 index 0000000..303762e --- /dev/null +++ b/templates/protocols/javascript/modules/mysql.MySQLOptions.mdx @@ -0,0 +1,108 @@ +# Interface: MySQLOptions + +[mysql](/templates/protocols/javascript/modules/mysql).MySQLOptions + +MySQLOptions defines the data source name (DSN) options required to connect to a MySQL database. +along with other options like Timeout etc + +**`Example`** + +```javascript +const mysql = require('nuclei/mysql'); +const options = new mysql.MySQLOptions(); +options.Host = 'acme.com'; +options.Port = 3306; +``` + +## Table of contents + +### Properties + +- [DbName](/templates/protocols/javascript/modules/mysql.MySQLOptions#dbname) +- [Host](/templates/protocols/javascript/modules/mysql.MySQLOptions#host) +- [Password](/templates/protocols/javascript/modules/mysql.MySQLOptions#password) +- [Port](/templates/protocols/javascript/modules/mysql.MySQLOptions#port) +- [Protocol](/templates/protocols/javascript/modules/mysql.MySQLOptions#protocol) +- [RawQuery](/templates/protocols/javascript/modules/mysql.MySQLOptions#rawquery) +- [Timeout](/templates/protocols/javascript/modules/mysql.MySQLOptions#timeout) +- [Username](/templates/protocols/javascript/modules/mysql.MySQLOptions#username) + +## Properties + +### DbName + +• `Optional` **DbName**: `string` + +#### Defined in + +mysql.ts:198 + +___ + +### Host + +• `Optional` **Host**: `string` + +#### Defined in + +mysql.ts:188 + +___ + +### Password + +• `Optional` **Password**: `string` + +#### Defined in + +mysql.ts:196 + +___ + +### Port + +• `Optional` **Port**: `number` + +#### Defined in + +mysql.ts:190 + +___ + +### Protocol + +• `Optional` **Protocol**: `string` + +#### Defined in + +mysql.ts:192 + +___ + +### RawQuery + +• `Optional` **RawQuery**: `string` + +#### Defined in + +mysql.ts:200 + +___ + +### Timeout + +• `Optional` **Timeout**: `number` + +#### Defined in + +mysql.ts:202 + +___ + +### Username + +• `Optional` **Username**: `string` + +#### Defined in + +mysql.ts:194 diff --git a/templates/protocols/javascript/modules/mysql.SQLResult.mdx b/templates/protocols/javascript/modules/mysql.SQLResult.mdx new file mode 100644 index 0000000..c7b0605 --- /dev/null +++ b/templates/protocols/javascript/modules/mysql.SQLResult.mdx @@ -0,0 +1,32 @@ +# Interface: SQLResult + +[mysql](/templates/protocols/javascript/modules/mysql).SQLResult + +SQLResult Interface + +## Table of contents + +### Properties + +- [Columns](/templates/protocols/javascript/modules/mysql.SQLResult#columns) +- [Count](/templates/protocols/javascript/modules/mysql.SQLResult#count) + +## Properties + +### Columns + +• `Optional` **Columns**: `string`[] + +#### Defined in + +mysql.ts:212 + +___ + +### Count + +• `Optional` **Count**: `number` + +#### Defined in + +mysql.ts:214 diff --git a/templates/protocols/javascript/modules/mysql.ServiceMySQL.mdx b/templates/protocols/javascript/modules/mysql.ServiceMySQL.mdx new file mode 100644 index 0000000..a2b16cf --- /dev/null +++ b/templates/protocols/javascript/modules/mysql.ServiceMySQL.mdx @@ -0,0 +1,43 @@ +# Interface: ServiceMySQL + +[mysql](/templates/protocols/javascript/modules/mysql).ServiceMySQL + +ServiceMySQL Interface + +## Table of contents + +### Properties + +- [ErrorCode](/templates/protocols/javascript/modules/mysql.ServiceMySQL#errorcode) +- [ErrorMessage](/templates/protocols/javascript/modules/mysql.ServiceMySQL#errormessage) +- [PacketType](/templates/protocols/javascript/modules/mysql.ServiceMySQL#packettype) + +## Properties + +### ErrorCode + +• `Optional` **ErrorCode**: `number` + +#### Defined in + +mysql.ts:224 + +___ + +### ErrorMessage + +• `Optional` **ErrorMessage**: `string` + +#### Defined in + +mysql.ts:228 + +___ + +### PacketType + +• `Optional` **PacketType**: `string` + +#### Defined in + +mysql.ts:226 diff --git a/templates/protocols/javascript/modules/mysql.mdx b/templates/protocols/javascript/modules/mysql.mdx index fa77720..a4ae910 100644 --- a/templates/protocols/javascript/modules/mysql.mdx +++ b/templates/protocols/javascript/modules/mysql.mdx @@ -1,125 +1,50 @@ - +# Namespace: mysql -## mysql +## Table of contents -* [mysql](#module_mysql) - * [`MySQLClient`](#module_mysql..MySQLClient) - * [`.Connect(host, port, username, password)`](#module_mysql..MySQLClient+Connect) ⇒ bool - * [`.ConnectWithDB(host, port, username, password, dbName)`](#module_mysql..MySQLClient+ConnectWithDB) ⇒ bool - * [`.ExecuteQuery(host, port, username, password, dbName, query)`](#module_mysql..MySQLClient+ExecuteQuery) ⇒ string - * [`.IsMySQL(host, port)`](#module_mysql..MySQLClient+IsMySQL) ⇒ bool +### Classes - +- [MySQLClient](/templates/protocols/javascript/modules/mysql.MySQLClient) -### (mysql).MySQLClient -MySQLClient is a client for MySQL database. Internally client uses go-sql-driver/mysql driver. +### Interfaces -**Kind**: inner class of [mysql](#module_mysql) +- [MySQLInfo](/templates/protocols/javascript/modules/mysql.MySQLInfo) +- [MySQLOptions](/templates/protocols/javascript/modules/mysql.MySQLOptions) +- [SQLResult](/templates/protocols/javascript/modules/mysql.SQLResult) +- [ServiceMySQL](/templates/protocols/javascript/modules/mysql.ServiceMySQL) -* [`MySQLClient`](#module_mysql..MySQLClient) - * [`.Connect(host, port, username, password)`](#module_mysql..MySQLClient+Connect) ⇒ bool - * [`.ConnectWithDB(host, port, username, password, dbName)`](#module_mysql..MySQLClient+ConnectWithDB) ⇒ bool - * [`.ExecuteQuery(host, port, username, password, dbName, query)`](#module_mysql..MySQLClient+ExecuteQuery) ⇒ string - * [`.IsMySQL(host, port)`](#module_mysql..MySQLClient+IsMySQL) ⇒ bool +### Functions - +- [BuildDSN](/templates/protocols/javascript/modules/mysql#builddsn) -#### mySQLClient.Connect(host, port, username, password) ⇒ bool -Connect connects to MySQL database using given credentials. If connection is successful, it returns true. If connection is unsuccessful, it returns false and error. The connection is closed after the function returns. +## Functions -**Kind**: instance method of [MySQLClient](#module_mysql..MySQLClient) -**Returns**: bool - - The result of the connection attempt. -**Throws**: +### BuildDSN -- error - The error encountered during connection attempt. +▸ **BuildDSN**(`opts`): `string` \| ``null`` +BuildDSN builds a MySQL data source name (DSN) from the given options. -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the MySQL database. | -| port | int | The port of the MySQL database. | -| username | string | The username to connect to the MySQL database. | -| password | string | The password to connect to the MySQL database. | +#### Parameters -**Example** -```js -let m = require('nuclei/mysql'); -let c = m.MySQLClient(); -let result = c.Connect('localhost', 3306, 'root', 'password'); -``` - - -#### mySQLClient.ConnectWithDB(host, port, username, password, dbName) ⇒ bool -ConnectWithDB connects to MySQL database using given credentials and database name. If connection is successful, it returns true. If connection is unsuccessful, it returns false and error. The connection is closed after the function returns. +| Name | Type | +| :------ | :------ | +| `opts` | [`MySQLOptions`](/templates/protocols/javascript/modules/mysql.MySQLOptions) | -**Kind**: instance method of [MySQLClient](#module_mysql..MySQLClient) -**Returns**: bool - - The result of the connection attempt. -**Throws**: +#### Returns -- error - The error encountered during connection attempt. +`string` \| ``null`` +**`Example`** -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the MySQL database. | -| port | int | The port of the MySQL database. | -| username | string | The username to connect to the MySQL database. | -| password | string | The password to connect to the MySQL database. | -| dbName | string | The name of the database to connect to. | - -**Example** -```js -let m = require('nuclei/mysql'); -let c = m.MySQLClient(); -let result = c.ConnectWithDB('localhost', 3306, 'root', 'password', 'mydb'); +```javascript +const mysql = require('nuclei/mysql'); +const options = new mysql.MySQLOptions(); +options.Host = 'acme.com'; +options.Port = 3306; +const dsn = mysql.BuildDSN(options); ``` - - -#### mySQLClient.ExecuteQuery(host, port, username, password, dbName, query) ⇒ string -ExecuteQuery connects to Mysql database using given credentials and database name and executes a query on the db. -**Kind**: instance method of [MySQLClient](#module_mysql..MySQLClient) -**Returns**: string - - The result of the query execution. -**Throws**: +#### Defined in -- error - The error encountered during query execution. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the MySQL database. | -| port | int | The port of the MySQL database. | -| username | string | The username to connect to the MySQL database. | -| password | string | The password to connect to the MySQL database. | -| dbName | string | The name of the database to connect to. | -| query | string | The query to execute on the database. | - -**Example** -```js -let m = require('nuclei/mysql'); -let c = m.MySQLClient(); -let result = c.ExecuteQuery('localhost', 3306, 'root', 'password', 'mydb', 'SELECT * FROM users'); -``` - - -#### mySQLClient.IsMySQL(host, port) ⇒ bool -IsMySQL checks if the given host is running MySQL database. If the host is running MySQL database, it returns true. If the host is not running MySQL database, it returns false. - -**Kind**: instance method of [MySQLClient](#module_mysql..MySQLClient) -**Returns**: bool - - The result of the check. -**Throws**: - -- error - The error encountered during the check. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check. | -| port | int | The port to check. | - -**Example** -```js -let m = require('nuclei/mysql'); -let c = m.MySQLClient(); -let result = c.IsMySQL('localhost', 3306); -``` +mysql.ts:14 diff --git a/templates/protocols/javascript/modules/net.NetConn.mdx b/templates/protocols/javascript/modules/net.NetConn.mdx new file mode 100644 index 0000000..8cdebe5 --- /dev/null +++ b/templates/protocols/javascript/modules/net.NetConn.mdx @@ -0,0 +1,318 @@ +# Class: NetConn + +[net](/templates/protocols/javascript/modules/net).NetConn + +NetConn is a connection to a remote host. +this is returned/create by Open and OpenTLS functions. + +**`Example`** + +```javascript +const net = require('nuclei/net'); +const conn = net.Open('tcp', 'acme.com:80'); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/net.NetConn#constructor) + +### Methods + +- [Close](/templates/protocols/javascript/modules/net.NetConn#close) +- [Recv](/templates/protocols/javascript/modules/net.NetConn#recv) +- [RecvHex](/templates/protocols/javascript/modules/net.NetConn#recvhex) +- [RecvPartial](/templates/protocols/javascript/modules/net.NetConn#recvpartial) +- [RecvString](/templates/protocols/javascript/modules/net.NetConn#recvstring) +- [Send](/templates/protocols/javascript/modules/net.NetConn#send) +- [SendArray](/templates/protocols/javascript/modules/net.NetConn#sendarray) +- [SendHex](/templates/protocols/javascript/modules/net.NetConn#sendhex) +- [SetTimeout](/templates/protocols/javascript/modules/net.NetConn#settimeout) + +## Constructors + +### constructor + +• **new NetConn**(): [`NetConn`](/templates/protocols/javascript/modules/net.NetConn) + +#### Returns + +[`NetConn`](/templates/protocols/javascript/modules/net.NetConn) + +#### Defined in + +net.ts:46 + +## Methods + +### Close + +▸ **Close**(): `void` + +Close closes the connection. + +#### Returns + +`void` + +**`Example`** + +```javascript +const net = require('nuclei/net'); +const conn = net.Open('tcp', 'acme.com:80'); +conn.Close(); +``` + +#### Defined in + +net.ts:56 + +___ + +### Recv + +▸ **Recv**(`N`): `Uint8Array` + +Recv receives data from the connection with a timeout. +If N is 0, it will read all data sent by the server with 8MB limit. +it tries to read until N bytes or timeout is reached. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `N` | `number` | + +#### Returns + +`Uint8Array` + +**`Example`** + +```javascript +const net = require('nuclei/net'); +const conn = net.Open('tcp', 'acme.com:80'); +const data = conn.Recv(1024); +``` + +#### Defined in + +net.ts:128 + +___ + +### RecvHex + +▸ **RecvHex**(`N`): `string` + +RecvHex receives data from the connection with a timeout +in hex format. +If N is 0,it will read all data sent by the server with 8MB limit. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `N` | `number` | + +#### Returns + +`string` + +**`Example`** + +```javascript +const net = require('nuclei/net'); +const conn = net.Open('tcp', 'acme.com:80'); +const data = conn.RecvHex(1024); +``` + +#### Defined in + +net.ts:177 + +___ + +### RecvPartial + +▸ **RecvPartial**(`N`): `Uint8Array` + +RecvPartial is similar to Recv but it does not perform full read instead +it creates a buffer of N bytes and returns whatever is returned by the connection +this is usually used when fingerprinting services to get initial bytes from the server. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `N` | `number` | + +#### Returns + +`Uint8Array` + +**`Example`** + +```javascript +const net = require('nuclei/net'); +const conn = net.Open('tcp', 'acme.com:80'); +const data = conn.RecvPartial(1024); +log(`Received ${data.length} bytes from the server`) +``` + +#### Defined in + +net.ts:145 + +___ + +### RecvString + +▸ **RecvString**(`N`): `string` + +RecvString receives data from the connection with a timeout +output is returned as a string. +If N is 0, it will read all data sent by the server with 8MB limit. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `N` | `number` | + +#### Returns + +`string` + +**`Example`** + +```javascript +const net = require('nuclei/net'); +const conn = net.Open('tcp', 'acme.com:80'); +const data = conn.RecvString(1024); +``` + +#### Defined in + +net.ts:161 + +___ + +### Send + +▸ **Send**(`data`): `void` + +Send sends data to the connection with a timeout. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `string` | + +#### Returns + +`void` + +**`Example`** + +```javascript +const net = require('nuclei/net'); +const conn = net.Open('tcp', 'acme.com:80'); +conn.Send('hello'); +``` + +#### Defined in + +net.ts:112 + +___ + +### SendArray + +▸ **SendArray**(`data`): `void` + +SendArray sends array data to connection + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `any` | + +#### Returns + +`void` + +**`Example`** + +```javascript +const net = require('nuclei/net'); +const conn = net.Open('tcp', 'acme.com:80'); +conn.SendArray(['hello', 'world']); +``` + +#### Defined in + +net.ts:84 + +___ + +### SendHex + +▸ **SendHex**(`data`): `void` + +SendHex sends hex data to connection + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `string` | + +#### Returns + +`void` + +**`Example`** + +```javascript +const net = require('nuclei/net'); +const conn = net.Open('tcp', 'acme.com:80'); +conn.SendHex('68656c6c6f'); +``` + +#### Defined in + +net.ts:98 + +___ + +### SetTimeout + +▸ **SetTimeout**(`value`): `void` + +SetTimeout sets read/write timeout for the connection (in seconds). + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value` | `number` | + +#### Returns + +`void` + +**`Example`** + +```javascript +const net = require('nuclei/net'); +const conn = net.Open('tcp', 'acme.com:80'); +conn.SetTimeout(10); +``` + +#### Defined in + +net.ts:70 diff --git a/templates/protocols/javascript/modules/net.mdx b/templates/protocols/javascript/modules/net.mdx index b998579..a0eb87f 100644 --- a/templates/protocols/javascript/modules/net.mdx +++ b/templates/protocols/javascript/modules/net.mdx @@ -1,240 +1,72 @@ - - -## net - -* [net](#module_net) - * [`NetConn`](#module_net..NetConn) - * [`.Close()`](#module_net..NetConn+Close) - * [`.Recv([N])`](#module_net..NetConn+Recv) ⇒ Uint8Array - * [`.RecvHex([N])`](#module_net..NetConn+RecvHex) ⇒ string - * [`.RecvString([N])`](#module_net..NetConn+RecvString) ⇒ string - * [`.Send(data)`](#module_net..NetConn+Send) - * [`.SendArray(data)`](#module_net..NetConn+SendArray) - * [`.SendHex(data)`](#module_net..NetConn+SendHex) - * [`.SetTimeout(value)`](#module_net..NetConn+SetTimeout) - * [`Open(protocol, address)`](#module_net..Open) ⇒ NetConn - * [`OpenTLS(protocol, address)`](#module_net..OpenTLS) ⇒ NetConn - - - -### (net).NetConn -NetConn is a connection to a remote host. - -**Kind**: inner class of [net](#module_net) - -* [`NetConn`](#module_net..NetConn) - * [`.Close()`](#module_net..NetConn+Close) - * [`.Recv([N])`](#module_net..NetConn+Recv) ⇒ Uint8Array - * [`.RecvHex([N])`](#module_net..NetConn+RecvHex) ⇒ string - * [`.RecvString([N])`](#module_net..NetConn+RecvString) ⇒ string - * [`.Send(data)`](#module_net..NetConn+Send) - * [`.SendArray(data)`](#module_net..NetConn+SendArray) - * [`.SendHex(data)`](#module_net..NetConn+SendHex) - * [`.SetTimeout(value)`](#module_net..NetConn+SetTimeout) - - - -#### netConn.Close() -Close closes the connection. - -**Kind**: instance method of [NetConn](#module_net..NetConn) -**Throws**: - -- error - The error encountered during connection closing. - -**Example** -```js -let m = require('nuclei/net'); -let c = m.Open('tcp', 'localhost:8080'); -c.Close(); -``` - - -#### netConn.Recv([N]) ⇒ Uint8Array -Recv receives data from the connection with a timeout. If N is 0, it will read all available data. - -**Kind**: instance method of [NetConn](#module_net..NetConn) -**Returns**: Uint8Array - - The received data in an array. -**Throws**: - -- error - The error encountered during data receiving. - - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| [N] | number | 0 | The number of bytes to receive. | - -**Example** -```js -let m = require('nuclei/net'); -let c = m.Open('tcp', 'localhost:8080'); -let data = c.Recv(1024); -``` - +# Namespace: net -#### netConn.RecvHex([N]) ⇒ string -RecvHex receives data from the connection with a timeout in hex format. If N is 0, it will read all available data. +## Table of contents -**Kind**: instance method of [NetConn](#module_net..NetConn) -**Returns**: string - - The received data in hex format. -**Throws**: +### Classes -- error - The error encountered during data receiving. +- [NetConn](/templates/protocols/javascript/modules/net.NetConn) +### Functions -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| [N] | number | 0 | The number of bytes to receive. | +- [Open](/templates/protocols/javascript/modules/net#open) +- [OpenTLS](/templates/protocols/javascript/modules/net#opentls) -**Example** -```js -let m = require('nuclei/net'); -let c = m.Open('tcp', 'localhost:8080'); -let data = c.RecvHex(1024); -``` - - -#### netConn.RecvString([N]) ⇒ string -RecvString receives data from the connection with a timeout. Output is returned as a string. If N is 0, it will read all available data. - -**Kind**: instance method of [NetConn](#module_net..NetConn) -**Returns**: string - - The received data as a string. -**Throws**: - -- error - The error encountered during data receiving. +## Functions +### Open -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| [N] | number | 0 | The number of bytes to receive. | +▸ **Open**(`protocol`): [`NetConn`](/templates/protocols/javascript/modules/net.NetConn) \| ``null`` -**Example** -```js -let m = require('nuclei/net'); -let c = m.Open('tcp', 'localhost:8080'); -let data = c.RecvString(1024); -``` - +Open opens a new connection to the address with a timeout. +supported protocols: tcp, udp -#### netConn.Send(data) -Send sends data to the connection with a timeout. +#### Parameters -**Kind**: instance method of [NetConn](#module_net..NetConn) -**Throws**: +| Name | Type | +| :------ | :------ | +| `protocol` | `string` | -- error - The error encountered during data sending. +#### Returns +[`NetConn`](/templates/protocols/javascript/modules/net.NetConn) \| ``null`` -| Param | Type | Description | -| --- | --- | --- | -| data | Uint8Array | The data to send. | +**`Example`** -**Example** -```js -let m = require('nuclei/net'); -let c = m.Open('tcp', 'localhost:8080'); -c.Send(new Uint8Array([1, 2, 3])); +```javascript +const net = require('nuclei/net'); +const conn = net.Open('tcp', 'acme.com:80'); ``` - -#### netConn.SendArray(data) -SendArray sends array data to connection. +#### Defined in -**Kind**: instance method of [NetConn](#module_net..NetConn) -**Throws**: +net.ts:12 -- error - The error encountered during data sending. +___ +### OpenTLS -| Param | Type | Description | -| --- | --- | --- | -| data | Uint8Array | The array data to send. | +▸ **OpenTLS**(`protocol`): [`NetConn`](/templates/protocols/javascript/modules/net.NetConn) \| ``null`` -**Example** -```js -let m = require('nuclei/net'); -let c = m.Open('tcp', 'localhost:8080'); -c.SendArray(new Uint8Array([1, 2, 3])); -``` - +Open opens a new connection to the address with a timeout. +supported protocols: tcp, udp -#### netConn.SendHex(data) -SendHex sends hex data to connection. +#### Parameters -**Kind**: instance method of [NetConn](#module_net..NetConn) -**Throws**: +| Name | Type | +| :------ | :------ | +| `protocol` | `string` | -- error - The error encountered during data sending. +#### Returns +[`NetConn`](/templates/protocols/javascript/modules/net.NetConn) \| ``null`` -| Param | Type | Description | -| --- | --- | --- | -| data | string | The hex data to send. | +**`Example`** -**Example** -```js -let m = require('nuclei/net'); -let c = m.Open('tcp', 'localhost:8080'); -c.SendHex('0x123'); +```javascript +const net = require('nuclei/net'); +const conn = net.OpenTLS('tcp', 'acme.com:443'); ``` - - -#### netConn.SetTimeout(value) -SetTimeout sets read/write timeout for the connection (in seconds). - -**Kind**: instance method of [NetConn](#module_net..NetConn) -| Param | Type | Description | -| --- | --- | --- | -| value | number | The timeout value in seconds. | +#### Defined in -**Example** -```js -let m = require('nuclei/net'); -let c = m.Open('tcp', 'localhost:8080'); -c.SetTimeout(5); -``` - - -### (net).Open(protocol, address) ⇒ NetConn -Open opens a new connection to the address with a timeout. Supported protocols: tcp, udp. - -**Kind**: inner method of [net](#module_net) -**Returns**: NetConn - - The NetConn object representing the connection. -**Throws**: - -- error - The error encountered during connection opening. - - -| Param | Type | Description | -| --- | --- | --- | -| protocol | string | The protocol to use. | -| address | string | The address to connect to. | - -**Example** -```js -let m = require('nuclei/net'); -let conn = m.Open('tcp', 'localhost:8080'); -``` - - -### (net).OpenTLS(protocol, address) ⇒ NetConn -OpenTLS opens a new connection to the address with a timeout. Supported protocols: tcp, udp. - -**Kind**: inner method of [net](#module_net) -**Returns**: NetConn - - The NetConn object representing the connection. -**Throws**: - -- error - The error encountered during connection opening. - - -| Param | Type | Description | -| --- | --- | --- | -| protocol | string | The protocol to use. | -| address | string | The address to connect to. | - -**Example** -```js -let m = require('nuclei/net'); -let conn = m.OpenTLS('tcp', 'localhost:8080'); -``` +net.ts:27 diff --git a/templates/protocols/javascript/modules/oracle.IsOracleResponse.mdx b/templates/protocols/javascript/modules/oracle.IsOracleResponse.mdx new file mode 100644 index 0000000..61c3aab --- /dev/null +++ b/templates/protocols/javascript/modules/oracle.IsOracleResponse.mdx @@ -0,0 +1,40 @@ +# Interface: IsOracleResponse + +[oracle](/templates/protocols/javascript/modules/oracle).IsOracleResponse + +IsOracleResponse is the response from the IsOracle function. +this is returned by IsOracle function. + +**`Example`** + +```javascript +const oracle = require('nuclei/oracle'); +const isOracle = oracle.IsOracle('acme.com', 1521); +``` + +## Table of contents + +### Properties + +- [Banner](/templates/protocols/javascript/modules/oracle.IsOracleResponse#banner) +- [IsOracle](/templates/protocols/javascript/modules/oracle.IsOracleResponse#isoracle) + +## Properties + +### Banner + +• `Optional` **Banner**: `string` + +#### Defined in + +oracle.ts:47 + +___ + +### IsOracle + +• `Optional` **IsOracle**: `boolean` + +#### Defined in + +oracle.ts:45 diff --git a/templates/protocols/javascript/modules/oracle.OracleClient.mdx b/templates/protocols/javascript/modules/oracle.OracleClient.mdx new file mode 100644 index 0000000..1566db4 --- /dev/null +++ b/templates/protocols/javascript/modules/oracle.OracleClient.mdx @@ -0,0 +1,67 @@ +# Class: OracleClient + +[oracle](/templates/protocols/javascript/modules/oracle).OracleClient + +OracleClient is a minimal Oracle client for nuclei scripts. + +**`Example`** + +```javascript +const oracle = require('nuclei/oracle'); +const client = new oracle.Client(); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/oracle.OracleClient#constructor) + +### Methods + +- [IsOracle](/templates/protocols/javascript/modules/oracle.OracleClient#isoracle) + +## Constructors + +### constructor + +• **new OracleClient**(): [`OracleClient`](/templates/protocols/javascript/modules/oracle.OracleClient) + +#### Returns + +[`OracleClient`](/templates/protocols/javascript/modules/oracle.OracleClient) + +#### Defined in + +oracle.ts:15 + +## Methods + +### IsOracle + +▸ **IsOracle**(`host`, `port`): [`IsOracleResponse`](/templates/protocols/javascript/modules/oracle.IsOracleResponse) + +IsOracle checks if a host is running an Oracle server + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +[`IsOracleResponse`](/templates/protocols/javascript/modules/oracle.IsOracleResponse) + +**`Example`** + +```javascript +const oracle = require('nuclei/oracle'); +const isOracle = oracle.IsOracle('acme.com', 1521); +log(toJSON(isOracle)); +``` + +#### Defined in + +oracle.ts:25 diff --git a/templates/protocols/javascript/modules/oracle.mdx b/templates/protocols/javascript/modules/oracle.mdx index 6d64529..31e7ecc 100644 --- a/templates/protocols/javascript/modules/oracle.mdx +++ b/templates/protocols/javascript/modules/oracle.mdx @@ -1,44 +1,11 @@ - +# Namespace: oracle -## oracle +## Table of contents -* [oracle](#module_oracle) - * [`OracleClient`](#module_oracle..OracleClient) - * [`.IsOracle(host, port)`](#module_oracle..OracleClient+IsOracle) ⇒ IsOracleResponse - * [`IsOracleResponse`](#module_oracle..IsOracleResponse) : object +### Classes - +- [OracleClient](/templates/protocols/javascript/modules/oracle.OracleClient) -### (oracle).OracleClient -OracleClient is a minimal Oracle client for nuclei scripts. +### Interfaces -**Kind**: inner class of [oracle](#module_oracle) - - -#### oracleClient.IsOracle(host, port) ⇒ IsOracleResponse -IsOracle checks if a host is running an Oracle server. - -**Kind**: instance method of [OracleClient](#module_oracle..OracleClient) -**Returns**: IsOracleResponse - - The response from the Oracle server. -**Throws**: - -- error - The error encountered during the check. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check. | -| port | int | The port to check. | - -**Example** -```js -let m = require('nuclei/oracle'); -let c = m.OracleClient(); -let response = c.IsOracle('localhost', 1521); -``` - - -### (oracle).IsOracleResponse : object -IsOracleResponse is an object containing the response from the Oracle server. - -**Kind**: inner typedef of [oracle](#module_oracle) +- [IsOracleResponse](/templates/protocols/javascript/modules/oracle.IsOracleResponse) diff --git a/templates/protocols/javascript/modules/pop3.IsPOP3Response.mdx b/templates/protocols/javascript/modules/pop3.IsPOP3Response.mdx new file mode 100644 index 0000000..366487d --- /dev/null +++ b/templates/protocols/javascript/modules/pop3.IsPOP3Response.mdx @@ -0,0 +1,41 @@ +# Interface: IsPOP3Response + +[pop3](/templates/protocols/javascript/modules/pop3).IsPOP3Response + +IsPOP3Response is the response from the IsPOP3 function. +this is returned by IsPOP3 function. + +**`Example`** + +```javascript +const pop3 = require('nuclei/pop3'); +const isPOP3 = pop3.IsPOP3('acme.com', 110); +log(toJSON(isPOP3)); +``` + +## Table of contents + +### Properties + +- [Banner](/templates/protocols/javascript/modules/pop3.IsPOP3Response#banner) +- [IsPOP3](/templates/protocols/javascript/modules/pop3.IsPOP3Response#ispop3) + +## Properties + +### Banner + +• `Optional` **Banner**: `string` + +#### Defined in + +pop3.ts:48 + +___ + +### IsPOP3 + +• `Optional` **IsPOP3**: `boolean` + +#### Defined in + +pop3.ts:46 diff --git a/templates/protocols/javascript/modules/pop3.Pop3Client.mdx b/templates/protocols/javascript/modules/pop3.Pop3Client.mdx new file mode 100644 index 0000000..def3dab --- /dev/null +++ b/templates/protocols/javascript/modules/pop3.Pop3Client.mdx @@ -0,0 +1,67 @@ +# Class: Pop3Client + +[pop3](/templates/protocols/javascript/modules/pop3).Pop3Client + +Pop3Client is a minimal POP3 client for nuclei scripts. + +**`Example`** + +```javascript +const pop3 = require('nuclei/pop3'); +const client = new pop3.Client(); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/pop3.Pop3Client#constructor) + +### Methods + +- [IsPOP3](/templates/protocols/javascript/modules/pop3.Pop3Client#ispop3) + +## Constructors + +### constructor + +• **new Pop3Client**(): [`Pop3Client`](/templates/protocols/javascript/modules/pop3.Pop3Client) + +#### Returns + +[`Pop3Client`](/templates/protocols/javascript/modules/pop3.Pop3Client) + +#### Defined in + +pop3.ts:15 + +## Methods + +### IsPOP3 + +▸ **IsPOP3**(`host`, `port`): [`IsPOP3Response`](/templates/protocols/javascript/modules/pop3.IsPOP3Response) + +IsPOP3 checks if a host is running a POP3 server. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +[`IsPOP3Response`](/templates/protocols/javascript/modules/pop3.IsPOP3Response) + +**`Example`** + +```javascript +const pop3 = require('nuclei/pop3'); +const isPOP3 = pop3.IsPOP3('acme.com', 110); +log(toJSON(isPOP3)); +``` + +#### Defined in + +pop3.ts:25 diff --git a/templates/protocols/javascript/modules/pop3.mdx b/templates/protocols/javascript/modules/pop3.mdx index d9c8c6e..8059cea 100644 --- a/templates/protocols/javascript/modules/pop3.mdx +++ b/templates/protocols/javascript/modules/pop3.mdx @@ -1,44 +1,11 @@ - +# Namespace: pop3 -## pop3 +## Table of contents -* [pop3](#module_pop3) - * [`Pop3Client`](#module_pop3..Pop3Client) - * [`.IsPOP3(host, port)`](#module_pop3..Pop3Client+IsPOP3) ⇒ IsPOP3Response - * [`IsPOP3Response`](#module_pop3..IsPOP3Response) : object +### Classes - +- [Pop3Client](/templates/protocols/javascript/modules/pop3.Pop3Client) -### (pop3).Pop3Client -Pop3Client is a minimal POP3 client for nuclei scripts +### Interfaces -**Kind**: inner class of [pop3](#module_pop3) - - -#### pop3Client.IsPOP3(host, port) ⇒ IsPOP3Response -IsPOP3 checks if a host is running a POP3 server - -**Kind**: instance method of [Pop3Client](#module_pop3..Pop3Client) -**Returns**: IsPOP3Response - - The response of the check. -**Throws**: - -- error - The error encountered during the check. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check. | -| port | number | The port to check. | - -**Example** -```js -let m = require('nuclei/pop3'); -let c = m.Pop3Client(); -let response = c.IsPOP3('localhost', 110); -``` - - -### (pop3).IsPOP3Response : object -IsPOP3Response is an object containing the response of the IsPOP3 check. - -**Kind**: inner typedef of [pop3](#module_pop3) +- [IsPOP3Response](/templates/protocols/javascript/modules/pop3.IsPOP3Response) diff --git a/templates/protocols/javascript/modules/postgres.PGClient.mdx b/templates/protocols/javascript/modules/postgres.PGClient.mdx new file mode 100644 index 0000000..f544fd6 --- /dev/null +++ b/templates/protocols/javascript/modules/postgres.PGClient.mdx @@ -0,0 +1,177 @@ +# Class: PGClient + +[postgres](/templates/protocols/javascript/modules/postgres).PGClient + +PGClient is a client for Postgres database. +Internally client uses go-pg/pg driver. + +**`Example`** + +```javascript +const postgres = require('nuclei/postgres'); +const client = new postgres.Client(); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/postgres.PGClient#constructor) + +### Methods + +- [Connect](/templates/protocols/javascript/modules/postgres.PGClient#connect) +- [ConnectWithDB](/templates/protocols/javascript/modules/postgres.PGClient#connectwithdb) +- [ExecuteQuery](/templates/protocols/javascript/modules/postgres.PGClient#executequery) +- [IsPostgres](/templates/protocols/javascript/modules/postgres.PGClient#ispostgres) + +## Constructors + +### constructor + +• **new PGClient**(): [`PGClient`](/templates/protocols/javascript/modules/postgres.PGClient) + +#### Returns + +[`PGClient`](/templates/protocols/javascript/modules/postgres.PGClient) + +#### Defined in + +postgres.ts:16 + +## Methods + +### Connect + +▸ **Connect**(`host`, `port`, `username`): `boolean` + +Connect connects to Postgres database using given credentials. +If connection is successful, it returns true. +If connection is unsuccessful, it returns false and error. +The connection is closed after the function returns. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `username` | `string` | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const postgres = require('nuclei/postgres'); +const client = new postgres.Client(); +const connected = client.Connect('acme.com', 5432, 'username', 'password'); +``` + +#### Defined in + +postgres.ts:44 + +___ + +### ConnectWithDB + +▸ **ConnectWithDB**(`host`, `port`, `username`): `boolean` + +ConnectWithDB connects to Postgres database using given credentials and database name. +If connection is successful, it returns true. +If connection is unsuccessful, it returns false and error. +The connection is closed after the function returns. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `username` | `string` | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const postgres = require('nuclei/postgres'); +const client = new postgres.Client(); +const connected = client.ConnectWithDB('acme.com', 5432, 'username', 'password', 'dbname'); +``` + +#### Defined in + +postgres.ts:78 + +___ + +### ExecuteQuery + +▸ **ExecuteQuery**(`host`, `port`, `username`): [`SQLResult`](/templates/protocols/javascript/modules/postgres.SQLResult) + +ExecuteQuery connects to Postgres database using given credentials and database name. +and executes a query on the db. +If connection is successful, it returns the result of the query. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `username` | `string` | + +#### Returns + +[`SQLResult`](/templates/protocols/javascript/modules/postgres.SQLResult) + +**`Example`** + +```javascript +const postgres = require('nuclei/postgres'); +const client = new postgres.Client(); +const result = client.ExecuteQuery('acme.com', 5432, 'username', 'password', 'dbname', 'select * from users'); +log(to_json(result)); +``` + +#### Defined in + +postgres.ts:61 + +___ + +### IsPostgres + +▸ **IsPostgres**(`host`, `port`): `boolean` + +IsPostgres checks if the given host and port are running Postgres database. +If connection is successful, it returns true. +If connection is unsuccessful, it returns false and error. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const postgres = require('nuclei/postgres'); +const isPostgres = postgres.IsPostgres('acme.com', 5432); +``` + +#### Defined in + +postgres.ts:27 diff --git a/templates/protocols/javascript/modules/postgres.SQLResult.mdx b/templates/protocols/javascript/modules/postgres.SQLResult.mdx new file mode 100644 index 0000000..13c5b41 --- /dev/null +++ b/templates/protocols/javascript/modules/postgres.SQLResult.mdx @@ -0,0 +1,32 @@ +# Interface: SQLResult + +[postgres](/templates/protocols/javascript/modules/postgres).SQLResult + +SQLResult Interface + +## Table of contents + +### Properties + +- [Columns](/templates/protocols/javascript/modules/postgres.SQLResult#columns) +- [Count](/templates/protocols/javascript/modules/postgres.SQLResult#count) + +## Properties + +### Columns + +• `Optional` **Columns**: `string`[] + +#### Defined in + +postgres.ts:94 + +___ + +### Count + +• `Optional` **Count**: `number` + +#### Defined in + +postgres.ts:92 diff --git a/templates/protocols/javascript/modules/postgres.mdx b/templates/protocols/javascript/modules/postgres.mdx index ee82157..936520e 100644 --- a/templates/protocols/javascript/modules/postgres.mdx +++ b/templates/protocols/javascript/modules/postgres.mdx @@ -1,125 +1,11 @@ - +# Namespace: postgres -## postgres +## Table of contents -* [postgres](#module_postgres) - * [`PGClient`](#module_postgres..PGClient) - * [`.Connect(host, port, username, password)`](#module_postgres..PGClient+Connect) ⇒ bool - * [`.ConnectWithDB(host, port, username, password, dbName)`](#module_postgres..PGClient+ConnectWithDB) ⇒ bool - * [`.ExecuteQuery(host, port, username, password, dbName, query)`](#module_postgres..PGClient+ExecuteQuery) ⇒ string - * [`.IsPostgres(host, port)`](#module_postgres..PGClient+IsPostgres) ⇒ bool +### Classes - +- [PGClient](/templates/protocols/javascript/modules/postgres.PGClient) -### (postgres).PGClient -PGClient is a client for Postgres database. Internally client uses go-pg/pg driver. +### Interfaces -**Kind**: inner class of [postgres](#module_postgres) - -* [`PGClient`](#module_postgres..PGClient) - * [`.Connect(host, port, username, password)`](#module_postgres..PGClient+Connect) ⇒ bool - * [`.ConnectWithDB(host, port, username, password, dbName)`](#module_postgres..PGClient+ConnectWithDB) ⇒ bool - * [`.ExecuteQuery(host, port, username, password, dbName, query)`](#module_postgres..PGClient+ExecuteQuery) ⇒ string - * [`.IsPostgres(host, port)`](#module_postgres..PGClient+IsPostgres) ⇒ bool - - - -#### pgClient.Connect(host, port, username, password) ⇒ bool -Connect connects to Postgres database using given credentials. The connection is closed after the function returns. - -**Kind**: instance method of [PGClient](#module_postgres..PGClient) -**Returns**: bool - - If connection is successful, it returns true. -**Throws**: - -- error - If connection is unsuccessful, it returns the error. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the Postgres database. | -| port | int | The port of the Postgres database. | -| username | string | The username to connect to the Postgres database. | -| password | string | The password to connect to the Postgres database. | - -**Example** -```js -let m = require('nuclei/postgres'); -let c = m.PGClient(); -let isConnected = c.Connect('localhost', 5432, 'username', 'password'); -``` - - -#### pgClient.ConnectWithDB(host, port, username, password, dbName) ⇒ bool -ConnectWithDB connects to Postgres database using given credentials and database name. The connection is closed after the function returns. - -**Kind**: instance method of [PGClient](#module_postgres..PGClient) -**Returns**: bool - - If connection is successful, it returns true. -**Throws**: - -- error - If connection is unsuccessful, it returns the error. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the Postgres database. | -| port | int | The port of the Postgres database. | -| username | string | The username to connect to the Postgres database. | -| password | string | The password to connect to the Postgres database. | -| dbName | string | The name of the database to connect to. | - -**Example** -```js -let m = require('nuclei/postgres'); -let c = m.PGClient(); -let isConnected = c.ConnectWithDB('localhost', 5432, 'username', 'password', 'mydb'); -``` - - -#### pgClient.ExecuteQuery(host, port, username, password, dbName, query) ⇒ string -ExecuteQuery connects to Postgres database using given credentials and database name and executes a query on the db. - -**Kind**: instance method of [PGClient](#module_postgres..PGClient) -**Returns**: string - - The result of the query execution. -**Throws**: - -- error - If query execution is unsuccessful, it returns the error. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the Postgres database. | -| port | int | The port of the Postgres database. | -| username | string | The username to connect to the Postgres database. | -| password | string | The password to connect to the Postgres database. | -| dbName | string | The name of the database to connect to. | -| query | string | The query to execute on the database. | - -**Example** -```js -let m = require('nuclei/postgres'); -let c = m.PGClient(); -let result = c.ExecuteQuery('localhost', 5432, 'username', 'password', 'mydb', 'SELECT * FROM users'); -``` - - -#### pgClient.IsPostgres(host, port) ⇒ bool -IsPostgres checks if the given host and port are running Postgres database. - -**Kind**: instance method of [PGClient](#module_postgres..PGClient) -**Returns**: bool - - If the host and port are running Postgres database, it returns true. -**Throws**: - -- error - If the check is unsuccessful, it returns the error. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check. | -| port | int | The port to check. | - -**Example** -```js -let m = require('nuclei/postgres'); -let c = m.PGClient(); -let isPostgres = c.IsPostgres('localhost', 5432); -``` +- [SQLResult](/templates/protocols/javascript/modules/postgres.SQLResult) diff --git a/templates/protocols/javascript/modules/rdp.CheckRDPAuthResponse.mdx b/templates/protocols/javascript/modules/rdp.CheckRDPAuthResponse.mdx new file mode 100644 index 0000000..3b5d5e1 --- /dev/null +++ b/templates/protocols/javascript/modules/rdp.CheckRDPAuthResponse.mdx @@ -0,0 +1,41 @@ +# Interface: CheckRDPAuthResponse + +[rdp](/templates/protocols/javascript/modules/rdp).CheckRDPAuthResponse + +CheckRDPAuthResponse is the response from the CheckRDPAuth function. +this is returned by CheckRDPAuth function. + +**`Example`** + +```javascript +const rdp = require('nuclei/rdp'); +const checkRDPAuth = rdp.CheckRDPAuth('acme.com', 3389); +log(toJSON(checkRDPAuth)); +``` + +## Table of contents + +### Properties + +- [Auth](/templates/protocols/javascript/modules/rdp.CheckRDPAuthResponse#auth) +- [PluginInfo](/templates/protocols/javascript/modules/rdp.CheckRDPAuthResponse#plugininfo) + +## Properties + +### Auth + +• `Optional` **Auth**: `boolean` + +#### Defined in + +rdp.ts:67 + +___ + +### PluginInfo + +• `Optional` **PluginInfo**: [`ServiceRDP`](/templates/protocols/javascript/modules/rdp.ServiceRDP) + +#### Defined in + +rdp.ts:65 diff --git a/templates/protocols/javascript/modules/rdp.IsRDPResponse.mdx b/templates/protocols/javascript/modules/rdp.IsRDPResponse.mdx new file mode 100644 index 0000000..1879a0d --- /dev/null +++ b/templates/protocols/javascript/modules/rdp.IsRDPResponse.mdx @@ -0,0 +1,41 @@ +# Interface: IsRDPResponse + +[rdp](/templates/protocols/javascript/modules/rdp).IsRDPResponse + +IsRDPResponse is the response from the IsRDP function. +this is returned by IsRDP function. + +**`Example`** + +```javascript +const rdp = require('nuclei/rdp'); +const isRDP = rdp.IsRDP('acme.com', 3389); +log(toJSON(isRDP)); +``` + +## Table of contents + +### Properties + +- [IsRDP](/templates/protocols/javascript/modules/rdp.IsRDPResponse#isrdp) +- [OS](/templates/protocols/javascript/modules/rdp.IsRDPResponse#os) + +## Properties + +### IsRDP + +• `Optional` **IsRDP**: `boolean` + +#### Defined in + +rdp.ts:84 + +___ + +### OS + +• `Optional` **OS**: `string` + +#### Defined in + +rdp.ts:86 diff --git a/templates/protocols/javascript/modules/rdp.RDPClient.mdx b/templates/protocols/javascript/modules/rdp.RDPClient.mdx new file mode 100644 index 0000000..99db7ef --- /dev/null +++ b/templates/protocols/javascript/modules/rdp.RDPClient.mdx @@ -0,0 +1,104 @@ +# Class: RDPClient + +[rdp](/templates/protocols/javascript/modules/rdp).RDPClient + +RDPClient is a minimal RDP client for nuclei scripts. + +**`Example`** + +```javascript +const rdp = require('nuclei/rdp'); +const client = new rdp.Client(); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/rdp.RDPClient#constructor) + +### Methods + +- [CheckRDPAuth](/templates/protocols/javascript/modules/rdp.RDPClient#checkrdpauth) +- [IsRDP](/templates/protocols/javascript/modules/rdp.RDPClient#isrdp) + +## Constructors + +### constructor + +• **new RDPClient**(): [`RDPClient`](/templates/protocols/javascript/modules/rdp.RDPClient) + +#### Returns + +[`RDPClient`](/templates/protocols/javascript/modules/rdp.RDPClient) + +#### Defined in + +rdp.ts:15 + +## Methods + +### CheckRDPAuth + +▸ **CheckRDPAuth**(`host`, `port`): [`CheckRDPAuthResponse`](/templates/protocols/javascript/modules/rdp.CheckRDPAuthResponse) + +CheckRDPAuth checks if the given host and port are running rdp server +with authentication and returns their metadata. +If connection is successful, it returns true. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +[`CheckRDPAuthResponse`](/templates/protocols/javascript/modules/rdp.CheckRDPAuthResponse) + +**`Example`** + +```javascript +const rdp = require('nuclei/rdp'); +const checkRDPAuth = rdp.CheckRDPAuth('acme.com', 3389); +log(toJSON(checkRDPAuth)); +``` + +#### Defined in + +rdp.ts:44 + +___ + +### IsRDP + +▸ **IsRDP**(`host`, `port`): [`IsRDPResponse`](/templates/protocols/javascript/modules/rdp.IsRDPResponse) + +IsRDP checks if the given host and port are running rdp server. +If connection is successful, it returns true. +If connection is unsuccessful, it returns false and error. +The Name of the OS is also returned if the connection is successful. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +[`IsRDPResponse`](/templates/protocols/javascript/modules/rdp.IsRDPResponse) + +**`Example`** + +```javascript +const rdp = require('nuclei/rdp'); +const isRDP = rdp.IsRDP('acme.com', 3389); +log(toJSON(isRDP)); +``` + +#### Defined in + +rdp.ts:28 diff --git a/templates/protocols/javascript/modules/rdp.ServiceRDP.mdx b/templates/protocols/javascript/modules/rdp.ServiceRDP.mdx new file mode 100644 index 0000000..45a3b7b --- /dev/null +++ b/templates/protocols/javascript/modules/rdp.ServiceRDP.mdx @@ -0,0 +1,98 @@ +# Interface: ServiceRDP + +[rdp](/templates/protocols/javascript/modules/rdp).ServiceRDP + +ServiceRDP Interface + +## Table of contents + +### Properties + +- [DNSComputerName](/templates/protocols/javascript/modules/rdp.ServiceRDP#dnscomputername) +- [DNSDomainName](/templates/protocols/javascript/modules/rdp.ServiceRDP#dnsdomainname) +- [ForestName](/templates/protocols/javascript/modules/rdp.ServiceRDP#forestname) +- [NetBIOSComputerName](/templates/protocols/javascript/modules/rdp.ServiceRDP#netbioscomputername) +- [NetBIOSDomainName](/templates/protocols/javascript/modules/rdp.ServiceRDP#netbiosdomainname) +- [OSFingerprint](/templates/protocols/javascript/modules/rdp.ServiceRDP#osfingerprint) +- [OSVersion](/templates/protocols/javascript/modules/rdp.ServiceRDP#osversion) +- [TargetName](/templates/protocols/javascript/modules/rdp.ServiceRDP#targetname) + +## Properties + +### DNSComputerName + +• `Optional` **DNSComputerName**: `string` + +#### Defined in + +rdp.ts:102 + +___ + +### DNSDomainName + +• `Optional` **DNSDomainName**: `string` + +#### Defined in + +rdp.ts:104 + +___ + +### ForestName + +• `Optional` **ForestName**: `string` + +#### Defined in + +rdp.ts:106 + +___ + +### NetBIOSComputerName + +• `Optional` **NetBIOSComputerName**: `string` + +#### Defined in + +rdp.ts:98 + +___ + +### NetBIOSDomainName + +• `Optional` **NetBIOSDomainName**: `string` + +#### Defined in + +rdp.ts:100 + +___ + +### OSFingerprint + +• `Optional` **OSFingerprint**: `string` + +#### Defined in + +rdp.ts:108 + +___ + +### OSVersion + +• `Optional` **OSVersion**: `string` + +#### Defined in + +rdp.ts:110 + +___ + +### TargetName + +• `Optional` **TargetName**: `string` + +#### Defined in + +rdp.ts:96 diff --git a/templates/protocols/javascript/modules/rdp.mdx b/templates/protocols/javascript/modules/rdp.mdx index fefd4d7..5b694cf 100644 --- a/templates/protocols/javascript/modules/rdp.mdx +++ b/templates/protocols/javascript/modules/rdp.mdx @@ -1,80 +1,13 @@ - +# Namespace: rdp -## rdp +## Table of contents -* [rdp](#module_rdp) - * [`RDPClient`](#module_rdp..RDPClient) - * [`.CheckRDPAuth(host, port)`](#module_rdp..RDPClient+CheckRDPAuth) ⇒ CheckRDPAuthResponse - * [`.IsRDP(host, port)`](#module_rdp..RDPClient+IsRDP) ⇒ IsRDPResponse - * [`CheckRDPAuthResponse`](#module_rdp..CheckRDPAuthResponse) : object - * [`IsRDPResponse`](#module_rdp..IsRDPResponse) : object +### Classes - +- [RDPClient](/templates/protocols/javascript/modules/rdp.RDPClient) -### (rdp).RDPClient -RDPClient is a client for rdp servers +### Interfaces -**Kind**: inner class of [rdp](#module_rdp) - -* [`RDPClient`](#module_rdp..RDPClient) - * [`.CheckRDPAuth(host, port)`](#module_rdp..RDPClient+CheckRDPAuth) ⇒ CheckRDPAuthResponse - * [`.IsRDP(host, port)`](#module_rdp..RDPClient+IsRDP) ⇒ IsRDPResponse - - - -#### rdpClient.CheckRDPAuth(host, port) ⇒ CheckRDPAuthResponse -CheckRDPAuth checks if the given host and port are running rdp server with authentication and returns their metadata. - -**Kind**: instance method of [RDPClient](#module_rdp..RDPClient) -**Returns**: CheckRDPAuthResponse - - The response from the check. -**Throws**: - -- error - The error encountered during the check. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check. | -| port | number | The port to check. | - -**Example** -```js -let m = require('nuclei/rdp'); -let c = m.RDPClient(); -let response = c.CheckRDPAuth('localhost', 3389); -``` - - -#### rdpClient.IsRDP(host, port) ⇒ IsRDPResponse -IsRDP checks if the given host and port are running rdp server. If connection is successful, it returns true. If connection is unsuccessful, it returns false and error. The Name of the OS is also returned if the connection is successful. - -**Kind**: instance method of [RDPClient](#module_rdp..RDPClient) -**Returns**: IsRDPResponse - - The response from the check. -**Throws**: - -- error - The error encountered during the check. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check. | -| port | number | The port to check. | - -**Example** -```js -let m = require('nuclei/rdp'); -let c = m.RDPClient(); -let response = c.IsRDP('localhost', 3389); -``` - - -### (rdp).CheckRDPAuthResponse : object -CheckRDPAuthResponse is the response from the CheckRDPAuth method. - -**Kind**: inner typedef of [rdp](#module_rdp) - - -### (rdp).IsRDPResponse : object -IsRDPResponse is the response from the IsRDP method. - -**Kind**: inner typedef of [rdp](#module_rdp) +- [CheckRDPAuthResponse](/templates/protocols/javascript/modules/rdp.CheckRDPAuthResponse) +- [IsRDPResponse](/templates/protocols/javascript/modules/rdp.IsRDPResponse) +- [ServiceRDP](/templates/protocols/javascript/modules/rdp.ServiceRDP) diff --git a/templates/protocols/javascript/modules/redis.mdx b/templates/protocols/javascript/modules/redis.mdx index c1dc4ee..10302e4 100644 --- a/templates/protocols/javascript/modules/redis.mdx +++ b/templates/protocols/javascript/modules/redis.mdx @@ -1,124 +1,165 @@ - +# Namespace: redis -## redis +## Table of contents -* [redis](#module_redis) - * [`Connect(host, port, password)`](#module_redis..Connect) ⇒ boolean - * [`GetServerInfo(host, port)`](#module_redis..GetServerInfo) ⇒ string - * [`GetServerInfoAuth(host, port, password)`](#module_redis..GetServerInfoAuth) ⇒ string - * [`IsAuthenticated(host, port)`](#module_redis..IsAuthenticated) ⇒ boolean - * [`RunLuaScript(host, port, password, script)`](#module_redis..RunLuaScript) +### Functions - +- [Connect](/templates/protocols/javascript/modules/redis#connect) +- [GetServerInfo](/templates/protocols/javascript/modules/redis#getserverinfo) +- [GetServerInfoAuth](/templates/protocols/javascript/modules/redis#getserverinfoauth) +- [IsAuthenticated](/templates/protocols/javascript/modules/redis#isauthenticated) +- [RunLuaScript](/templates/protocols/javascript/modules/redis#runluascript) + +## Functions + +### Connect + +▸ **Connect**(`host`, `port`, `password`): `boolean` \| ``null`` -### (redis).Connect(host, port, password) ⇒ boolean Connect tries to connect redis server with password -**Kind**: inner method of [redis](#module_redis) -**Returns**: boolean - - The status of the connection. -**Throws**: +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `password` | `string` | -- error - The error encountered during connection. +#### Returns +`boolean` \| ``null`` -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the redis server. | -| port | number | The port of the redis server. | -| password | string | The password for the redis server. | +**`Example`** -**Example** -```js -let m = require('nuclei/redis'); -let status = m.Connect('localhost', 6379, 'password'); +```javascript +const redis = require('nuclei/redis'); +const connected = redis.Connect('acme.com', 6379, 'password'); ``` - -### (redis).GetServerInfo(host, port) ⇒ string +#### Defined in + +redis.ts:11 + +___ + +### GetServerInfo + +▸ **GetServerInfo**(`host`, `port`): `string` \| ``null`` + GetServerInfo returns the server info for a redis server -**Kind**: inner method of [redis](#module_redis) -**Returns**: string - - The server info. -**Throws**: +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | -- error - The error encountered during getting server info. +#### Returns +`string` \| ``null`` -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the redis server. | -| port | number | The port of the redis server. | +**`Example`** -**Example** -```js -let m = require('nuclei/redis'); -let info = m.GetServerInfo('localhost', 6379); +```javascript +const redis = require('nuclei/redis'); +const info = redis.GetServerInfo('acme.com', 6379); ``` - -### (redis).GetServerInfoAuth(host, port, password) ⇒ string +#### Defined in + +redis.ts:25 + +___ + +### GetServerInfoAuth + +▸ **GetServerInfoAuth**(`host`, `port`, `password`): `string` \| ``null`` + GetServerInfoAuth returns the server info for a redis server -**Kind**: inner method of [redis](#module_redis) -**Returns**: string - - The server info. -**Throws**: +#### Parameters -- error - The error encountered during getting server info. +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `password` | `string` | +#### Returns -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the redis server. | -| port | number | The port of the redis server. | -| password | string | The password for the redis server. | +`string` \| ``null`` -**Example** -```js -let m = require('nuclei/redis'); -let info = m.GetServerInfoAuth('localhost', 6379, 'password'); +**`Example`** + +```javascript +const redis = require('nuclei/redis'); +const info = redis.GetServerInfoAuth('acme.com', 6379, 'password'); ``` - -### (redis).IsAuthenticated(host, port) ⇒ boolean +#### Defined in + +redis.ts:39 + +___ + +### IsAuthenticated + +▸ **IsAuthenticated**(`host`, `port`): `boolean` \| ``null`` + IsAuthenticated checks if the redis server requires authentication -**Kind**: inner method of [redis](#module_redis) -**Returns**: boolean - - The authentication status. -**Throws**: +#### Parameters -- error - The error encountered during checking authentication. +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +#### Returns -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the redis server. | -| port | number | The port of the redis server. | +`boolean` \| ``null`` -**Example** -```js -let m = require('nuclei/redis'); -let isAuthenticated = m.IsAuthenticated('localhost', 6379); +**`Example`** + +```javascript +const redis = require('nuclei/redis'); +const isAuthenticated = redis.IsAuthenticated('acme.com', 6379); ``` - -### (redis).RunLuaScript(host, port, password, script) +#### Defined in + +redis.ts:53 + +___ + +### RunLuaScript + +▸ **RunLuaScript**(`host`, `port`, `password`, `script`): `any` \| ``null`` + RunLuaScript runs a lua script on the redis server -**Kind**: inner method of [redis](#module_redis) -**Throws**: +#### Parameters -- error - The error encountered during running the lua script. +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `password` | `string` | +| `script` | `string` | +#### Returns -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host of the redis server. | -| port | number | The port of the redis server. | -| password | string | The password for the redis server. | -| script | string | The lua script to run. | +`any` \| ``null`` -**Example** -```js -let m = require('nuclei/redis'); -m.RunLuaScript('localhost', 6379, 'password', 'return redis.call(\'ping\')'); +**`Example`** + +```javascript +const redis = require('nuclei/redis'); +const result = redis.RunLuaScript('acme.com', 6379, 'password', 'return redis.call("get", KEYS[1])'); ``` + +#### Defined in + +redis.ts:67 diff --git a/templates/protocols/javascript/modules/rsync.IsRsyncResponse.mdx b/templates/protocols/javascript/modules/rsync.IsRsyncResponse.mdx new file mode 100644 index 0000000..d5de4b2 --- /dev/null +++ b/templates/protocols/javascript/modules/rsync.IsRsyncResponse.mdx @@ -0,0 +1,41 @@ +# Interface: IsRsyncResponse + +[rsync](/templates/protocols/javascript/modules/rsync).IsRsyncResponse + +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)); +``` + +## Table of contents + +### Properties + +- [Banner](/templates/protocols/javascript/modules/rsync.IsRsyncResponse#banner) +- [IsRsync](/templates/protocols/javascript/modules/rsync.IsRsyncResponse#isrsync) + +## Properties + +### Banner + +• `Optional` **Banner**: `string` + +#### Defined in + +rsync.ts:48 + +___ + +### IsRsync + +• `Optional` **IsRsync**: `boolean` + +#### Defined in + +rsync.ts:46 diff --git a/templates/protocols/javascript/modules/rsync.RsyncClient.mdx b/templates/protocols/javascript/modules/rsync.RsyncClient.mdx new file mode 100644 index 0000000..9ef3c93 --- /dev/null +++ b/templates/protocols/javascript/modules/rsync.RsyncClient.mdx @@ -0,0 +1,67 @@ +# Class: RsyncClient + +[rsync](/templates/protocols/javascript/modules/rsync).RsyncClient + +RsyncClient is a minimal Rsync client for nuclei scripts. + +**`Example`** + +```javascript +const rsync = require('nuclei/rsync'); +const client = new rsync.Client(); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/rsync.RsyncClient#constructor) + +### Methods + +- [IsRsync](/templates/protocols/javascript/modules/rsync.RsyncClient#isrsync) + +## Constructors + +### constructor + +• **new RsyncClient**(): [`RsyncClient`](/templates/protocols/javascript/modules/rsync.RsyncClient) + +#### Returns + +[`RsyncClient`](/templates/protocols/javascript/modules/rsync.RsyncClient) + +#### Defined in + +rsync.ts:15 + +## Methods + +### IsRsync + +▸ **IsRsync**(`host`, `port`): [`IsRsyncResponse`](/templates/protocols/javascript/modules/rsync.IsRsyncResponse) + +IsRsync checks if a host is running a Rsync server. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +[`IsRsyncResponse`](/templates/protocols/javascript/modules/rsync.IsRsyncResponse) + +**`Example`** + +```javascript +const rsync = require('nuclei/rsync'); +const isRsync = rsync.IsRsync('acme.com', 873); +log(toJSON(isRsync)); +``` + +#### Defined in + +rsync.ts:25 diff --git a/templates/protocols/javascript/modules/rsync.mdx b/templates/protocols/javascript/modules/rsync.mdx index 16de3cd..404f288 100644 --- a/templates/protocols/javascript/modules/rsync.mdx +++ b/templates/protocols/javascript/modules/rsync.mdx @@ -1,44 +1,11 @@ - +# Namespace: rsync -## rsync +## Table of contents -* [rsync](#module_rsync) - * [`RsyncClient`](#module_rsync..RsyncClient) - * [`.IsRsync(host, port)`](#module_rsync..RsyncClient+IsRsync) ⇒ IsRsyncResponse - * [`IsRsyncResponse`](#module_rsync..IsRsyncResponse) : object +### Classes - +- [RsyncClient](/templates/protocols/javascript/modules/rsync.RsyncClient) -### (rsync).RsyncClient -RsyncClient is a minimal Rsync client for nuclei scripts. +### Interfaces -**Kind**: inner class of [rsync](#module_rsync) - - -#### rsyncClient.IsRsync(host, port) ⇒ IsRsyncResponse -IsRsync checks if a host is running a Rsync server. - -**Kind**: instance method of [RsyncClient](#module_rsync..RsyncClient) -**Returns**: IsRsyncResponse - - The response from the IsRsync check. -**Throws**: - -- error - The error encountered during the IsRsync check. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check. | -| port | int | The port to check. | - -**Example** -```js -let m = require('nuclei/rsync'); -let c = m.RsyncClient(); -let response = c.IsRsync('localhost', 22); -``` - - -### (rsync).IsRsyncResponse : object -IsRsyncResponse is an object containing the response from the IsRsync check. - -**Kind**: inner typedef of [rsync](#module_rsync) +- [IsRsyncResponse](/templates/protocols/javascript/modules/rsync.IsRsyncResponse) diff --git a/templates/protocols/javascript/modules/smb.HeaderLog.mdx b/templates/protocols/javascript/modules/smb.HeaderLog.mdx new file mode 100644 index 0000000..1fe29ff --- /dev/null +++ b/templates/protocols/javascript/modules/smb.HeaderLog.mdx @@ -0,0 +1,65 @@ +# Interface: HeaderLog + +[smb](/templates/protocols/javascript/modules/smb).HeaderLog + +HeaderLog Interface + +## Table of contents + +### Properties + +- [Command](/templates/protocols/javascript/modules/smb.HeaderLog#command) +- [Credits](/templates/protocols/javascript/modules/smb.HeaderLog#credits) +- [Flags](/templates/protocols/javascript/modules/smb.HeaderLog#flags) +- [ProtocolID](/templates/protocols/javascript/modules/smb.HeaderLog#protocolid) +- [Status](/templates/protocols/javascript/modules/smb.HeaderLog#status) + +## Properties + +### Command + +• `Optional` **Command**: `number` + +#### Defined in + +smb.ts:100 + +___ + +### Credits + +• `Optional` **Credits**: `number` + +#### Defined in + +smb.ts:102 + +___ + +### Flags + +• `Optional` **Flags**: `number` + +#### Defined in + +smb.ts:104 + +___ + +### ProtocolID + +• `Optional` **ProtocolID**: `Uint8Array` + +#### Defined in + +smb.ts:106 + +___ + +### Status + +• `Optional` **Status**: `number` + +#### Defined in + +smb.ts:98 diff --git a/templates/protocols/javascript/modules/smb.NegotiationLog.mdx b/templates/protocols/javascript/modules/smb.NegotiationLog.mdx new file mode 100644 index 0000000..5466d39 --- /dev/null +++ b/templates/protocols/javascript/modules/smb.NegotiationLog.mdx @@ -0,0 +1,98 @@ +# Interface: NegotiationLog + +[smb](/templates/protocols/javascript/modules/smb).NegotiationLog + +NegotiationLog Interface + +## Table of contents + +### Properties + +- [AuthenticationTypes](/templates/protocols/javascript/modules/smb.NegotiationLog#authenticationtypes) +- [Capabilities](/templates/protocols/javascript/modules/smb.NegotiationLog#capabilities) +- [DialectRevision](/templates/protocols/javascript/modules/smb.NegotiationLog#dialectrevision) +- [HeaderLog](/templates/protocols/javascript/modules/smb.NegotiationLog#headerlog) +- [SecurityMode](/templates/protocols/javascript/modules/smb.NegotiationLog#securitymode) +- [ServerGuid](/templates/protocols/javascript/modules/smb.NegotiationLog#serverguid) +- [ServerStartTime](/templates/protocols/javascript/modules/smb.NegotiationLog#serverstarttime) +- [SystemTime](/templates/protocols/javascript/modules/smb.NegotiationLog#systemtime) + +## Properties + +### AuthenticationTypes + +• `Optional` **AuthenticationTypes**: `string`[] + +#### Defined in + +smb.ts:118 + +___ + +### Capabilities + +• `Optional` **Capabilities**: `number` + +#### Defined in + +smb.ts:126 + +___ + +### DialectRevision + +• `Optional` **DialectRevision**: `number` + +#### Defined in + +smb.ts:122 + +___ + +### HeaderLog + +• `Optional` **HeaderLog**: [`HeaderLog`](/templates/protocols/javascript/modules/smb.HeaderLog) + +#### Defined in + +smb.ts:130 + +___ + +### SecurityMode + +• `Optional` **SecurityMode**: `number` + +#### Defined in + +smb.ts:120 + +___ + +### ServerGuid + +• `Optional` **ServerGuid**: `Uint8Array` + +#### Defined in + +smb.ts:124 + +___ + +### ServerStartTime + +• `Optional` **ServerStartTime**: `number` + +#### Defined in + +smb.ts:116 + +___ + +### SystemTime + +• `Optional` **SystemTime**: `number` + +#### Defined in + +smb.ts:128 diff --git a/templates/protocols/javascript/modules/smb.SMBCapabilities.mdx b/templates/protocols/javascript/modules/smb.SMBCapabilities.mdx new file mode 100644 index 0000000..90284de --- /dev/null +++ b/templates/protocols/javascript/modules/smb.SMBCapabilities.mdx @@ -0,0 +1,87 @@ +# Interface: SMBCapabilities + +[smb](/templates/protocols/javascript/modules/smb).SMBCapabilities + +SMBCapabilities Interface + +## Table of contents + +### Properties + +- [DFSSupport](/templates/protocols/javascript/modules/smb.SMBCapabilities#dfssupport) +- [DirLeasing](/templates/protocols/javascript/modules/smb.SMBCapabilities#dirleasing) +- [Encryption](/templates/protocols/javascript/modules/smb.SMBCapabilities#encryption) +- [LargeMTU](/templates/protocols/javascript/modules/smb.SMBCapabilities#largemtu) +- [Leasing](/templates/protocols/javascript/modules/smb.SMBCapabilities#leasing) +- [MultiChan](/templates/protocols/javascript/modules/smb.SMBCapabilities#multichan) +- [Persist](/templates/protocols/javascript/modules/smb.SMBCapabilities#persist) + +## Properties + +### DFSSupport + +• `Optional` **DFSSupport**: `boolean` + +#### Defined in + +smb.ts:142 + +___ + +### DirLeasing + +• `Optional` **DirLeasing**: `boolean` + +#### Defined in + +smb.ts:152 + +___ + +### Encryption + +• `Optional` **Encryption**: `boolean` + +#### Defined in + +smb.ts:140 + +___ + +### LargeMTU + +• `Optional` **LargeMTU**: `boolean` + +#### Defined in + +smb.ts:146 + +___ + +### Leasing + +• `Optional` **Leasing**: `boolean` + +#### Defined in + +smb.ts:144 + +___ + +### MultiChan + +• `Optional` **MultiChan**: `boolean` + +#### Defined in + +smb.ts:148 + +___ + +### Persist + +• `Optional` **Persist**: `boolean` + +#### Defined in + +smb.ts:150 diff --git a/templates/protocols/javascript/modules/smb.SMBClient.mdx b/templates/protocols/javascript/modules/smb.SMBClient.mdx new file mode 100644 index 0000000..82fa3dd --- /dev/null +++ b/templates/protocols/javascript/modules/smb.SMBClient.mdx @@ -0,0 +1,181 @@ +# Class: SMBClient + +[smb](/templates/protocols/javascript/modules/smb).SMBClient + +SMBClient is a client for SMB servers. +Internally client uses github.com/zmap/zgrab2/lib/smb/smb driver. +github.com/projectdiscovery/go-smb2 driver + +**`Example`** + +```javascript +const smb = require('nuclei/smb'); +const client = new smb.Client(); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/smb.SMBClient#constructor) + +### Methods + +- [ConnectSMBInfoMode](/templates/protocols/javascript/modules/smb.SMBClient#connectsmbinfomode) +- [DetectSMBGhost](/templates/protocols/javascript/modules/smb.SMBClient#detectsmbghost) +- [ListSMBv2Metadata](/templates/protocols/javascript/modules/smb.SMBClient#listsmbv2metadata) +- [ListShares](/templates/protocols/javascript/modules/smb.SMBClient#listshares) + +## Constructors + +### constructor + +• **new SMBClient**(): [`SMBClient`](/templates/protocols/javascript/modules/smb.SMBClient) + +#### Returns + +[`SMBClient`](/templates/protocols/javascript/modules/smb.SMBClient) + +#### Defined in + +smb.ts:17 + +## Methods + +### ConnectSMBInfoMode + +▸ **ConnectSMBInfoMode**(`host`, `port`): [`SMBLog`](/templates/protocols/javascript/modules/smb.SMBLog) + +ConnectSMBInfoMode tries to connect to provided host and port +and discovery SMB information +Returns handshake log and error. If error is not nil, +state will be false + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +[`SMBLog`](/templates/protocols/javascript/modules/smb.SMBLog) + +**`Example`** + +```javascript +const smb = require('nuclei/smb'); +const client = new smb.Client(); +const info = client.ConnectSMBInfoMode('acme.com', 445); +log(to_json(info)); +``` + +#### Defined in + +smb.ts:31 + +___ + +### DetectSMBGhost + +▸ **DetectSMBGhost**(`host`, `port`): `boolean` + +DetectSMBGhost tries to detect SMBGhost vulnerability +by using SMBv3 compression feature. +If the host is vulnerable, it returns true. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const smb = require('nuclei/smb'); +const isSMBGhost = smb.DetectSMBGhost('acme.com', 445); +``` + +#### Defined in + +smb.ts:84 + +___ + +### ListSMBv2Metadata + +▸ **ListSMBv2Metadata**(`host`, `port`): [`ServiceSMB`](/templates/protocols/javascript/modules/smb.ServiceSMB) + +ListSMBv2Metadata tries to connect to provided host and port +and list SMBv2 metadata. +Returns metadata and error. If error is not nil, +state will be false + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +[`ServiceSMB`](/templates/protocols/javascript/modules/smb.ServiceSMB) + +**`Example`** + +```javascript +const smb = require('nuclei/smb'); +const client = new smb.Client(); +const metadata = client.ListSMBv2Metadata('acme.com', 445); +log(to_json(metadata)); +``` + +#### Defined in + +smb.ts:49 + +___ + +### ListShares + +▸ **ListShares**(`host`, `port`, `user`): `string`[] + +ListShares tries to connect to provided host and port +and list shares by using given credentials. +Credentials cannot be blank. guest or anonymous credentials +can be used by providing empty password. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `user` | `string` | + +#### Returns + +`string`[] + +**`Example`** + +```javascript +const smb = require('nuclei/smb'); +const client = new smb.Client(); +const shares = client.ListShares('acme.com', 445, 'username', 'password'); + for (const share of shares) { + log(share); + } +``` + +#### Defined in + +smb.ts:69 diff --git a/templates/protocols/javascript/modules/smb.SMBLog.mdx b/templates/protocols/javascript/modules/smb.SMBLog.mdx new file mode 100644 index 0000000..f38d64b --- /dev/null +++ b/templates/protocols/javascript/modules/smb.SMBLog.mdx @@ -0,0 +1,109 @@ +# Interface: SMBLog + +[smb](/templates/protocols/javascript/modules/smb).SMBLog + +SMBLog Interface + +## Table of contents + +### Properties + +- [Capabilities](/templates/protocols/javascript/modules/smb.SMBLog#capabilities) +- [GroupName](/templates/protocols/javascript/modules/smb.SMBLog#groupname) +- [HasNTLM](/templates/protocols/javascript/modules/smb.SMBLog#hasntlm) +- [NTLM](/templates/protocols/javascript/modules/smb.SMBLog#ntlm) +- [NativeOs](/templates/protocols/javascript/modules/smb.SMBLog#nativeos) +- [NegotiationLog](/templates/protocols/javascript/modules/smb.SMBLog#negotiationlog) +- [SessionSetupLog](/templates/protocols/javascript/modules/smb.SMBLog#sessionsetuplog) +- [SupportV1](/templates/protocols/javascript/modules/smb.SMBLog#supportv1) +- [Version](/templates/protocols/javascript/modules/smb.SMBLog#version) + +## Properties + +### Capabilities + +• `Optional` **Capabilities**: [`SMBCapabilities`](/templates/protocols/javascript/modules/smb.SMBCapabilities) + +#### Defined in + +smb.ts:174 + +___ + +### GroupName + +• `Optional` **GroupName**: `string` + +#### Defined in + +smb.ts:168 + +___ + +### HasNTLM + +• `Optional` **HasNTLM**: `boolean` + +#### Defined in + +smb.ts:170 + +___ + +### NTLM + +• `Optional` **NTLM**: `string` + +#### Defined in + +smb.ts:166 + +___ + +### NativeOs + +• `Optional` **NativeOs**: `string` + +#### Defined in + +smb.ts:164 + +___ + +### NegotiationLog + +• `Optional` **NegotiationLog**: [`NegotiationLog`](/templates/protocols/javascript/modules/smb.NegotiationLog) + +#### Defined in + +smb.ts:176 + +___ + +### SessionSetupLog + +• `Optional` **SessionSetupLog**: [`SessionSetupLog`](/templates/protocols/javascript/modules/smb.SessionSetupLog) + +#### Defined in + +smb.ts:178 + +___ + +### SupportV1 + +• `Optional` **SupportV1**: `boolean` + +#### Defined in + +smb.ts:162 + +___ + +### Version + +• `Optional` **Version**: [`SMBVersions`](/templates/protocols/javascript/modules/smb.SMBVersions) + +#### Defined in + +smb.ts:172 diff --git a/templates/protocols/javascript/modules/smb.SMBVersions.mdx b/templates/protocols/javascript/modules/smb.SMBVersions.mdx new file mode 100644 index 0000000..a341fe5 --- /dev/null +++ b/templates/protocols/javascript/modules/smb.SMBVersions.mdx @@ -0,0 +1,54 @@ +# Interface: SMBVersions + +[smb](/templates/protocols/javascript/modules/smb).SMBVersions + +SMBVersions Interface + +## Table of contents + +### Properties + +- [Major](/templates/protocols/javascript/modules/smb.SMBVersions#major) +- [Minor](/templates/protocols/javascript/modules/smb.SMBVersions#minor) +- [Revision](/templates/protocols/javascript/modules/smb.SMBVersions#revision) +- [VerString](/templates/protocols/javascript/modules/smb.SMBVersions#verstring) + +## Properties + +### Major + +• `Optional` **Major**: `number` + +#### Defined in + +smb.ts:190 + +___ + +### Minor + +• `Optional` **Minor**: `number` + +#### Defined in + +smb.ts:192 + +___ + +### Revision + +• `Optional` **Revision**: `number` + +#### Defined in + +smb.ts:194 + +___ + +### VerString + +• `Optional` **VerString**: `string` + +#### Defined in + +smb.ts:188 diff --git a/templates/protocols/javascript/modules/smb.ServiceSMB.mdx b/templates/protocols/javascript/modules/smb.ServiceSMB.mdx new file mode 100644 index 0000000..f5a635b --- /dev/null +++ b/templates/protocols/javascript/modules/smb.ServiceSMB.mdx @@ -0,0 +1,98 @@ +# Interface: ServiceSMB + +[smb](/templates/protocols/javascript/modules/smb).ServiceSMB + +ServiceSMB Interface + +## Table of contents + +### Properties + +- [DNSComputerName](/templates/protocols/javascript/modules/smb.ServiceSMB#dnscomputername) +- [DNSDomainName](/templates/protocols/javascript/modules/smb.ServiceSMB#dnsdomainname) +- [ForestName](/templates/protocols/javascript/modules/smb.ServiceSMB#forestname) +- [NetBIOSComputerName](/templates/protocols/javascript/modules/smb.ServiceSMB#netbioscomputername) +- [NetBIOSDomainName](/templates/protocols/javascript/modules/smb.ServiceSMB#netbiosdomainname) +- [OSVersion](/templates/protocols/javascript/modules/smb.ServiceSMB#osversion) +- [SigningEnabled](/templates/protocols/javascript/modules/smb.ServiceSMB#signingenabled) +- [SigningRequired](/templates/protocols/javascript/modules/smb.ServiceSMB#signingrequired) + +## Properties + +### DNSComputerName + +• `Optional` **DNSComputerName**: `string` + +#### Defined in + +smb.ts:212 + +___ + +### DNSDomainName + +• `Optional` **DNSDomainName**: `string` + +#### Defined in + +smb.ts:214 + +___ + +### ForestName + +• `Optional` **ForestName**: `string` + +#### Defined in + +smb.ts:216 + +___ + +### NetBIOSComputerName + +• `Optional` **NetBIOSComputerName**: `string` + +#### Defined in + +smb.ts:208 + +___ + +### NetBIOSDomainName + +• `Optional` **NetBIOSDomainName**: `string` + +#### Defined in + +smb.ts:210 + +___ + +### OSVersion + +• `Optional` **OSVersion**: `string` + +#### Defined in + +smb.ts:206 + +___ + +### SigningEnabled + +• `Optional` **SigningEnabled**: `boolean` + +#### Defined in + +smb.ts:218 + +___ + +### SigningRequired + +• `Optional` **SigningRequired**: `boolean` + +#### Defined in + +smb.ts:204 diff --git a/templates/protocols/javascript/modules/smb.SessionSetupLog.mdx b/templates/protocols/javascript/modules/smb.SessionSetupLog.mdx new file mode 100644 index 0000000..fb2f561 --- /dev/null +++ b/templates/protocols/javascript/modules/smb.SessionSetupLog.mdx @@ -0,0 +1,54 @@ +# Interface: SessionSetupLog + +[smb](/templates/protocols/javascript/modules/smb).SessionSetupLog + +SessionSetupLog Interface + +## Table of contents + +### Properties + +- [HeaderLog](/templates/protocols/javascript/modules/smb.SessionSetupLog#headerlog) +- [NegotiateFlags](/templates/protocols/javascript/modules/smb.SessionSetupLog#negotiateflags) +- [SetupFlags](/templates/protocols/javascript/modules/smb.SessionSetupLog#setupflags) +- [TargetName](/templates/protocols/javascript/modules/smb.SessionSetupLog#targetname) + +## Properties + +### HeaderLog + +• `Optional` **HeaderLog**: [`HeaderLog`](/templates/protocols/javascript/modules/smb.HeaderLog) + +#### Defined in + +smb.ts:234 + +___ + +### NegotiateFlags + +• `Optional` **NegotiateFlags**: `number` + +#### Defined in + +smb.ts:232 + +___ + +### SetupFlags + +• `Optional` **SetupFlags**: `number` + +#### Defined in + +smb.ts:228 + +___ + +### TargetName + +• `Optional` **TargetName**: `string` + +#### Defined in + +smb.ts:230 diff --git a/templates/protocols/javascript/modules/smb.mdx b/templates/protocols/javascript/modules/smb.mdx index 4c72cbb..89ff977 100644 --- a/templates/protocols/javascript/modules/smb.mdx +++ b/templates/protocols/javascript/modules/smb.mdx @@ -1,132 +1,17 @@ - +# Namespace: smb -## smb +## Table of contents -* [smb](#module_smb) - * [`SMBClient`](#module_smb..SMBClient) - * [`.ConnectSMBInfoMode(host, port)`](#module_smb..SMBClient+ConnectSMBInfoMode) ⇒ SMBLog - * [`.DetectSMBGhost(host, port)`](#module_smb..SMBClient+DetectSMBGhost) ⇒ boolean - * [`.ListSMBv2Metadata(host, port)`](#module_smb..SMBClient+ListSMBv2Metadata) ⇒ ServiceSMB - * [`.ListShares(host, port, user, password)`](#module_smb..SMBClient+ListShares) ⇒ Array.<string> - * [`SMBLog`](#module_smb..SMBLog) : object - * [`ServiceSMB`](#module_smb..ServiceSMB) : object +### Classes - +- [SMBClient](/templates/protocols/javascript/modules/smb.SMBClient) -### (smb).SMBClient -SMBClient is a client for SMB servers. +### Interfaces -**Kind**: inner class of [smb](#module_smb) - -* [`SMBClient`](#module_smb..SMBClient) - * [`.ConnectSMBInfoMode(host, port)`](#module_smb..SMBClient+ConnectSMBInfoMode) ⇒ SMBLog - * [`.DetectSMBGhost(host, port)`](#module_smb..SMBClient+DetectSMBGhost) ⇒ boolean - * [`.ListSMBv2Metadata(host, port)`](#module_smb..SMBClient+ListSMBv2Metadata) ⇒ ServiceSMB - * [`.ListShares(host, port, user, password)`](#module_smb..SMBClient+ListShares) ⇒ Array.<string> - - - -#### smbClient.ConnectSMBInfoMode(host, port) ⇒ SMBLog -ConnectSMBInfoMode tries to connect to provided host and port and discover SMB information - -**Kind**: instance method of [SMBClient](#module_smb..SMBClient) -**Returns**: SMBLog - - The log of the SMB handshake. -**Throws**: - -- error - The error encountered during the connection. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to connect to. | -| port | string | The port to connect to. | - -**Example** -```js -let m = require('nuclei/smb'); -let c = m.SMBClient(); -let log = c.ConnectSMBInfoMode('localhost', '445'); -``` - - -#### smbClient.DetectSMBGhost(host, port) ⇒ boolean -DetectSMBGhost tries to detect SMBGhost vulnerability by using SMBv3 compression feature. - -**Kind**: instance method of [SMBClient](#module_smb..SMBClient) -**Returns**: boolean - - The result of the SMBGhost vulnerability detection. -**Throws**: - -- error - The error encountered during the detection. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to connect to. | -| port | string | The port to connect to. | - -**Example** -```js -let m = require('nuclei/smb'); -let c = m.SMBClient(); -let isVulnerable = c.DetectSMBGhost('localhost', '445'); -``` - - -#### smbClient.ListSMBv2Metadata(host, port) ⇒ ServiceSMB -ListSMBv2Metadata tries to connect to provided host and port and list SMBv2 metadata. - -**Kind**: instance method of [SMBClient](#module_smb..SMBClient) -**Returns**: ServiceSMB - - The metadata of the SMBv2 service. -**Throws**: - -- error - The error encountered during the listing. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to connect to. | -| port | string | The port to connect to. | - -**Example** -```js -let m = require('nuclei/smb'); -let c = m.SMBClient(); -let metadata = c.ListSMBv2Metadata('localhost', '445'); -``` - - -#### smbClient.ListShares(host, port, user, password) ⇒ Array.<string> -ListShares tries to connect to provided host and port and list shares by using given credentials. - -**Kind**: instance method of [SMBClient](#module_smb..SMBClient) -**Returns**: Array.<string> - - The list of shares. -**Throws**: - -- error - The error encountered during the listing. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to connect to. | -| port | string | The port to connect to. | -| user | string | The username for authentication. | -| password | string | The password for authentication. | - -**Example** -```js -let m = require('nuclei/smb'); -let c = m.SMBClient(); -let shares = c.ListShares('localhost', '445', 'user', 'password'); -``` - - -### (smb).SMBLog : object -SMBLog is an object containing the log of the SMB handshake. - -**Kind**: inner typedef of [smb](#module_smb) - - -### (smb).ServiceSMB : object -ServiceSMB is an object containing the metadata of the SMBv2 service. - -**Kind**: inner typedef of [smb](#module_smb) +- [HeaderLog](/templates/protocols/javascript/modules/smb.HeaderLog) +- [NegotiationLog](/templates/protocols/javascript/modules/smb.NegotiationLog) +- [SMBCapabilities](/templates/protocols/javascript/modules/smb.SMBCapabilities) +- [SMBLog](/templates/protocols/javascript/modules/smb.SMBLog) +- [SMBVersions](/templates/protocols/javascript/modules/smb.SMBVersions) +- [ServiceSMB](/templates/protocols/javascript/modules/smb.ServiceSMB) +- [SessionSetupLog](/templates/protocols/javascript/modules/smb.SessionSetupLog) diff --git a/templates/protocols/javascript/modules/smtp.IsSMTPResponse.mdx b/templates/protocols/javascript/modules/smtp.IsSMTPResponse.mdx new file mode 100644 index 0000000..d5e4d4c --- /dev/null +++ b/templates/protocols/javascript/modules/smtp.IsSMTPResponse.mdx @@ -0,0 +1,40 @@ +# Interface: IsSMTPResponse + +[smtp](/templates/protocols/javascript/modules/smtp).IsSMTPResponse + +IsSMTPResponse is the response from the IsSMTP function. + +**`Example`** + +```javascript +const smtp = require('nuclei/smtp'); +const isSMTP = smtp.IsSMTP('acme.com', 25); +log(toJSON(isSMTP)); +``` + +## Table of contents + +### Properties + +- [Banner](/templates/protocols/javascript/modules/smtp.IsSMTPResponse#banner) +- [IsSMTP](/templates/protocols/javascript/modules/smtp.IsSMTPResponse#issmtp) + +## Properties + +### Banner + +• `Optional` **Banner**: `string` + +#### Defined in + +smtp.ts:189 + +___ + +### IsSMTP + +• `Optional` **IsSMTP**: `boolean` + +#### Defined in + +smtp.ts:187 diff --git a/templates/protocols/javascript/modules/smtp.SMTPClient.mdx b/templates/protocols/javascript/modules/smtp.SMTPClient.mdx new file mode 100644 index 0000000..48ed901 --- /dev/null +++ b/templates/protocols/javascript/modules/smtp.SMTPClient.mdx @@ -0,0 +1,141 @@ +# Class: SMTPClient + +[smtp](/templates/protocols/javascript/modules/smtp).SMTPClient + +SMTPClient is a minimal SMTP client for nuclei scripts. + +**`Example`** + +```javascript +const smtp = require('nuclei/smtp'); +const client = new smtp.Client(); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/smtp.SMTPClient#constructor) + +### Methods + +- [IsOpenRelay](/templates/protocols/javascript/modules/smtp.SMTPClient#isopenrelay) +- [IsSMTP](/templates/protocols/javascript/modules/smtp.SMTPClient#issmtp) +- [SendMail](/templates/protocols/javascript/modules/smtp.SMTPClient#sendmail) + +## Constructors + +### constructor + +• **new SMTPClient**(): [`SMTPClient`](/templates/protocols/javascript/modules/smtp.SMTPClient) + +#### Returns + +[`SMTPClient`](/templates/protocols/javascript/modules/smtp.SMTPClient) + +#### Defined in + +smtp.ts:15 + +## Methods + +### IsOpenRelay + +▸ **IsOpenRelay**(`host`, `port`, `msg`): `boolean` + +IsOpenRelay checks if a host is an open relay. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `msg` | [`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const smtp = require('nuclei/smtp'); +const message = new smtp.SMTPMessage(); +message.From('xyz@projectdiscovery.io'); +message.To('xyz2@projectdiscoveyr.io'); +message.Subject('hello'); +message.Body('hello'); +const isRelay = smtp.IsOpenRelay('acme.com', 25, message); +``` + +#### Defined in + +smtp.ts:43 + +___ + +### IsSMTP + +▸ **IsSMTP**(`host`, `port`): [`IsSMTPResponse`](/templates/protocols/javascript/modules/smtp.IsSMTPResponse) + +IsSMTP checks if a host is running a SMTP server. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +[`IsSMTPResponse`](/templates/protocols/javascript/modules/smtp.IsSMTPResponse) + +**`Example`** + +```javascript +const smtp = require('nuclei/smtp'); +const isSMTP = smtp.IsSMTP('acme.com', 25); +log(toJSON(isSMTP)); +``` + +#### Defined in + +smtp.ts:25 + +___ + +### SendMail + +▸ **SendMail**(`host`, `port`, `msg`): `boolean` + +SendMail sends an email using the SMTP protocol. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `string` | +| `msg` | [`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const smtp = require('nuclei/smtp'); +const message = new smtp.SMTPMessage(); +message.From('xyz@projectdiscovery.io'); +message.To('xyz2@projectdiscoveyr.io'); +message.Subject('hello'); +message.Body('hello'); +const isSent = smtp.SendMail('acme.com', 25, message); +``` + +#### Defined in + +smtp.ts:61 diff --git a/templates/protocols/javascript/modules/smtp.SMTPMessage.mdx b/templates/protocols/javascript/modules/smtp.SMTPMessage.mdx new file mode 100644 index 0000000..f923fee --- /dev/null +++ b/templates/protocols/javascript/modules/smtp.SMTPMessage.mdx @@ -0,0 +1,220 @@ +# Class: SMTPMessage + +[smtp](/templates/protocols/javascript/modules/smtp).SMTPMessage + +SMTPMessage is a message to be sent over SMTP + +**`Example`** + +```javascript +const smtp = require('nuclei/smtp'); +const message = new smtp.SMTPMessage(); +message.From('xyz@projectdiscovery.io'); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/smtp.SMTPMessage#constructor) + +### Methods + +- [Auth](/templates/protocols/javascript/modules/smtp.SMTPMessage#auth) +- [Body](/templates/protocols/javascript/modules/smtp.SMTPMessage#body) +- [From](/templates/protocols/javascript/modules/smtp.SMTPMessage#from) +- [String](/templates/protocols/javascript/modules/smtp.SMTPMessage#string) +- [Subject](/templates/protocols/javascript/modules/smtp.SMTPMessage#subject) +- [To](/templates/protocols/javascript/modules/smtp.SMTPMessage#to) + +## Constructors + +### constructor + +• **new SMTPMessage**(): [`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) + +#### Returns + +[`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) + +#### Defined in + +smtp.ts:83 + +## Methods + +### Auth + +▸ **Auth**(`username`): [`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) + +Auth when called authenticates using username and password before sending the message + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `username` | `string` | + +#### Returns + +[`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) + +**`Example`** + +```javascript +const smtp = require('nuclei/smtp'); +const message = new smtp.SMTPMessage(); +message.Auth('username', 'password'); +``` + +#### Defined in + +smtp.ts:149 + +___ + +### Body + +▸ **Body**(`msg`): [`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) + +Body adds the message body to the message + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `msg` | `Uint8Array` | + +#### Returns + +[`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) + +**`Example`** + +```javascript +const smtp = require('nuclei/smtp'); +const message = new smtp.SMTPMessage(); +message.Body('hello'); +``` + +#### Defined in + +smtp.ts:135 + +___ + +### From + +▸ **From**(`email`): [`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) + +From adds the from field to the message + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `email` | `string` | + +#### Returns + +[`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) + +**`Example`** + +```javascript +const smtp = require('nuclei/smtp'); +const message = new smtp.SMTPMessage(); +message.From('xyz@projectdiscovery.io'); +``` + +#### Defined in + +smtp.ts:93 + +___ + +### String + +▸ **String**(): `string` + +String returns the string representation of the message + +#### Returns + +`string` + +**`Example`** + +```javascript +const smtp = require('nuclei/smtp'); +const message = new smtp.SMTPMessage(); +message.From('xyz@projectdiscovery.io'); +message.To('xyz2@projectdiscoveyr.io'); +message.Subject('hello'); +message.Body('hello'); +log(message.String()); +``` + +#### Defined in + +smtp.ts:167 + +___ + +### Subject + +▸ **Subject**(`sub`): [`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) + +Subject adds the subject field to the message + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sub` | `string` | + +#### Returns + +[`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) + +**`Example`** + +```javascript +const smtp = require('nuclei/smtp'); +const message = new smtp.SMTPMessage(); +message.Subject('hello'); +``` + +#### Defined in + +smtp.ts:121 + +___ + +### To + +▸ **To**(`email`): [`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) + +To adds the to field to the message + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `email` | `string` | + +#### Returns + +[`SMTPMessage`](/templates/protocols/javascript/modules/smtp.SMTPMessage) + +**`Example`** + +```javascript +const smtp = require('nuclei/smtp'); +const message = new smtp.SMTPMessage(); +message.To('xyz@projectdiscovery.io'); +``` + +#### Defined in + +smtp.ts:107 diff --git a/templates/protocols/javascript/modules/smtp.mdx b/templates/protocols/javascript/modules/smtp.mdx index 0e240fc..d9b04cd 100644 --- a/templates/protocols/javascript/modules/smtp.mdx +++ b/templates/protocols/javascript/modules/smtp.mdx @@ -1,219 +1,12 @@ - +# Namespace: smtp -## smtp +## Table of contents -* [smtp](#module_smtp) - * [`SMTPClient`](#module_smtp..SMTPClient) - * [`.IsOpenRelay(host, port, msg)`](#module_smtp..SMTPClient+IsOpenRelay) ⇒ boolean - * [`.IsSMTP(host, port)`](#module_smtp..SMTPClient+IsSMTP) ⇒ IsSMTPResponse - * [`.SendMail(host, port, msg)`](#module_smtp..SMTPClient+SendMail) ⇒ boolean - * [`SMTPMessage`](#module_smtp..SMTPMessage) - * [`.Auth(username, password)`](#module_smtp..SMTPMessage+Auth) ⇒ SMTPMessage - * [`.Body(msg)`](#module_smtp..SMTPMessage+Body) ⇒ SMTPMessage - * [`.From(email)`](#module_smtp..SMTPMessage+From) ⇒ SMTPMessage - * [`.String()`](#module_smtp..SMTPMessage+String) ⇒ string - * [`.Subject(sub)`](#module_smtp..SMTPMessage+Subject) ⇒ SMTPMessage - * [`.To(email)`](#module_smtp..SMTPMessage+To) ⇒ SMTPMessage +### Classes - +- [SMTPClient](/templates/protocols/javascript/modules/smtp.SMTPClient) +- [SMTPMessage](/templates/protocols/javascript/modules/smtp.SMTPMessage) -### (smtp).SMTPClient -SMTPClient is a minimal SMTP client for nuclei scripts. +### Interfaces -**Kind**: inner class of [smtp](#module_smtp) - -* [`SMTPClient`](#module_smtp..SMTPClient) - * [`.IsOpenRelay(host, port, msg)`](#module_smtp..SMTPClient+IsOpenRelay) ⇒ boolean - * [`.IsSMTP(host, port)`](#module_smtp..SMTPClient+IsSMTP) ⇒ IsSMTPResponse - * [`.SendMail(host, port, msg)`](#module_smtp..SMTPClient+SendMail) ⇒ boolean - - - -#### smtpClient.IsOpenRelay(host, port, msg) ⇒ boolean -IsOpenRelay checks if a host is an open relay - -**Kind**: instance method of [SMTPClient](#module_smtp..SMTPClient) -**Returns**: boolean - - Whether the host is an open relay or not. -**Throws**: - -- error - The error encountered during the check. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check. | -| port | number | The port to check. | -| msg | string | The message to send. | - -**Example** -```js -let m = require('nuclei/smtp'); - let c = m.SMTPClient(); - let isOpenRelay = c.IsOpenRelay('localhost', 25, 'test message'); -``` - - -#### smtpClient.IsSMTP(host, port) ⇒ IsSMTPResponse -IsSMTP checks if a host is running a SMTP server. - -**Kind**: instance method of [SMTPClient](#module_smtp..SMTPClient) -**Returns**: IsSMTPResponse - - The response from the SMTP server. -**Throws**: - -- error - The error encountered during the check. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check. | -| port | number | The port to check. | - -**Example** -```js -let m = require('nuclei/smtp'); - let c = m.SMTPClient(); - let isSMTP = c.IsSMTP('localhost', 25); -``` - - -#### smtpClient.SendMail(host, port, msg) ⇒ boolean -SendMail sends an email using the SMTP protocol. - -**Kind**: instance method of [SMTPClient](#module_smtp..SMTPClient) -**Returns**: boolean - - Whether the email was sent successfully or not. -**Throws**: - -- error - The error encountered during the email sending. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to send the email to. | -| port | number | The port to send the email to. | -| msg | string | The message to send. | - -**Example** -```js -let m = require('nuclei/smtp'); - let c = m.SMTPClient(); - let isSent = c.SendMail('localhost', 25, 'test message'); -``` - - -### (smtp).SMTPMessage -SMTPMessage is a simple smtp message builder - -**Kind**: inner class of [smtp](#module_smtp) - -* [`SMTPMessage`](#module_smtp..SMTPMessage) - * [`.Auth(username, password)`](#module_smtp..SMTPMessage+Auth) ⇒ SMTPMessage - * [`.Body(msg)`](#module_smtp..SMTPMessage+Body) ⇒ SMTPMessage - * [`.From(email)`](#module_smtp..SMTPMessage+From) ⇒ SMTPMessage - * [`.String()`](#module_smtp..SMTPMessage+String) ⇒ string - * [`.Subject(sub)`](#module_smtp..SMTPMessage+Subject) ⇒ SMTPMessage - * [`.To(email)`](#module_smtp..SMTPMessage+To) ⇒ SMTPMessage - - - -#### smtpMessage.Auth(username, password) ⇒ SMTPMessage -Auth when called authenticates using username and password before sending the message - -**Kind**: instance method of [SMTPMessage](#module_smtp..SMTPMessage) -**Returns**: SMTPMessage - - The SMTPMessage object after authentication. - -| Param | Type | Description | -| --- | --- | --- | -| username | string | The username for authentication. | -| password | string | The password for authentication. | - -**Example** -```js -let m = require('nuclei/smtp'); - let msg = m.SMTPMessage(); - msg = msg.Auth('username', 'password'); -``` - - -#### smtpMessage.Body(msg) ⇒ SMTPMessage -Body adds the message body to the message - -**Kind**: instance method of [SMTPMessage](#module_smtp..SMTPMessage) -**Returns**: SMTPMessage - - The SMTPMessage object after adding the body. - -| Param | Type | Description | -| --- | --- | --- | -| msg | string | The message body to add. | - -**Example** -```js -let m = require('nuclei/smtp'); - let msg = m.SMTPMessage(); - msg = msg.Body('This is a test message'); -``` - - -#### smtpMessage.From(email) ⇒ SMTPMessage -From adds the from field to the message - -**Kind**: instance method of [SMTPMessage](#module_smtp..SMTPMessage) -**Returns**: SMTPMessage - - The SMTPMessage object after adding the from field. - -| Param | Type | Description | -| --- | --- | --- | -| email | string | The email to add to the from field. | - -**Example** -```js -let m = require('nuclei/smtp'); - let msg = m.SMTPMessage(); - msg = msg.From('test@example.com'); -``` - - -#### smtpMessage.String() ⇒ string -String returns the string representation of the message - -**Kind**: instance method of [SMTPMessage](#module_smtp..SMTPMessage) -**Returns**: string - - The string representation of the message. -**Example** -```js -let m = require('nuclei/smtp'); - let msg = m.SMTPMessage(); - let str = msg.String(); -``` - - -#### smtpMessage.Subject(sub) ⇒ SMTPMessage -Subject adds the subject field to the message - -**Kind**: instance method of [SMTPMessage](#module_smtp..SMTPMessage) -**Returns**: SMTPMessage - - The SMTPMessage object after adding the subject. - -| Param | Type | Description | -| --- | --- | --- | -| sub | string | The subject to add. | - -**Example** -```js -let m = require('nuclei/smtp'); - let msg = m.SMTPMessage(); - msg = msg.Subject('Test Subject'); -``` - - -#### smtpMessage.To(email) ⇒ SMTPMessage -To adds the to field to the message - -**Kind**: instance method of [SMTPMessage](#module_smtp..SMTPMessage) -**Returns**: SMTPMessage - - The SMTPMessage object after adding the to field. - -| Param | Type | Description | -| --- | --- | --- | -| email | string | The email to add to the to field. | - -**Example** -```js -let m = require('nuclei/smtp'); - let msg = m.SMTPMessage(); - msg = msg.To('test@example.com'); -``` +- [IsSMTPResponse](/templates/protocols/javascript/modules/smtp.IsSMTPResponse) diff --git a/templates/protocols/javascript/modules/ssh.Algorithms.mdx b/templates/protocols/javascript/modules/ssh.Algorithms.mdx new file mode 100644 index 0000000..159674c --- /dev/null +++ b/templates/protocols/javascript/modules/ssh.Algorithms.mdx @@ -0,0 +1,54 @@ +# Interface: Algorithms + +[ssh](/templates/protocols/javascript/modules/ssh).Algorithms + +Algorithms Interface + +## Table of contents + +### Properties + +- [HostKey](/templates/protocols/javascript/modules/ssh.Algorithms#hostkey) +- [Kex](/templates/protocols/javascript/modules/ssh.Algorithms#kex) +- [R](/templates/protocols/javascript/modules/ssh.Algorithms#r) +- [W](/templates/protocols/javascript/modules/ssh.Algorithms#w) + +## Properties + +### HostKey + +• `Optional` **HostKey**: `string` + +#### Defined in + +ssh.ts:134 + +___ + +### Kex + +• `Optional` **Kex**: `string` + +#### Defined in + +ssh.ts:132 + +___ + +### R + +• `Optional` **R**: [`DirectionAlgorithms`](/templates/protocols/javascript/modules/ssh.DirectionAlgorithms) + +#### Defined in + +ssh.ts:138 + +___ + +### W + +• `Optional` **W**: [`DirectionAlgorithms`](/templates/protocols/javascript/modules/ssh.DirectionAlgorithms) + +#### Defined in + +ssh.ts:136 diff --git a/templates/protocols/javascript/modules/ssh.DirectionAlgorithms.mdx b/templates/protocols/javascript/modules/ssh.DirectionAlgorithms.mdx new file mode 100644 index 0000000..b16e985 --- /dev/null +++ b/templates/protocols/javascript/modules/ssh.DirectionAlgorithms.mdx @@ -0,0 +1,43 @@ +# Interface: DirectionAlgorithms + +[ssh](/templates/protocols/javascript/modules/ssh).DirectionAlgorithms + +DirectionAlgorithms Interface + +## Table of contents + +### Properties + +- [Cipher](/templates/protocols/javascript/modules/ssh.DirectionAlgorithms#cipher) +- [Compression](/templates/protocols/javascript/modules/ssh.DirectionAlgorithms#compression) +- [MAC](/templates/protocols/javascript/modules/ssh.DirectionAlgorithms#mac) + +## Properties + +### Cipher + +• `Optional` **Cipher**: `string` + +#### Defined in + +ssh.ts:148 + +___ + +### Compression + +• `Optional` **Compression**: `string` + +#### Defined in + +ssh.ts:152 + +___ + +### MAC + +• `Optional` **MAC**: `string` + +#### Defined in + +ssh.ts:150 diff --git a/templates/protocols/javascript/modules/ssh.EndpointId.mdx b/templates/protocols/javascript/modules/ssh.EndpointId.mdx new file mode 100644 index 0000000..cf4197a --- /dev/null +++ b/templates/protocols/javascript/modules/ssh.EndpointId.mdx @@ -0,0 +1,54 @@ +# Interface: EndpointId + +[ssh](/templates/protocols/javascript/modules/ssh).EndpointId + +EndpointId Interface + +## Table of contents + +### Properties + +- [Comment](/templates/protocols/javascript/modules/ssh.EndpointId#comment) +- [ProtoVersion](/templates/protocols/javascript/modules/ssh.EndpointId#protoversion) +- [Raw](/templates/protocols/javascript/modules/ssh.EndpointId#raw) +- [SoftwareVersion](/templates/protocols/javascript/modules/ssh.EndpointId#softwareversion) + +## Properties + +### Comment + +• `Optional` **Comment**: `string` + +#### Defined in + +ssh.ts:164 + +___ + +### ProtoVersion + +• `Optional` **ProtoVersion**: `string` + +#### Defined in + +ssh.ts:168 + +___ + +### Raw + +• `Optional` **Raw**: `string` + +#### Defined in + +ssh.ts:166 + +___ + +### SoftwareVersion + +• `Optional` **SoftwareVersion**: `string` + +#### Defined in + +ssh.ts:162 diff --git a/templates/protocols/javascript/modules/ssh.HandshakeLog.mdx b/templates/protocols/javascript/modules/ssh.HandshakeLog.mdx new file mode 100644 index 0000000..7eb76b2 --- /dev/null +++ b/templates/protocols/javascript/modules/ssh.HandshakeLog.mdx @@ -0,0 +1,87 @@ +# Interface: HandshakeLog + +[ssh](/templates/protocols/javascript/modules/ssh).HandshakeLog + +HandshakeLog Interface + +## Table of contents + +### Properties + +- [AlgorithmSelection](/templates/protocols/javascript/modules/ssh.HandshakeLog#algorithmselection) +- [Banner](/templates/protocols/javascript/modules/ssh.HandshakeLog#banner) +- [ClientID](/templates/protocols/javascript/modules/ssh.HandshakeLog#clientid) +- [ClientKex](/templates/protocols/javascript/modules/ssh.HandshakeLog#clientkex) +- [ServerID](/templates/protocols/javascript/modules/ssh.HandshakeLog#serverid) +- [ServerKex](/templates/protocols/javascript/modules/ssh.HandshakeLog#serverkex) +- [UserAuth](/templates/protocols/javascript/modules/ssh.HandshakeLog#userauth) + +## Properties + +### AlgorithmSelection + +• `Optional` **AlgorithmSelection**: [`Algorithms`](/templates/protocols/javascript/modules/ssh.Algorithms) + +#### Defined in + +ssh.ts:190 + +___ + +### Banner + +• `Optional` **Banner**: `string` + +#### Defined in + +ssh.ts:180 + +___ + +### ClientID + +• `Optional` **ClientID**: [`EndpointId`](/templates/protocols/javascript/modules/ssh.EndpointId) + +#### Defined in + +ssh.ts:184 + +___ + +### ClientKex + +• `Optional` **ClientKex**: [`KexInitMsg`](/templates/protocols/javascript/modules/ssh.KexInitMsg) + +#### Defined in + +ssh.ts:188 + +___ + +### ServerID + +• `Optional` **ServerID**: [`EndpointId`](/templates/protocols/javascript/modules/ssh.EndpointId) + +#### Defined in + +ssh.ts:182 + +___ + +### ServerKex + +• `Optional` **ServerKex**: [`KexInitMsg`](/templates/protocols/javascript/modules/ssh.KexInitMsg) + +#### Defined in + +ssh.ts:186 + +___ + +### UserAuth + +• `Optional` **UserAuth**: `string`[] + +#### Defined in + +ssh.ts:178 diff --git a/templates/protocols/javascript/modules/ssh.KexInitMsg.mdx b/templates/protocols/javascript/modules/ssh.KexInitMsg.mdx new file mode 100644 index 0000000..27efbdb --- /dev/null +++ b/templates/protocols/javascript/modules/ssh.KexInitMsg.mdx @@ -0,0 +1,155 @@ +# Interface: KexInitMsg + +[ssh](/templates/protocols/javascript/modules/ssh).KexInitMsg + +KexInitMsg Interface + +## Table of contents + +### Properties + +- [CiphersClientServer](/templates/protocols/javascript/modules/ssh.KexInitMsg#ciphersclientserver) +- [CiphersServerClient](/templates/protocols/javascript/modules/ssh.KexInitMsg#ciphersserverclient) +- [CompressionClientServer](/templates/protocols/javascript/modules/ssh.KexInitMsg#compressionclientserver) +- [CompressionServerClient](/templates/protocols/javascript/modules/ssh.KexInitMsg#compressionserverclient) +- [Cookie](/templates/protocols/javascript/modules/ssh.KexInitMsg#cookie) +- [FirstKexFollows](/templates/protocols/javascript/modules/ssh.KexInitMsg#firstkexfollows) +- [KexAlgos](/templates/protocols/javascript/modules/ssh.KexInitMsg#kexalgos) +- [LanguagesClientServer](/templates/protocols/javascript/modules/ssh.KexInitMsg#languagesclientserver) +- [LanguagesServerClient](/templates/protocols/javascript/modules/ssh.KexInitMsg#languagesserverclient) +- [MACsClientServer](/templates/protocols/javascript/modules/ssh.KexInitMsg#macsclientserver) +- [MACsServerClient](/templates/protocols/javascript/modules/ssh.KexInitMsg#macsserverclient) +- [Reserved](/templates/protocols/javascript/modules/ssh.KexInitMsg#reserved) +- [ServerHostKeyAlgos](/templates/protocols/javascript/modules/ssh.KexInitMsg#serverhostkeyalgos) + +## Properties + +### CiphersClientServer + +• `Optional` **CiphersClientServer**: `string`[] + +#### Defined in + +ssh.ts:212 + +___ + +### CiphersServerClient + +• `Optional` **CiphersServerClient**: `string`[] + +#### Defined in + +ssh.ts:224 + +___ + +### CompressionClientServer + +• `Optional` **CompressionClientServer**: `string`[] + +#### Defined in + +ssh.ts:218 + +___ + +### CompressionServerClient + +• `Optional` **CompressionServerClient**: `string`[] + +#### Defined in + +ssh.ts:214 + +___ + +### Cookie + +• `Optional` **Cookie**: `Uint8Array` + +fixed size array of length: [16] + +#### Defined in + +ssh.ts:208 + +___ + +### FirstKexFollows + +• `Optional` **FirstKexFollows**: `boolean` + +#### Defined in + +ssh.ts:228 + +___ + +### KexAlgos + +• `Optional` **KexAlgos**: `string`[] + +#### Defined in + +ssh.ts:222 + +___ + +### LanguagesClientServer + +• `Optional` **LanguagesClientServer**: `string`[] + +#### Defined in + +ssh.ts:200 + +___ + +### LanguagesServerClient + +• `Optional` **LanguagesServerClient**: `string`[] + +#### Defined in + +ssh.ts:202 + +___ + +### MACsClientServer + +• `Optional` **MACsClientServer**: `string`[] + +#### Defined in + +ssh.ts:226 + +___ + +### MACsServerClient + +• `Optional` **MACsServerClient**: `string`[] + +#### Defined in + +ssh.ts:216 + +___ + +### Reserved + +• `Optional` **Reserved**: `number` + +#### Defined in + +ssh.ts:220 + +___ + +### ServerHostKeyAlgos + +• `Optional` **ServerHostKeyAlgos**: `string`[] + +#### Defined in + +ssh.ts:210 diff --git a/templates/protocols/javascript/modules/ssh.SSHClient.mdx b/templates/protocols/javascript/modules/ssh.SSHClient.mdx new file mode 100644 index 0000000..b3b63a9 --- /dev/null +++ b/templates/protocols/javascript/modules/ssh.SSHClient.mdx @@ -0,0 +1,243 @@ +# Class: SSHClient + +[ssh](/templates/protocols/javascript/modules/ssh).SSHClient + +SSHClient is a client for SSH servers. +Internally client uses github.com/zmap/zgrab2/lib/ssh driver. + +**`Example`** + +```javascript +const ssh = require('nuclei/ssh'); +const client = new ssh.Client(); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/ssh.SSHClient#constructor) + +### Methods + +- [Close](/templates/protocols/javascript/modules/ssh.SSHClient#close) +- [Connect](/templates/protocols/javascript/modules/ssh.SSHClient#connect) +- [ConnectSSHInfoMode](/templates/protocols/javascript/modules/ssh.SSHClient#connectsshinfomode) +- [ConnectWithKey](/templates/protocols/javascript/modules/ssh.SSHClient#connectwithkey) +- [Run](/templates/protocols/javascript/modules/ssh.SSHClient#run) +- [SetTimeout](/templates/protocols/javascript/modules/ssh.SSHClient#settimeout) + +## Constructors + +### constructor + +• **new SSHClient**(): [`SSHClient`](/templates/protocols/javascript/modules/ssh.SSHClient) + +#### Returns + +[`SSHClient`](/templates/protocols/javascript/modules/ssh.SSHClient) + +#### Defined in + +ssh.ts:16 + +## Methods + +### Close + +▸ **Close**(): `boolean` + +Close closes the SSH connection and destroys the client +Returns the success state and error. If error is not nil, +state will be false + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const ssh = require('nuclei/ssh'); +const client = new ssh.Client(); +client.Connect('acme.com', 22, 'username', 'password'); +const closed = client.Close(); +``` + +#### Defined in + +ssh.ts:118 + +___ + +### Connect + +▸ **Connect**(`host`, `port`, `username`): `boolean` + +Connect tries to connect to provided host and port +with provided username and password with ssh. +Returns state of connection and error. If error is not nil, +state will be false + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `username` | `string` | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const ssh = require('nuclei/ssh'); +const client = new ssh.Client(); +const connected = client.Connect('acme.com', 22, 'username', 'password'); +``` + +#### Defined in + +ssh.ts:43 + +___ + +### ConnectSSHInfoMode + +▸ **ConnectSSHInfoMode**(`host`, `port`): [`HandshakeLog`](/templates/protocols/javascript/modules/ssh.HandshakeLog) + +ConnectSSHInfoMode tries to connect to provided host and port +with provided host and port +Returns HandshakeLog and error. If error is not nil, +state will be false +HandshakeLog is a struct that contains information about the +ssh connection + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +[`HandshakeLog`](/templates/protocols/javascript/modules/ssh.HandshakeLog) + +**`Example`** + +```javascript +const ssh = require('nuclei/ssh'); +const client = new ssh.Client(); +const info = client.ConnectSSHInfoMode('acme.com', 22); +log(to_json(info)); +``` + +#### Defined in + +ssh.ts:81 + +___ + +### ConnectWithKey + +▸ **ConnectWithKey**(`host`, `port`, `username`): `boolean` + +ConnectWithKey tries to connect to provided host and port +with provided username and private_key. +Returns state of connection and error. If error is not nil, +state will be false + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | +| `username` | `string` | + +#### Returns + +`boolean` + +**`Example`** + +```javascript +const ssh = require('nuclei/ssh'); +const client = new ssh.Client(); +const privateKey = `-----BEGIN RSA PRIVATE KEY----- ...`; +const connected = client.ConnectWithKey('acme.com', 22, 'username', privateKey); +``` + +#### Defined in + +ssh.ts:61 + +___ + +### Run + +▸ **Run**(`cmd`): `string` + +Run tries to open a new SSH session, then tries to execute +the provided command in said session +Returns string and error. If error is not nil, +state will be false +The string contains the command output + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cmd` | `string` | + +#### Returns + +`string` + +**`Example`** + +```javascript +const ssh = require('nuclei/ssh'); +const client = new ssh.Client(); +client.Connect('acme.com', 22, 'username', 'password'); +const output = client.Run('id'); +log(output); +``` + +#### Defined in + +ssh.ts:101 + +___ + +### SetTimeout + +▸ **SetTimeout**(`sec`): `void` + +SetTimeout sets the timeout for the SSH connection in seconds + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sec` | `number` | + +#### Returns + +`void` + +**`Example`** + +```javascript +const ssh = require('nuclei/ssh'); +const client = new ssh.Client(); +client.SetTimeout(10); +``` + +#### Defined in + +ssh.ts:26 diff --git a/templates/protocols/javascript/modules/ssh.mdx b/templates/protocols/javascript/modules/ssh.mdx index 1059c0d..cc7ce84 100644 --- a/templates/protocols/javascript/modules/ssh.mdx +++ b/templates/protocols/javascript/modules/ssh.mdx @@ -1,165 +1,15 @@ - +# Namespace: ssh -## ssh +## Table of contents -* [ssh](#module_ssh) - * [`SSHClient`](#module_ssh..SSHClient) - * [`.Close()`](#module_ssh..SSHClient+Close) ⇒ boolean - * [`.Connect(host, port, username, password)`](#module_ssh..SSHClient+Connect) ⇒ boolean - * [`.ConnectSSHInfoMode(host, port)`](#module_ssh..SSHClient+ConnectSSHInfoMode) ⇒ HandshakeLog - * [`.ConnectWithKey(host, port, username, key)`](#module_ssh..SSHClient+ConnectWithKey) ⇒ boolean - * [`.Run(cmd)`](#module_ssh..SSHClient+Run) ⇒ string - * [`.SetTimeout(sec)`](#module_ssh..SSHClient+SetTimeout) - * [`HandshakeLog`](#module_ssh..HandshakeLog) : object +### Classes - +- [SSHClient](/templates/protocols/javascript/modules/ssh.SSHClient) -### (ssh).SSHClient -SSHClient is a client for SSH servers. Internally client uses github.com/zmap/zgrab2/lib/ssh driver. +### Interfaces -**Kind**: inner class of [ssh](#module_ssh) - -* [`SSHClient`](#module_ssh..SSHClient) - * [`.Close()`](#module_ssh..SSHClient+Close) ⇒ boolean - * [`.Connect(host, port, username, password)`](#module_ssh..SSHClient+Connect) ⇒ boolean - * [`.ConnectSSHInfoMode(host, port)`](#module_ssh..SSHClient+ConnectSSHInfoMode) ⇒ HandshakeLog - * [`.ConnectWithKey(host, port, username, key)`](#module_ssh..SSHClient+ConnectWithKey) ⇒ boolean - * [`.Run(cmd)`](#module_ssh..SSHClient+Run) ⇒ string - * [`.SetTimeout(sec)`](#module_ssh..SSHClient+SetTimeout) - - - -#### sshClient.Close() ⇒ boolean -Close closes the SSH connection and destroys the client - -**Kind**: instance method of [SSHClient](#module_ssh..SSHClient) -**Returns**: boolean - - The success state of the operation. -**Throws**: - -- error - The error encountered during the operation. - -**Example** -```js -let m = require('nuclei/ssh'); - let c = m.SSHClient(); - let state = c.Connect('localhost', 22, 'user', 'password'); - let result = c.Close(); -``` - - -#### sshClient.Connect(host, port, username, password) ⇒ boolean -Connect tries to connect to provided host and port with provided username and password with ssh. - -**Kind**: instance method of [SSHClient](#module_ssh..SSHClient) -**Returns**: boolean - - The success state of the operation. -**Throws**: - -- error - The error encountered during the operation. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to connect to. | -| port | number | The port to connect to. | -| username | string | The username for the connection. | -| password | string | The password for the connection. | - -**Example** -```js -let m = require('nuclei/ssh'); - let c = m.SSHClient(); - let result = c.Connect('localhost', 22, 'user', 'password'); -``` - - -#### sshClient.ConnectSSHInfoMode(host, port) ⇒ HandshakeLog -ConnectSSHInfoMode tries to connect to provided host and port with provided host and port - -**Kind**: instance method of [SSHClient](#module_ssh..SSHClient) -**Returns**: HandshakeLog - - The HandshakeLog object containing information about the ssh connection. -**Throws**: - -- error - The error encountered during the operation. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to connect to. | -| port | number | The port to connect to. | - -**Example** -```js -let m = require('nuclei/ssh'); - let c = m.SSHClient(); - let result = c.ConnectSSHInfoMode('localhost', 22); -``` - - -#### sshClient.ConnectWithKey(host, port, username, key) ⇒ boolean -ConnectWithKey tries to connect to provided host and port with provided username and private_key. - -**Kind**: instance method of [SSHClient](#module_ssh..SSHClient) -**Returns**: boolean - - The success state of the operation. -**Throws**: - -- error - The error encountered during the operation. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to connect to. | -| port | number | The port to connect to. | -| username | string | The username for the connection. | -| key | string | The private key for the connection. | - -**Example** -```js -let m = require('nuclei/ssh'); - let c = m.SSHClient(); - let result = c.ConnectWithKey('localhost', 22, 'user', 'key'); -``` - - -#### sshClient.Run(cmd) ⇒ string -Run tries to open a new SSH session, then tries to execute the provided command in said session - -**Kind**: instance method of [SSHClient](#module_ssh..SSHClient) -**Returns**: string - - The output of the command. -**Throws**: - -- error - The error encountered during the operation. - - -| Param | Type | Description | -| --- | --- | --- | -| cmd | string | The command to execute. | - -**Example** -```js -let m = require('nuclei/ssh'); - let c = m.SSHClient(); - let result = c.Run('ls'); -``` - - -#### sshClient.SetTimeout(sec) -SetTimeout sets the timeout for the SSH connection in seconds - -**Kind**: instance method of [SSHClient](#module_ssh..SSHClient) - -| Param | Type | Description | -| --- | --- | --- | -| sec | number | The number of seconds for the timeout. | - -**Example** -```js -let m = require('nuclei/ssh'); - let c = m.SSHClient(); - c.SetTimeout(30); -``` - - -### (ssh).HandshakeLog : object -HandshakeLog is a struct that contains information about the ssh connection. - -**Kind**: inner typedef of [ssh](#module_ssh) +- [Algorithms](/templates/protocols/javascript/modules/ssh.Algorithms) +- [DirectionAlgorithms](/templates/protocols/javascript/modules/ssh.DirectionAlgorithms) +- [EndpointId](/templates/protocols/javascript/modules/ssh.EndpointId) +- [HandshakeLog](/templates/protocols/javascript/modules/ssh.HandshakeLog) +- [KexInitMsg](/templates/protocols/javascript/modules/ssh.KexInitMsg) diff --git a/templates/protocols/javascript/modules/structs.mdx b/templates/protocols/javascript/modules/structs.mdx index aa91ee7..ea36b39 100644 --- a/templates/protocols/javascript/modules/structs.mdx +++ b/templates/protocols/javascript/modules/structs.mdx @@ -1,77 +1,105 @@ - +# Namespace: structs -## structs +## Table of contents -* [structs](#module_structs) - * [`Pack(formatStr, msg)`](#module_structs..Pack) ⇒ Uint8Array - * [`StructsCalcSize(format)`](#module_structs..StructsCalcSize) ⇒ number - * [`Unpack(format, msg)`](#module_structs..Unpack) +### Functions - +- [Pack](/templates/protocols/javascript/modules/structs#pack) +- [StructsCalcSize](/templates/protocols/javascript/modules/structs#structscalcsize) +- [Unpack](/templates/protocols/javascript/modules/structs#unpack) -### (structs).Pack(formatStr, msg) ⇒ Uint8Array -Pack returns a byte slice containing the values of msg slice packed according to the given format. +## Functions + +### Pack + +▸ **Pack**(`formatStr`, `msg`): `Uint8Array` \| ``null`` + +StructsPack returns a byte slice containing the values of msg slice packed according to the given format. The items of msg slice must match the values required by the format exactly. +Ex: structs.pack("H", 0) -**Kind**: inner method of [structs](#module_structs) -**Returns**: Uint8Array - - The packed message in a byte array. -**Throws**: +#### Parameters -- error - The error encountered during packing. +| Name | Type | +| :------ | :------ | +| `formatStr` | `string` | +| `msg` | `any` | +#### Returns -| Param | Type | Description | -| --- | --- | --- | -| formatStr | string | The format string. | -| msg | Array.<any> | The message to be packed. | +`Uint8Array` \| ``null`` -**Example** -```js -let s = require('nuclei/structs'); -let packedMsg = s.Pack("H", [0]); +**`Example`** + +```javascript +const structs = require('nuclei/structs'); +const packed = structs.Pack('H', [0]); ``` - -### (structs).StructsCalcSize(format) ⇒ number +#### Defined in + +structs.ts:13 + +___ + +### StructsCalcSize + +▸ **StructsCalcSize**(`format`): `number` \| ``null`` + StructsCalcSize returns the number of bytes needed to pack the values according to the given format. +Ex: structs.CalcSize("H") -**Kind**: inner method of [structs](#module_structs) -**Returns**: number - - The number of bytes needed to pack the values. -**Throws**: +#### Parameters -- error - The error encountered during calculation. +| Name | Type | +| :------ | :------ | +| `format` | `string` | +#### Returns -| Param | Type | Description | -| --- | --- | --- | -| format | string | The format string. | +`number` \| ``null`` -**Example** -```js -let s = require('nuclei/structs'); -let size = s.StructsCalcSize("H"); +**`Example`** + +```javascript +const structs = require('nuclei/structs'); +const size = structs.CalcSize('H'); ``` - -### (structs).Unpack(format, msg) -Unpack the byte slice (presumably packed by Pack(format, msg)) according to the given format. +#### Defined in + +structs.ts:28 + +___ + +### Unpack + +▸ **Unpack**(`format`, `msg`): `any` \| ``null`` + +StructsUnpack the byte slice (presumably packed by Pack(format, msg)) according to the given format. The result is a []interface{} slice even if it contains exactly one item. The byte slice must contain not less the amount of data required by the format (len(msg) must more or equal CalcSize(format)). +Ex: structs.Unpack(">I", buff[:nb]) + +#### Parameters -**Kind**: inner method of [structs](#module_structs) -**Throws**: +| Name | Type | +| :------ | :------ | +| `format` | `string` | +| `msg` | `Uint8Array` | -- error - The error encountered during unpacking. +#### Returns +`any` \| ``null`` -| Param | Type | Description | -| --- | --- | --- | -| format | string | The format string. | -| msg | Uint8Array | The packed message to be unpacked. | +**`Example`** -**Example** -```js -let s = require('nuclei/structs'); -let unpackedMsg = s.Unpack(">I", buff[:nb]); +```javascript +const structs = require('nuclei/structs'); +const result = structs.Unpack('H', [0]); ``` + +#### Defined in + +structs.ts:46 diff --git a/templates/protocols/javascript/modules/telnet.IsTelnetResponse.mdx b/templates/protocols/javascript/modules/telnet.IsTelnetResponse.mdx new file mode 100644 index 0000000..f1ba73c --- /dev/null +++ b/templates/protocols/javascript/modules/telnet.IsTelnetResponse.mdx @@ -0,0 +1,41 @@ +# Interface: IsTelnetResponse + +[telnet](/templates/protocols/javascript/modules/telnet).IsTelnetResponse + +IsTelnetResponse is the response from the IsTelnet function. +this is returned by IsTelnet function. + +**`Example`** + +```javascript +const telnet = require('nuclei/telnet'); +const isTelnet = telnet.IsTelnet('acme.com', 23); +log(toJSON(isTelnet)); +``` + +## Table of contents + +### Properties + +- [Banner](/templates/protocols/javascript/modules/telnet.IsTelnetResponse#banner) +- [IsTelnet](/templates/protocols/javascript/modules/telnet.IsTelnetResponse#istelnet) + +## Properties + +### Banner + +• `Optional` **Banner**: `string` + +#### Defined in + +telnet.ts:48 + +___ + +### IsTelnet + +• `Optional` **IsTelnet**: `boolean` + +#### Defined in + +telnet.ts:46 diff --git a/templates/protocols/javascript/modules/telnet.TelnetClient.mdx b/templates/protocols/javascript/modules/telnet.TelnetClient.mdx new file mode 100644 index 0000000..0c7974f --- /dev/null +++ b/templates/protocols/javascript/modules/telnet.TelnetClient.mdx @@ -0,0 +1,67 @@ +# Class: TelnetClient + +[telnet](/templates/protocols/javascript/modules/telnet).TelnetClient + +TelnetClient is a minimal Telnet client for nuclei scripts. + +**`Example`** + +```javascript +const telnet = require('nuclei/telnet'); +const client = new telnet.Client(); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/telnet.TelnetClient#constructor) + +### Methods + +- [IsTelnet](/templates/protocols/javascript/modules/telnet.TelnetClient#istelnet) + +## Constructors + +### constructor + +• **new TelnetClient**(): [`TelnetClient`](/templates/protocols/javascript/modules/telnet.TelnetClient) + +#### Returns + +[`TelnetClient`](/templates/protocols/javascript/modules/telnet.TelnetClient) + +#### Defined in + +telnet.ts:15 + +## Methods + +### IsTelnet + +▸ **IsTelnet**(`host`, `port`): [`IsTelnetResponse`](/templates/protocols/javascript/modules/telnet.IsTelnetResponse) + +IsTelnet checks if a host is running a Telnet server. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +[`IsTelnetResponse`](/templates/protocols/javascript/modules/telnet.IsTelnetResponse) + +**`Example`** + +```javascript +const telnet = require('nuclei/telnet'); +const isTelnet = telnet.IsTelnet('acme.com', 23); +log(toJSON(isTelnet)); +``` + +#### Defined in + +telnet.ts:25 diff --git a/templates/protocols/javascript/modules/telnet.mdx b/templates/protocols/javascript/modules/telnet.mdx index ae4ba86..2a2196c 100644 --- a/templates/protocols/javascript/modules/telnet.mdx +++ b/templates/protocols/javascript/modules/telnet.mdx @@ -1,44 +1,11 @@ - +# Namespace: telnet -## telnet +## Table of contents -* [telnet](#module_telnet) - * [`TelnetClient`](#module_telnet..TelnetClient) - * [`.IsTelnet(host, port)`](#module_telnet..TelnetClient+IsTelnet) ⇒ IsTelnetResponse - * [`IsTelnetResponse`](#module_telnet..IsTelnetResponse) : object +### Classes - +- [TelnetClient](/templates/protocols/javascript/modules/telnet.TelnetClient) -### (telnet).TelnetClient -TelnetClient is a minimal Telnet client for nuclei scripts +### Interfaces -**Kind**: inner class of [telnet](#module_telnet) - - -#### telnetClient.IsTelnet(host, port) ⇒ IsTelnetResponse -IsTelnet checks if a host is running a Telnet server - -**Kind**: instance method of [TelnetClient](#module_telnet..TelnetClient) -**Returns**: IsTelnetResponse - - The response of the IsTelnet check. -**Throws**: - -- error - The error encountered during the IsTelnet check. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check for Telnet server. | -| port | int | The port to check for Telnet server. | - -**Example** -```js -let m = require('nuclei/telnet'); -let c = m.TelnetClient(); -let response = c.IsTelnet('localhost', 23); -``` - - -### (telnet).IsTelnetResponse : object -IsTelnetResponse is an object containing the response of the IsTelnet check. - -**Kind**: inner typedef of [telnet](#module_telnet) +- [IsTelnetResponse](/templates/protocols/javascript/modules/telnet.IsTelnetResponse) diff --git a/templates/protocols/javascript/modules/vnc.IsVNCResponse.mdx b/templates/protocols/javascript/modules/vnc.IsVNCResponse.mdx new file mode 100644 index 0000000..02a7fde --- /dev/null +++ b/templates/protocols/javascript/modules/vnc.IsVNCResponse.mdx @@ -0,0 +1,40 @@ +# Interface: IsVNCResponse + +[vnc](/templates/protocols/javascript/modules/vnc).IsVNCResponse + +IsVNCResponse is the response from the IsVNC function. + +**`Example`** + +```javascript +const vnc = require('nuclei/vnc'); +const isVNC = vnc.IsVNC('acme.com', 5900); +log(toJSON(isVNC)); +``` + +## Table of contents + +### Properties + +- [Banner](/templates/protocols/javascript/modules/vnc.IsVNCResponse#banner) +- [IsVNC](/templates/protocols/javascript/modules/vnc.IsVNCResponse#isvnc) + +## Properties + +### Banner + +• `Optional` **Banner**: `string` + +#### Defined in + +vnc.ts:49 + +___ + +### IsVNC + +• `Optional` **IsVNC**: `boolean` + +#### Defined in + +vnc.ts:47 diff --git a/templates/protocols/javascript/modules/vnc.VNCClient.mdx b/templates/protocols/javascript/modules/vnc.VNCClient.mdx new file mode 100644 index 0000000..9a132bd --- /dev/null +++ b/templates/protocols/javascript/modules/vnc.VNCClient.mdx @@ -0,0 +1,69 @@ +# Class: VNCClient + +[vnc](/templates/protocols/javascript/modules/vnc).VNCClient + +VNCClient is a minimal VNC client for nuclei scripts. + +**`Example`** + +```javascript +const vnc = require('nuclei/vnc'); +const client = new vnc.Client(); +``` + +## Table of contents + +### Constructors + +- [constructor](/templates/protocols/javascript/modules/vnc.VNCClient#constructor) + +### Methods + +- [IsVNC](/templates/protocols/javascript/modules/vnc.VNCClient#isvnc) + +## Constructors + +### constructor + +• **new VNCClient**(): [`VNCClient`](/templates/protocols/javascript/modules/vnc.VNCClient) + +#### Returns + +[`VNCClient`](/templates/protocols/javascript/modules/vnc.VNCClient) + +#### Defined in + +vnc.ts:15 + +## Methods + +### IsVNC + +▸ **IsVNC**(`host`, `port`): [`IsVNCResponse`](/templates/protocols/javascript/modules/vnc.IsVNCResponse) + +IsVNC checks if a host is running a VNC server. +It returns a boolean indicating if the host is running a VNC server +and the banner of the VNC server. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `host` | `string` | +| `port` | `number` | + +#### Returns + +[`IsVNCResponse`](/templates/protocols/javascript/modules/vnc.IsVNCResponse) + +**`Example`** + +```javascript +const vnc = require('nuclei/vnc'); +const isVNC = vnc.IsVNC('acme.com', 5900); +log(toJSON(isVNC)); +``` + +#### Defined in + +vnc.ts:27 diff --git a/templates/protocols/javascript/modules/vnc.mdx b/templates/protocols/javascript/modules/vnc.mdx index 64603ad..c13a4a8 100644 --- a/templates/protocols/javascript/modules/vnc.mdx +++ b/templates/protocols/javascript/modules/vnc.mdx @@ -1,44 +1,11 @@ - +# Namespace: vnc -## vnc +## Table of contents -* [vnc](#module_vnc) - * [`VNCClient`](#module_vnc..VNCClient) - * [`.IsVNC(host, port)`](#module_vnc..VNCClient+IsVNC) ⇒ IsVNCResponse - * [`IsVNCResponse`](#module_vnc..IsVNCResponse) : object +### Classes - +- [VNCClient](/templates/protocols/javascript/modules/vnc.VNCClient) -### (vnc).VNCClient -VNCClient is a minimal VNC client for nuclei scripts. +### Interfaces -**Kind**: inner class of [vnc](#module_vnc) - - -#### vncClient.IsVNC(host, port) ⇒ IsVNCResponse -IsVNC checks if a host is running a VNC server. - -**Kind**: instance method of [VNCClient](#module_vnc..VNCClient) -**Returns**: IsVNCResponse - - The response indicating if the host is running a VNC server and the banner of the VNC server. -**Throws**: - -- error - The error encountered during the check. - - -| Param | Type | Description | -| --- | --- | --- | -| host | string | The host to check. | -| port | number | The port to check. | - -**Example** -```js -let m = require('nuclei/vnc'); -let c = m.VNCClient(); -let response = c.IsVNC('localhost', 5900); -``` - - -### (vnc).IsVNCResponse : object -IsVNCResponse is an object containing the response of the IsVNC method. - -**Kind**: inner typedef of [vnc](#module_vnc) +- [IsVNCResponse](/templates/protocols/javascript/modules/vnc.IsVNCResponse)