elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
29 Mayo 2012, 05:18  


Tema destacado: Únete al Grupo Steam elhacker.NET

+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting (Moderadores: Novlucker, Leo Gutiérrez., EleKtro H@cker)
| | |-+  [Ruby] PasteBin Uploader
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Ruby] PasteBin Uploader  (Leído 200 veces)
Doddy

Desconectado Desconectado

Mensajes: 220



Ver Perfil
[Ruby] PasteBin Uploader
« en: 16 Octubre 2011, 02:50 »

Un simple programa para subir codigos a pastebin

Código
#!usr/bin/ruby
#PasteBin Uploader  (C) Doddy Hackman 2011
 
require "net/http"
 
def head()
print "\n\n-- == PasteBin Uploader\n\n\n"
end
 
def copyright()
print "\n\n(C) Doddy Hackman 2011\n\n"
exit(1)
end
 
def uso()
print "\n[+] up.rb <file> <titulo> <tipo>\n"
end
 
def tomar(web,par)
  return Net::HTTP.post_form(URI.parse(web),par).body
  end
 
def subir(file,titulo,tipo)
 
begin
archivo = File.open(file)
lineas = archivo.readlines
rescue
print "\n[-] Error open file\n"
end
 
print "[+] Uploading file\n\n"
 
code = tomar("http://pastebin.com/api_public.php",{"paste_code" =>lineas,"paste_name"=>titulo,"paste_format"=>tipo,"paste_expire_date"=>"N","paste_private"=>"public","submit"=>"submit"})
 
if code=~/Bad API request/
print "[-] Error uploading\n"
else
print "[+] Enjoy : "+code+"\n"
 
end
end
 
file = ARGV[0]
titulo = ARGV[1]
tipo = ARGV[2]
 
head()
if !file and !titulo and !tipo
uso()
else
subir(file,titulo,tipo)
end
copyright()
 
# ¿ The End ?
 


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Ruby y Ruby on Rails
Programación General
Nanocity 2 675 Último mensaje 31 Octubre 2007, 21:32
por alone-in-the-chat
[Introducing Ruby] Lo que debes saber sobre Ruby
Scripting
RyogiShiki 0 1,946 Último mensaje 4 Marzo 2011, 20:45
por RyogiShiki
[Perl] PasteBin Uploader
Scripting
Doddy 0 251 Último mensaje 8 Octubre 2011, 16:55
por Doddy
[Python] PasteBin Uploader
Scripting
Doddy 1 797 Último mensaje 9 Febrero 2012, 15:03
por EleKtro H@cker
[APORTE] [RUBY] Shack (Imageshack Uploader)
Scripting
EleKtro H@cker 0 102 Último mensaje 19 Marzo 2012, 15:18
por EleKtro H@cker
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines