Advertisement
Guest User

IMGBB.COM/IBB.CO PNG IMAGE FINDER

a guest
Mar 20th, 2018
486
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 3.03 KB | None | 0 0
  1. use strict;
  2. use threads ('exit' => 'threads_only');
  3. use IO::Socket;
  4.  
  5. # Helps to find similar PNG images
  6. # uploaded around. For example
  7. # if direct link you have for
  8. # original image looks like
  9. #
  10. # https://image.ibb.co/abcdef/z.png
  11. #
  12. # Then using this script
  13. # you can search for another
  14. # images uploaded in the same dir
  15. #
  16. # https://image.ibb.co/a**def/..png
  17. #
  18. # Where * will be used for bruteforce
  19. #
  20. # Script will create 60 threads where
  21. # every new thread will get unique
  22. # char in second position to brute
  23. # and will use every possible char
  24. # at third position of filepath
  25. #
  26. # Script will accept images as right
  27. # only if image is in PNG format and
  28. # have a width which equals to 720px
  29.  
  30.  
  31. # This is a "*" in "*bcdef" filepath
  32. my $prefix_char1 = "";
  33.  
  34. # Do not touch
  35. my $prefix_char2 = "";
  36.  
  37. # This is a "***" in "abc***" filepath
  38. my $suffix_string = "YPc";
  39.  
  40. # Let's find 'em all!
  41.  
  42. my $prefix_string = "0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ";
  43. my @prefix_list = reverse split "", $prefix_string;
  44.  
  45. my @thread_array;
  46. my @thread_alive;
  47. my $thread_handle;
  48. my $thread_waiting;
  49.  
  50. foreach $prefix_char2 (@prefix_list) {
  51.   push @thread_array, threads->create(\&thread, $prefix_char2, $prefix_char1, $suffix_string);
  52. }
  53.  
  54. foreach $thread_handle (@thread_array) {
  55.   $thread_handle->join();
  56. }
  57.  
  58. while (1) {
  59.   @thread_alive = threads->list(threads::running);
  60.   $thread_waiting = $#thread_alive + 1;
  61.   if ($thread_waiting == 0) {
  62.     last;
  63.   }
  64.   print "WAITING FOR $thread_waiting THREADS\n";
  65.   sleep 1;
  66. }
  67.  
  68. sub thread {
  69.  
  70.   my $fn = "";
  71.   my $tc = "";
  72.  
  73.   my $prefix_char3 = "";
  74.   my $prefix_char2 = shift;
  75.   my $prefix_char1 = shift;
  76.   my $suffix_string = shift;
  77.  
  78.   my $prefix_string = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";
  79.   my @prefix_list = reverse split "", $prefix_string;
  80.  
  81.   foreach $prefix_char3 (@prefix_list) {
  82.     $fn = "$prefix_char1$prefix_char2$prefix_char3$suffix_string";
  83.     if (file_exists($fn)) {
  84.       $tc = file_good($fn);
  85.       if ($tc) {
  86.         print "CHECK $fn $tc\n";
  87.       }
  88.       undef $tc;
  89.     }
  90.   }
  91.   exit;
  92. }
  93.  
  94.  
  95. sub file_exists {
  96.   my $fn = shift;
  97.   my ($sh, $sb, $rc);
  98.   my $sh = IO::Socket::INET->new ("image.ibb.co:80");
  99.   print $sh "GET /$fn/..png HTTP/1.1\r\nHost: image.ibb.co\r\n\r\n";
  100.   $sh->recv ($sb, 12);
  101.   close $sh;
  102.   $rc = substr ($sb, 9, 3);
  103.   if ($rc == 200) {
  104.     return 1;
  105.   } else {
  106.     return 0;
  107.   }
  108. }
  109.  
  110. sub file_good {
  111.   my $fn = shift;
  112.   my ($sh, $sb, $pp, $tp, $dp, $tc, $iw, $ih);
  113.   $sh = IO::Socket::INET->new("image.ibb.co:80");
  114.   print $sh "GET /$fn/..png HTTP/1.1\r\nHost: image.ibb.co\r\n\r\n";
  115.   $sh->recv ($sb, 768);
  116.   close $sh;
  117.   $pp = index ($sb, "\x89\x50\x4E\x47");
  118.   $tp = index ($sb, "\x4C\x61\x73\x74");
  119.   $dp = index ($sb, "\x49\x48\x44\x52");
  120.   if ($pp && $tp && $dp) {
  121.     $tc = substr ($sb, $tp + 20, 20);
  122.     ($iw, $ih) = unpack ("NN", substr ($sb, $dp + 4, 8));
  123.     if ($iw == 720) {
  124.       return $tc;
  125.     } else {
  126.       return 0;
  127.     }
  128.   } else {
  129.     return 0;
  130.   }
  131. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement