Results 1 to 5 of 5

Thread: for people who use DW MX or DW MX 2004

  1. #1

    Thread Starter
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090

    for people who use DW MX or DW MX 2004

    If you use this software you'll know that it can store the server login and password so that it can upload files at the click of a button. Well, macromedia didn't bother with much encryption of the password. I've attached the .exe which will tell you your passwords. And here's the source code for you who don't trust me:
    VB Code:
    1. Private Sub Command1_Click()
    2. MsgBox get_pass(GetSettingString(HKEY_USERS, "S-1-5-21-1275210071-492894223-682003330-1003\Software\Macromedia\Common\2004\Sites\-Site0", "User PW"))
    3. End Sub
    4.  
    5. Private Function get_pass(password)
    6. Dim chars_in_disguise() As String
    7. Dim i As Byte
    8. Dim j As Byte
    9.  
    10. ReDim chars_in_disguise(Len(password) / 2)
    11. j = 1
    12. For i = 0 To UBound(chars_in_disguise) - 1
    13.     chars_in_disguise(i) = Mid(password, j, 2)
    14.     j = j + 2
    15. Next i
    16.  
    17. j = 0
    18. For i = 0 To UBound(chars_in_disguise) - 1
    19.     chars_in_disguise(i) = chars_in_disguise(i)
    20.     chars_in_disguise(i) = CLng("&H" & chars_in_disguise(i))
    21.     chars_in_disguise(i) = Chr(chars_in_disguise(i) - j)
    22.     j = j + 1
    23. Next i
    24. get_pass = Join(chars_in_disguise(), "")
    25. End Function
    26.  
    27. Private Sub Form_Load()
    28. Dim i As Byte
    29. Dim str As String
    30. 'DW MX 2004
    31. i = 0
    32. While Len(GetSettingString(HKEY_USERS, "S-1-5-21-1275210071-492894223-682003330-1003\Software\Macromedia\Common\2004\Sites\-Site" & i, "User PW")) > 0
    33.     str = GetSettingString(HKEY_USERS, "S-1-5-21-1275210071-492894223-682003330-1003\Software\Macromedia\Common\2004\Sites\-Site" & i, "Host")
    34.     str = str & " - " & GetSettingString(HKEY_USERS, "S-1-5-21-1275210071-492894223-682003330-1003\Software\Macromedia\Common\2004\Sites\-Site" & i, "User")
    35.     str = str & " - " & get_pass(GetSettingString(HKEY_USERS, "S-1-5-21-1275210071-492894223-682003330-1003\Software\Macromedia\Common\2004\Sites\-Site" & i, "User PW"))
    36.     List1.AddItem str
    37.     i = i + 1
    38. Wend
    39.  
    40. 'DW MX
    41. i = 0
    42. While Len(GetSettingString(HKEY_USERS, "S-1-5-21-1275210071-492894223-682003330-1003\Software\Macromedia\Dreamweaver 6\Sites\-Site" & i, "User PW")) > 0
    43.     str = GetSettingString(HKEY_USERS, "S-1-5-21-1275210071-492894223-682003330-1003\Software\Macromedia\Dreamweaver 6\Sites\-Site" & i, "Host")
    44.     str = str & " - " & GetSettingString(HKEY_USERS, "S-1-5-21-1275210071-492894223-682003330-1003\Software\Macromedia\Dreamweaver 6\Sites\-Site" & i, "User")
    45.     str = str & " - " & get_pass(GetSettingString(HKEY_USERS, "S-1-5-21-1275210071-492894223-682003330-1003\Software\Macromedia\Dreamweaver 6\Sites\-Site" & i, "User PW"))
    46.     List1.AddItem str
    47.     i = i + 1
    48. Wend
    49. End Sub

    and the registry.bas file:
    VB Code:
    1. 'Thanks to KayJay for this (from codebank)
    2. Option Explicit
    3.  
    4. Public Const HKEY_CLASSES_ROOT = &H80000000
    5. Public Const HKEY_CURRENT_USER = &H80000001
    6. Public Const HKEY_LOCAL_MACHINE = &H80000002
    7. Public Const HKEY_USERS = &H80000003
    8. Public Const HKEY_PERFORMANCE_DATA = &H80000004
    9. Public Const HKEY_CURRENT_CONFIG = &H80000005
    10. Public Const HKEY_DYN_DATA = &H80000006
    11. Public Const REG_SZ = 1                         ' Unicode nul terminated string
    12. Public Const REG_BINARY = 3                     ' Free form binary
    13. Public Const REG_DWORD = 4                      ' 32-bit number
    14. Public Const ERROR_SUCCESS = 0&
    15.  
    16. Public Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
    17. Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
    18. Public Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
    19.  
    20.  
    21. Public Function GetSettingString(hKey As Long, strPath As String, strValue As String, Optional Default As String) As String
    22. Dim hCurKey As Long
    23. Dim lValueType As Long
    24. Dim strBuffer As String
    25. Dim lDataBufferSize As Long
    26. Dim intZeroPos As Integer
    27. Dim lRegResult As Long
    28.  
    29. ' Set up default value
    30. If Not IsEmpty(Default) Then
    31.   GetSettingString = Default
    32. Else
    33.   GetSettingString = ""
    34. End If
    35.  
    36. ' Open the key and get length of string
    37. lRegResult = RegOpenKey(hKey, strPath, hCurKey)
    38. lRegResult = RegQueryValueEx(hCurKey, strValue, 0&, lValueType, ByVal 0&, lDataBufferSize)
    39.  
    40. If lRegResult = ERROR_SUCCESS Then
    41.  
    42.   If lValueType = REG_SZ Then
    43.     ' initialise string buffer and retrieve string
    44.     strBuffer = String(lDataBufferSize, " ")
    45.     lRegResult = RegQueryValueEx(hCurKey, strValue, 0&, 0&, ByVal strBuffer, lDataBufferSize)
    46.    
    47.     ' format string
    48.     intZeroPos = InStr(strBuffer, Chr$(0))
    49.     If intZeroPos > 0 Then
    50.       GetSettingString = Left$(strBuffer, intZeroPos - 1)
    51.     Else
    52.       GetSettingString = strBuffer
    53.     End If
    54.  
    55.   End If
    56.  
    57. Else
    58.   ' there is a problem
    59. End If
    60.  
    61. lRegResult = RegCloseKey(hCurKey)
    62. End Function


    conclusion, don't manage your site in DW on a public PC.
    Have I helped you? Please Rate my posts.

  2. #2

    Thread Starter
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    forgot the attchement, here it is.
    Attached Files Attached Files
    Have I helped you? Please Rate my posts.

  3. #3
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    I use DW every day and have never had a problem
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    If there's too much encryption DW itself can't decrypt it, unless the decryption requires a password, and that kind defeats the purpose of storing passwords, doesn't it?

    Bottom line: Not DW's fault. Just don't let a public PC ever save your passwords.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    Originally posted by Arc
    I use DW every day and have never had a problem
    I'm not saying that there is a problem. Justy a risk. Try running the app. I've never tried it on any PCs other than my own, so it might not actually work.

    If it works, then you know not to use DW on the same PC as someone who could use this or similair code to get the password.

    and CB, yeah, I suppose it's not their fault. But stil worth knowing.
    Have I helped you? Please Rate my posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width