• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Perl [Perl] PasteBin Uploader

Status
Not open for further replies.

Doddy

Leech
User
Joined
Apr 1, 2012
Messages
169
Reputation
0
Reaction score
406
Points
63
Credits
0
‎13 Years of Service‎
57%
Bueno aca eh terminado un programa que los ayudara a publicar sus programas en pastebin de una forma rapida y sin ganas xDDD.

Entonces , este programa tiene dos opciones :

[+] Publica solo un archivo

[+] Publica todos los archivos en un directorio

Tambien detecta el tipo de extension para poder publicar el codigo en su respectivo tipo de codigo

Code:
>
#!usr/bin/perl
#Paste Bin Uploader (C) Doddy Hackman 2011

use LWP::UserAgent;
use HTTP::Request::Common;	

my $nave = LWP::UserAgent->new();
$nave->timeout(10);
$nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");

menu();

sub menu {

clean();
header();

print "\n\n[Options]\n\n";
print "[1] : Upload a file\n";
print "[2] : Upload a directory\n";
print "[3] : Exit\n\n";
print "[Option] : ";
chomp(my $op = );

if ($op eq 1) {
print "\n\n[File] : ";
chomp(my $file = );

if (-f $file)  {

($name,$exta) =verfile($file);

my $ext = extensiones($exta);

if ($ext ne "Yet") {


$code = openfile($file);

$re = lleva($name,$code,$ext);

print "\n\n[+] File : $file\n";
print "[+] Link : ".$re."\n";

savefile("uploads_paste.txt","\n[+] File : $file");
savefile("uploads_paste.txt","[+] Link : ".$re);

}


} else {
print "\n\n[-] Error\n\n";
}
reload();
}

elsif ($op eq 2) {

print "\n\n[Directory] : ";
chomp(my $dir = );

if (-d $dir) {

my @files = verdir($dir);

print "\n\n[+] Loading directory\n";

for my $file(@files) {

chomp $file;

my ($name,$exta) =verfile($file);

my $ext = extensiones($exta);

if ($ext ne "Yet") {

my $code = openfile($dir."/".$file);

$re = lleva($name,$code,$ext);

print "\n\n[+] File : $file\n";
print "[+] Link : ".$re."\n";

savefile("uploads_paste.txt","\n[+] File : $file");
savefile("uploads_paste.txt","[+] Link : ".$re);

}
}
} else {
print "\n\n[-] Error\n\n";
}

reload();
}

elsif ($op eq 3) {
copyright();
;
exit(1);
}

else {
menu();
}
}

sub copyright {
print "\n\n(C) Doddy Hackman 2011\n\n";
}

sub header {

print q(

PPPP     AA     SSSSTTTTTTEEEE    BBBB   II NN   NN     UU  UU  PPPP 
PP PP    AA    SS  S  TT  EE      BB BB  II NNN  NN     UU  UU  PP PP
PP PP   AAAA   SS     TT  EE      BB BB  II NNNN NN     UU  UU  PP PP
PPPP    A  A    SSS   TT  EEEE    BBBB   II NN N NN     UU  UU  PPPP 
PP     AAAAAA     SS  TT  EE      BB BB  II NN NNNN     UU  UU  PP   
PP     AA  AA  S  SS  TT  EE      BB BB  II NN  NNN     UUUUUU  PP   
PP     AA  AA  SSSS   TT  EEEE    BBBB   II NN   NN      UUUU   PP   


);

}

sub clean {
system("cls");
}



sub verdir{
my @archivos;
opendir DIR,$_[0];
my @archivos = readdir DIR;
for (@archivos) {
if (-f $_[0]."/".$_) {
push(@files,$_)
}
}
return @files;
}

sub verfile {
if ($_[0]=~/(.*)\.(.*)/ig) {
return ($1,$2);
}
}

sub extensiones {

if ($_[0] =~/py/ig) {
$code  = "python";
}
elsif ($_[0] =~/pl/ig) {
$code = "perl";
}
elsif ($_[0] =~/rb/ig) {
$code = "ruby";
}
elsif ($_[0] =~/php/ig) {
$code = "php";
}
elsif ($_[0] =~/txt/ig) {
$code = "";
}
else {
$code = "Yet";
}
return $code;
}

sub reload {
print "\n\n[?] Enter for continue\n\n";
;
menu();
}



sub savefile {
open (SAVE,">>logs/".$_[0]);
print SAVE $_[1]."\n";
close SAVE; 
}

sub openfile {

my $r;

open (FILE,$_[0]);
@wor = ;
close FILE;
for(@wor) {
$r.= $_;
}
return $r;
}

sub lleva {
return $nave->post('http://pastebin.com/api_public.php',{ paste_code => $_[1],paste_name=> $_[0],paste_format=>$_[2],paste_expire_date=>'N',paste_private=>"public",submit=>'submit'})->content;
} 

# ¿ The End ?
 
Status
Not open for further replies.
Back
Top