#!/usr/bin/perl use warnings; use strict; use WWW::Mechanize; my $input_filename = shift; if (!defined($input_filename) || $input_filename eq "") { print << "Terminator"; ============================= P A S T E B I N D U M P E R ============================= By Naxxtor USAGE: pastebin_dumper.pl filename.txt PURPOSE: This script will dump a text file to pastebin.ca and give you the ID back once it's done. It requires WWW::Mechanize. Terminator exit } open(FILE, "< $input_filename"); my @lines = ; my $content = join("\n",@lines); # print $content; my $agent = WWW::Mechanize->new(); $agent->get("http://pastebin.ca/"); $agent->form(2); $agent->field("content",$content); $agent->field("type","1"); $agent->click(); my $result = $agent->{content}; if ($result =~ /pastebin.ca\/(\d+?)"/ ) { print "Successfully submitted. \n Your URL is http://pastebin.ca/$1 \n"; } else { print "Result page didn't match\n"; }