Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: BigBear en 16 Octubre 2011, 02:52 am



Título: [Python] PasteBin Uploader
Publicado por: BigBear en 16 Octubre 2011, 02:52 am
Un simple programa para subir codigos a pastebin

Código
  1. #!usr/bin/python
  2. #PasteBin Uploader (C) Doddy Hackman 2011
  3.  
  4. import urllib2,sys,re
  5.  
  6. nave = urllib2.build_opener()
  7. nave.add_header = [('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5')]
  8.  
  9. def tomar(web,vars) :
  10. return nave.open(web,vars).read()
  11.  
  12. def head():
  13. print "\n-- == PasteBin Uploader == --\n\n"
  14.  
  15. def copyright():
  16. print "\n(C) Doddy Hackman 2011\n"
  17. sys.exit(1)
  18.  
  19. def sintax():
  20. print "[+] paste.py <file> <title> <perl/python/ruby/php>\n"
  21.  
  22. def chubir(file,title,type):
  23. print "[+] Uploading file\n"
  24. try:
  25.  lineas = open(file,"r").readlines()
  26. except:
  27.  print "[-] Error open file\n"
  28.  copyright()
  29. lin = "".join(lineas)
  30. try:
  31.  code = tomar("http://pastebin.com/api_public.php","paste_code="+str(lin)+"&paste_name="+title+"&paste_format="+type+"&paste_expire_date=N&paste_private=public&submit=submit")
  32. except:
  33.  print "[-] Page offline\n"
  34. if re.findall("Bad API request",code):
  35.  print "[-] Error uploading file\n"
  36. else:
  37.  print "[+] Enjoy : ",code+"\n"
  38.  copyright()
  39.  
  40. head()
  41. if len(sys.argv) != 4 :
  42. sintax()
  43. else :
  44. chubir(sys.argv[1],sys.argv[2],sys.argv[3])
  45. copyright()
  46.  
  47. # The End


Título: Re: [Python] PasteBin Uploader
Publicado por: Eleкtro en 9 Febrero 2012, 15:03 pm
Tus scripts uploaders me encantan, entre otros xD

Código:
paste.py test.txt titulo DOS

muy bueno!