WS_FTP Password Recovery

Share your advanced PureBasic knowledge/code with the community.
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

WS_FTP Password Recovery

Post by benny »

Code updated For 5.20+

Hello,

here are two routines ported to PureBasic to recover your Passwords decrypted by the programm WS_FTP!

For new WS_FTP Versions:

Code: Select all

Procedure.s DecryptNeu(pw.s)
  
  If (Len(pw.s) < 35)
    ProcedureReturn "Err01"  ; PW-Länge zu kurz
  EndIf
  
  noofpwchars=Len(pw.s)
  a = noofpwchars % 2                ; PW-Länge muß ungerade sein!
  If (a = 0)
    ProcedureReturn "Err02"  ; PW falsche Länge
  EndIf
  
  lenofpw = ((Len(pw.s)-33) / 2)
  
  For i=1 To lenofpw
    ascii.s     = Mid(pw.s, i+1, 1);
    asciiCode.l = Asc(ascii)
    asciiCode = asciiCode & 63
    
    pwchar.s = "$"+ Mid(pw.s, (32+(i*2)), 2)
    pwcharint.l = Val(pwchar.s)
    
    pwchar.s = Chr(pwcharint-asciiCode-(i-1))
    dpw.s = dpw.s+pwchar.s
  Next i
  
  ProcedureReturn dpw.s
  
EndProcedure
The Decryption-Routine for older Versions

Code: Select all

Procedure.s DecryptOld(pw.s)
  
  If (Len(pw.s) < 2)
    ProcedureReturn "Err01"  ; PW-Länge zu kurz
  EndIf
  
  noofpwchars=Len(pw.s)
  a = noofpwchars % 2                ; PW-Länge muß gerade sein!
  If (a <> 0)
    ProcedureReturn "Err02"  ; PW falsche Länge
  EndIf
  
  lenofpw = (Len(pw.s) / 2)
  
  For i=1 To lenofpw
    pwchar.s = "$" + Mid(pw.s,(i*2)-1,2)
    pwcharint.l = Val(pwchar.s)
    
    pwchar.s = Chr(pwcharint - (i-1))
    dpw.s = dpw.s + pwchar.s
  Next i
  
  ProcedureReturn dpw.s
  
EndProcedure

I compiled them into a little tool, which you can download here :

http://www.weltenkonstrukteur.de/cw.html
regards,
benny!
-
pe0ple ar3 str4nge!!!
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

The WS people sure didn't use very strong encryption did they!

Thanks for sharing!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

@Karbon:

Indeed, I was really surprised [shocked] when I found out how simple the encryption is.
regards,
benny!
-
pe0ple ar3 str4nge!!!
Post Reply