#!usr/bin/perl
#PasteBin Uploader 0.5 (C) Doddy Hackman 2011
use Tk;
use Tk::FileSelect;
use Win32;
use LWP::UserAgent;
if ($^O eq 'MSWin32') {
use Win32::Console;
Win32::Console::Free();
}
my $nave = LWP::UserAgent->new;
$nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
$nave->timeout(5);
my $logo = MainWindow->new();
$logo->title("PasteBin Uploader 0.5");
$logo->geometry("300x130+20+20");
$logo->resizable(0,0);
$logo->Label(-text
=>"Options",-font
=>"Impact1")->place(-x
=>115,-You are not allowed to view links.
Register or
Login=>10); $logo->Button(-text
=>"File",-width
=>20,-command
=>\&single)->place(-You are not allowed to view links.
Register or
Login=>50,-x
=>10); $logo->Button(-text
=>"Directory",-width
=>20,-command
=>\&di)->place(-You are not allowed to view links.
Register or
Login=>50,-x
=>150); $logo->Button(-text
=>"Show Logs",-width
=>20,-command
=>\&lognow)->place(-x
=>75,-You are not allowed to view links.
Register or
Login=>88);
MainLoop;
sub single {
$sin = MainWindow->new();
$sin->title("Pastebin Uploader 0.5 (C) Doddy Hackman 2011");
$sin->geometry("550x80+20+20");
$sin->Label(-text
=>"File : ",-font
=>"Impact1")->place(-x
=>20,-You are not allowed to view links.
Register or
Login=>20); my $filex = $sin->Entry(-width
=>50)->place(-You are not allowed to view links.
Register or
Login=>25,-x
=>65); $sin->Button(-text
=>"Browse",-width
=>10,-command
=>\&bro)->place(-You are not allowed to view links.
Register or
Login=>23,-x
=>375); $sin->Button(-text
=>"Upload",-width
=>10,-command
=>\&singleup)->place(-You are not allowed to view links.
Register or
Login=>23,-x
=>450);
sub bro {
$sin->update;
$browse = $sin->FileSelect(-directory => "/");
my $file = $browse->Show;
$filex->configure (-text =>$file);
}
sub singleup {
my $file = $filex->get();
if (-f $file) {
($name,$exta) =verfile($file);
my $ext = extensiones($exta);
if ($ext ne "Yet") {
$code = openfile($file);
$re = lleva($name,$code,$ext);
unless($re=~/Bad API request/ig) {
Win32::MsgBox("Uploaded!!!",0,"PasteBin Uploader");
savefile("uploads_paste.txt","\n[+] File : $file");
savefile("uploads_paste.txt","[+] Link : ".$re);
} else {
Win32::MsgBox("Error uploading",0,"PasteBin Uploader 0.5");
}
}
} else {
Win32::MsgBox("File Error",0,"PasteBin Uploader 0.5");
}
}
}
sub di {
my $more = MainWindow->new();
$more->title("Pastebin Uploader 0.5 (C) Doddy Hackman 2011");
$more->geometry("450x280+50+50");
$more->resizable(0,0);
$more->Label(-text
=>"Directory : ",-font
=>"Impact1")->place(-You are not allowed to view links.
Register or
Login=>10,-x
=>10); my $filex = $more->Entry(-width
=>35)->place(-You are not allowed to view links.
Register or
Login=>15,-x
=>80); $more->Button(-text
=>"Start",-width
=>10,-command
=>\&multi)->place(-You are not allowed to view links.
Register or
Login=>12,-x
=>300); $more->Button(-text
=>"Browse",-width
=>10,-command
=>\&poner)->place(-x
=>370,-You are not allowed to view links.
Register or
Login=>12);
$more->Label(-text
=>"Files")->place(-You are not allowed to view links.
Register or
Login=>70,-x
=>65); my $lista_archivos = $more->Listbox(-width
=>32)->place(-You are not allowed to view links.
Register or
Login=>100,-x
=>20);
$more->Label(-text
=>"Status")->place(-You are not allowed to view links.
Register or
Login=>70,-x
=>300); my $lista_re = $more->Listbox(-width
=>32)->place(-You are not allowed to view links.
Register or
Login=>100,-x
=>230);
sub poner {
my $ven = MainWindow->new();
$ven->title("Choose Directory");
$ven->geometry("300x280+20+20");
$ven->resizable(0,0);
$test = $ven->Scrolled("DirTree",-width
=>100,-height
=>20,-exportselection
=>1,-command
=>\&choose)->You are not allowed to view links.
Register or
Login();
sub choose {
$filex->configure(-text=>$_[0]);
$ven->destroy;
}
}
sub multi {
my $dir = $filex->get();
if (-d $dir) {
my @files = verdir($dir);
for my $file(@files) {
my ($name,$exta) =verfile($file);
my $ext = extensiones($exta);
if ($ext ne "Yet") {
my $code = openfile($dir."/".$file);
$lista_archivos->insert("end",$file);
$logo->update;
$re = lleva($name,$code,$ext);
unless($re=~/Bad API request/ig) {
$lista_re->insert("end","File Uploaded !!");
savefile("uploads_paste.txt","\n[+] File : $file");
savefile("uploads_paste.txt","[+] Link : ".$re);
} else {
$lista_re->insert("end","Error uploading");
}
}
}
} else {
Win32::MsgBox("Directory Error",0,"PasteBin Uploader 0.5");
}
}
}
sub lognow {
if (-f "logs/uploads_paste.txt") {
You are not allowed to view links.
Register or
Login("start logs/uploads_paste.txt");}
}
sub toma {
You are not allowed to view links.
Register or
Login $nave->get($_[0])->content;}
sub savefile {
You are not allowed to view links.
Register or
Login (SAVE
,">>logs/".$_[0]);You are not allowed to view links.
Register or
Login SAVE
$_[1]."\n";}
sub tomar {
my ($web,$var) = @_;
You are not allowed to view links.
Register or
Login $nave->post($web,[%{$var}])->content;}
sub verdir{
my @files;
my @archivos;
my @archivos = You are not allowed to view links.
Register or
Login DIR
; for (@archivos) {
if (-f $_[0]."/".$_) {
}
}
}
sub verfile {
if ($_[0]=~/(.*)\.(.*)/ig) {
}
}
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";
}
}
sub openfile {
my $r;
You are not allowed to view links.
Register or
Login (FILE
,$_[0]);@wor = <FILE>;
for(@wor) {
$r.= $_;
}
}
sub lleva {
You are not allowed to view links.
Register or
Login $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 ?