Advertisement
Guest User

Untitled

a guest
Mar 11th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. #!/usr/pkg/bin/perl
  2. use IO::Pty;
  3. use POSIX 'setsid';
  4.  
  5. $| = 1;
  6.  
  7. my $username = "googlbot";
  8. my $password = "xxx";
  9. my $hostname = "tty.freeshell.org";
  10.  
  11. my $shell = do_cmd("telnet", $hostname);
  12.  
  13. waitfor("login:");
  14. print $shell $username, "\n";
  15. waitfor("Password:");
  16. print $shell $password, "\n";
  17. waitfor("key:");
  18. print $shell "\x08";
  19. waitfor("\[CONTINUE\]");
  20. print $shell "\n";
  21. waitfor("googlbot> ");
  22. print $shell "com\n";
  23.  
  24. print $shell "gbotlab\n";
  25.  
  26. while(1) {
  27. $_ = <$shell>;
  28. print $shell "v8===D\n" if /!penis/;
  29. print $shell "v( o Y o )\n" if /!tits/;
  30. print $shell "v( * Y * )\n" if /!boobs/;
  31. print $shell "v( o Y O )\n" if /!carbsgf/;
  32. print;
  33. }
  34.  
  35. sub waitfor {
  36. my $str = shift;
  37. do {
  38. sysread($shell, $_, 512, length($_));
  39. } until (/$str/);
  40. print;
  41. }
  42.  
  43. sub do_cmd {
  44. my ($cmd, @args) = @_;
  45. my $pty = IO::Pty->new;
  46. defined (my $child = fork)
  47. or die "fork: $!";
  48. return $pty if $child;
  49. setsid();
  50. my $tty = $pty->slave;
  51. close $pty;
  52. STDIN->fdopen($tty, "<")
  53. or die "STDIN: $!";
  54. STDOUT->fdopen($tty, ">")
  55. or die "STDOUT: $!";
  56. STDERR->fdopen($tty, ">")
  57. or die "STDERR: $!";
  58. close $tty;
  59. $| = 1;
  60. exec $cmd, @args;
  61. die "exec: $!";
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement