Advertising
Paste Description for nettezzaumana
> cat `which _pastebin.pl ` | _pastebin.pl -t perl -n nettezzaumana
- nettezzaumana
- Sunday, November 7th, 2010 at 12:52:15pm UTC
- #!/usr/bin/perl
- ## Script for posting command's output directly from command line.
- ## i wrote this script to be able use it on solaris operating system without
- ## installing any exotic or not core perl modules (.pm)
- ##
- ## script has just one dependency: wget knowing option --post-file= ..
- ##
- ## This script is written in "compat" way, so as mentioned above, no additional .pms
- ## are used, so this script should work almost everywhere with perl.
- ##
- ## author: dpecka[at]opensuse[dot]org
- ## enjoy !!
- ## This Software is released under: 3-clause license ("New BSD License")
- ##
- ## Copyright (c) 2010, Daniel Pecka
- ## All rights reserved.
- ##
- ## Redistribution and use in source and binary forms, with or without
- ## modification, are permitted provided that the following conditions are met:
- ## * Redistributions of source code must retain the above copyright
- ## notice, this list of conditions and the following disclaimer.
- ## * Redistributions in binary form must reproduce the above copyright
- ## notice, this list of conditions and the following disclaimer in the
- ## documentation and/or other materials provided with the distribution.
- ## * Neither the name of the organization nor the
- ## names of its contributors may be used to endorse or promote products
- ## derived from this software without specific prior written permission.
- ##
- ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- ## WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- ## DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- ## DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- ## (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- ## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- ## SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- ##
- use strict;
- use warnings;
- sub usage {
- Usage: foo | pastebin.sh [-f] [-t type] [-d description] [-e expiration] [-n name]
- -f exploit pastebin.ca even if input have less then 5 lines
- -t expects one from types listed below
- -d short paste description
- -n alternate nick, default is your $USER enviroment variable
- -h this help message thrown to /dev/stderr
- escape white characters in name and description string ..
- Types: action ada apache asm asp asterisk bash c c# c++ css delphi diff
- html java javascript lisp lua mirc nasm net objc pascal patch perl
- php pli python raw ruby scheme sql vbs xml
- Expire: 5m 10m 15m 30m 45m 1h 2h 4h 8h 12h
- 1d 2d 3d 1w 2w 3w 1mn 2mn 3mn 4mn 5mn 6mn 1y
- EOF
- exit 2;
- };
- ## several checks .. we need to know if we have sufficient wget
- my $wpath;
- sub checks {
- };
- ## parses cli and assigns a base vars
- my($pforc, $ptype, $pdesc, $pexpi, $puser);
- $pforc = "false";
- $ptype = 33;
- $pdesc = "";
- $pexpi = "";
- $puser = $ENV{"USER"};
- sub parse_cli {
- while(@ARGV) {
- if(/^-f$/) { $pforc="true"; next; };
- if(/^-t$/) {
- my %types = ( raw => "1",
- asterisk => "2",
- c => "3",
- "c++" => "4",
- php => "5",
- perl => "6",
- java => "7",
- vbs => "8",
- "c#" => "9",
- ruby => "10",
- python => "11",
- pascal => "12",
- mirc => "13",
- pli => "14",
- xml => "15",
- sql => "16",
- scheme => "17",
- action => "18",
- ada => "19",
- apache => "20",
- nasm => "21",
- asp => "22",
- bash => "23",
- css => "24",
- delphi => "25",
- html => "26",
- javascript => "27",
- lisp => "28",
- lua => "29",
- asm => "30",
- objc => "31",
- net => "32",
- diff => "33",
- patch => "33",
- );
- };
- $ptype = $types{"$ptype"};
- next;
- };
- if(/^-d$/) {
- $pdesc =~ s/\+/%2B/g;
- next;
- };
- if(/^-e$/) {
- my %expires = ( m5 => "5 minutes",
- m01 => "10 minutes",
- m51 => "15 minutes",
- m03 => "30 minutes",
- m54 => "45 minutes",
- h1 => "1 hour",
- h2 => "2 hours",
- h4 => "4 hours",
- h8 => "8 hours",
- h21 => "12 hours",
- d1 => "1 day",
- d2 => "2 days",
- d3 => "3 days",
- w1 => "1 week",
- w2 => "2 weeks",
- w3 => "3 weeks",
- nm1 => "1 month",
- nm2 => "2 months",
- nm3 => "3 months",
- nm4 => "4 months",
- nm5 => "5 months",
- nm6 => "6 months",
- y1 => "1 year",
- );
- die "choose one from: 5m 10m 15m 30m 45m 1h 2h 4h 8h 12h 1d 2d 3d 1w 2w 3w 1mn 2mn 3mn 4mn 5mn 6mn 1y\n";
- };
- $pexpi = $expires{"$pexpi_tmp"};
- next;
- };
- usage() if(/^(-h|--help)$/);
- usage();
- };
- };
- ## build and upload tmp file ..
- sub build_upload_file {
- my $pfile;
- my $plines = 0;
- while(<>) {
- s/%/%25/g;
- s/&/%26/g;
- s/\+/%2B/g;
- $plines += 1;
- };
- die "input is shorter then 5 lines, use -f option to force exploit pastebin.ca\n" if(($plines < 5) && "$pforc" !~ /^true$/);
- };
- my $pastebinkey = "4g64jruLaAtRJt8XvjDn1Qt3jsQTgCmx";
- sub upload_file {
- chomp(my @wget_output = `$wpath -O - --tries=5 --timeout=60 --post-file=/tmp/pastebin.pl.tmp http://pastebin.ca/quiet-paste.php?api=$pastebinkey 2>&1`);
- foreach(@wget_output) {
- next if ! /SUCCESS:/;
- return 0;
- };
- die "can't post at pastebin.ca:\n@wget_output\n";
- };
- ### Body from here:
- checks();
- parse_cli();
- build_upload_file();
- upload_file();
- unlink "/tmp/pastebin.pl.tmp";
- #print << "EOF";
- #pforce: $pforc
- #ptype: $ptype
- #pdesc: $pdesc
- #pexpi: $pexpi
- #puser: $puser
- #EOF
- exit 0;
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.