elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Security Series.XSS. [Cross Site Scripting]


  Mostrar Mensajes
Páginas: 1 ... 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 [1023] 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 ... 1235
10221  Media / Multimedia / Necesito los nombres.exe de Reproductores multimedia conocidos en: 15 Noviembre 2012, 22:06 pm
Hola,

Busco el nombre de los ejecutables de reproductores de audio, es para una mini aplicación que estoy haciendo en VS.

De momento solo tengo estos:

mpc.exe
mpc-hc.exe
mpc-hc64.exe
vlc.exe
winamp.exe
wmp.exe


una ayudita?  :P
10222  Programación / Scripting / Re: [RUBY] SoundCloud Leecher v0.2 (Manten al día tu colección de música!) en: 15 Noviembre 2012, 19:39 pm
Nueva versión 0.3 !!

El script ya no es tán preconfigurado, es más personalizable y todo se lee desde el registro de Windows.

Un nuevo menú con varias opciones:

  • Añadir un grupo
  • Eliminar un grupo
  • Listar los grupos
  • Establecer la ruta del log
  • Establecer la ruta del archivo leecher
  • Eliminar el archivo log
  • Eliminar el el archivo leecher
  • Establecer el máximo número de páginas a parsear
  • Crear un backup de las opciones

PD: He añadido un executable en el comentario principal.

Un saludo!

Saludos
10223  Programación / Scripting / Re: [RUBY] SoundCloud Leecher v0.2 (Manten al día tu colección de música!) en: 15 Noviembre 2012, 15:12 pm
Nueva versión.

Un saludo!
10224  Programación / Scripting / [RUBY] SoundCloud Leecher v0.5 (Manten al día tu colección de música!) en: 15 Noviembre 2012, 13:29 pm
SoundCloud Leecher v0.5
By Elektro H@cker





















SoundCloud Leecher es una herramienta que te ayudará a mantener al día tu colección de música.

Esta utilidad está pensada para un uso (casi) diario o semanal.

El script obtiene todos los enlaces descargables de las primeras "X" páginas de "X" grupo de Soundcloud, y guarda esos enlaces en un archivo de texto para usarlos más tarde con un gestor de descargas como por ejemplo "JDownloader".

Además, todos los enlaces se listan también en un archivo log para que queden excluidos en el próximo uso del script, esa es la razón de porqué está pensado para el uso diario.

Es muy fácil de configurar.

Espero que a alguien más que a mi le sirva de ayuda. ::)

Un saludo!





Executable: http://exoshare.com/download.php?uid=OFGDPH4C


Soundcloud Leecher.rb:
Código
  1. # -*- coding: UTF-8 -*-
  2.  
  3.  
  4. # SoundCloud Leecher v0.5
  5. #
  6. # By Elektro H@cker
  7.  
  8.  
  9. # Description:
  10. # -----------
  11. #
  12. # SoundCloud Leecher it's a tool that helps you to keep updated your music collection.
  13. #
  14. # This tool is intended for (almost) daily use.
  15. #
  16. # The script retreives all the downloadable links of the first "X" pages from a "X" group of SoundCloud,
  17. # And then list the links into a text file for use it with a download magaer like "JDownloader".
  18. #
  19. # All the links are stored permanently into a log file to be excluded at the next use,
  20. # that's the reason why this tool is intended for daily use.
  21.  
  22.  
  23. # Info:
  24. # ----
  25. #
  26. # SoundCloud unfortunately do not have a date search mode,
  27. # which would be much easier to search/sort by "music style + today's date" than "groups + first sorted pages",
  28. # The site has an advanced search engine that can search by "release date" but that is not the same than "uploaded date",
  29. # So i think the only way to sort by date is by entering a group page because it shows the content sorted by the last date.
  30.  
  31.  
  32. # How to use:
  33. # ----------
  34. #
  35. # Configure your favorite groups and the other settings by entering into the configuration menu.
  36.  
  37.  
  38. require 'net/http'
  39. require 'win32/registry'
  40. require "highline/system_extensions"
  41. include HighLine::SystemExtensions
  42.  
  43.  
  44. exit if Object.const_defined?(:Ocra)
  45.  
  46.  
  47. def logo()
  48. puts "
  49.  _,  _, ,  , ,  , ,_   _ ,    _, ,  , ,_      ,    _, _, _ , ,  _,,_  
  50. (_  / \\ |  | |\\ | | \\ /  |   / \\ |  | | \\     |   /_,/_,/  |_| /_,|_)  
  51.  _) \\_/ \\__| | \\| |_/ \\_ |__ \\_/ \\__| |_/     |__ \\_ \\_ \\_ | | \\_ | \\  
  52. '          `    `       `           `           '   `  `  `' `   `'  
  53.                                                                  v0.5
  54. By Elektro H@cker"
  55. end
  56.  
  57.  
  58. def main()
  59. puts "\n\n[+] Press \"C\" to config or press any other key to start leeching..."
  60. key = get_character
  61. config("") if key.to_s =~ /^67$|^99$/
  62. get_downloads_list()
  63. puts "\n\n\n[+] All links are stored in: #{$leecherfile}"
  64. end
  65.  
  66.  
  67. def get_settings()
  68. begin
  69. $logfile = regread("LOGFILEPATH")
  70. rescue
  71. $logfile = "#{ENV['WINDIR']}\\Soundcloud LOG.txt"
  72. end
  73.  
  74. begin
  75. $leecherfile = regread("LEECHERFILEPATH") +  "Soundcloud Leecher #{Time.new.strftime("%Y-%m-%d")}.txt"
  76. rescue
  77. $leecherfile = "#{ENV['USERPROFILE']}\\Desktop\\Soundcloud Leecher #{Time.new.strftime("%Y-%m-%d")}.txt"
  78. end
  79.  
  80. begin
  81. $groups = regread("GROUPS")
  82. rescue
  83. $groups = ""
  84. end
  85.  
  86. begin
  87. $max_pages = regread("MAXPAGES")
  88. $max_pages = $max_pages.to_i
  89. rescue
  90. $max_pages = 5
  91. end
  92.  
  93. begin
  94. $min_duration = regread("MINDURATION")+"00"
  95. $min_duration = $min_duration.to_i
  96. rescue
  97. $min_duration = 130
  98. end
  99.  
  100. begin
  101. $max_duration = regread("MAXDURATION")+"00"
  102. $max_duration = $max_duration.to_i
  103. rescue
  104. $max_duration = 1200
  105. end
  106.  
  107. begin
  108. $max_size = regread("MAXSIZE")+"00"
  109. $max_size = $max_size.to_i
  110. rescue
  111. $max_size = 10000
  112. end
  113.  
  114. begin
  115. $excluded_exts = regread("EXCLUDED EXTENSIONS")
  116. rescue
  117. $excluded_exts = ""
  118. end
  119.  
  120. begin
  121. $excluded_tags = regread("EXCLUDED TAGNAMES")
  122. rescue
  123. $excluded_tags = ""
  124. end
  125.  
  126. begin
  127. $verbose = regread("VERBOSEMODE")
  128. rescue
  129. $verbose = "no"
  130. end
  131.  
  132. end
  133.  
  134.  
  135. def config(errorcode)
  136.  
  137. puts "
  138. º---------------------------------º---------------------------------º
  139. | [1] Set the log file path       | [+] Max. track duration         |
  140. | [2] Set the leecher file path   | [-] Min. track duration         |
  141. | [3] Delete the log file         | [M] Max. track filesize         |
  142. |---------------------------------|---------------------------------|
  143. | [A] Add a group name            | [P] Pages per group to parse    |
  144. | [D] Delete a group name         | [F] Filetypes to exclude        |
  145. | [L] List the group names        | [T] Tagnames to exclude         |
  146. |---------------------------------|---------------------------------|
  147. | [V] Verbose mode (ON/OFF)       | [S] Show the current settings   |
  148. |---------------------------------| [R] Reset the settings          |
  149. | [E] Exit                        | [Z] Backup all the config.      |
  150. º---------------------------------º---------------------------------º
  151.  
  152. "
  153. get_settings()
  154. puts errorcode
  155.  
  156. keystr = "NOTHING"
  157. until keystr =~ /^43$|^45$|^49$|^50$|^51$|^65$|^68$|^69$|^70$|^76$|^77$|^80$|^82$|^83$|^84$|^86$|^90$|^97$|^100$|^101$|^102$|^108$|^109$|^112$|^114$|^115$|^116$|^118$|^121$|^122$/
  158. print "\nChoose an option >> "
  159. key = get_character
  160. keystr = key.to_s
  161. end
  162.  
  163. # Log file path
  164. if key == 49
  165. logfilepath = "NOTHING"
  166. until File.directory?(logfilepath)
  167. print "\n\nEnter the path to an existing directory for the logfile: "
  168. logfilepath = STDIN.gets.chomp
  169. end
  170. if logfilepath[-1] == '\\' then logfilepath = logfilepath[0..-2] end
  171. regwrite("LOGFILEPATH", logfilepath + "\\Soundcloud LOG.txt")
  172. config("[+] Operation completed.")
  173. end
  174.  
  175. # Leecher file path
  176. if key == 50
  177. leecherfile = "NOTHING"
  178. until File.directory?(leecherfile)
  179. print "\n\Enter the path to an existing directory for the leecher file: "
  180. leecherfile = STDIN.gets.chomp
  181. end
  182. if not leecherfile[-1] == '\\' then leecherfile = leecherfile+"\\" end
  183. regwrite("LEECHERFILEPATH", leecherfile)
  184. config("[+] Operation completed.")
  185. end
  186.  
  187. # delete log file
  188. if key == 51
  189. filedel = "NOTHING"
  190. while not filedel =~ /^78$|^89$|^110$|^121$/
  191. print "\n\nWant to delete the log file, Are you sure? [Y/N]: "
  192. filedel = get_character.to_s
  193. end
  194. begin
  195. if filedel =~ /^89$|^121$/ then File.delete($logfile) end
  196. config("[+] Operation completed.")
  197. rescue
  198. config("\n\nERROR\n\nCan't find the logfile.")
  199. end
  200. end
  201.  
  202. # Add groupname
  203. if key == 65 or key == 97
  204. addname = "NOTHING"
  205. until not addname == "NOTHING"
  206. print "\n\nEnter a group name to add\nor enter the word \"none\" to reset the group list: "
  207. addname = STDIN.gets.chomp
  208. end
  209. begin
  210. groups=regread("GROUPS")
  211. rescue
  212. groups=""
  213. end
  214.  
  215. for addgroupname in regread("GROUPS").split(";").sort do
  216. if not addgroupname =~ /^#{Regexp.escape(addname)}$/i then addfinalgroups="#{addfinalgroups};#{addgroupname}" else found = "yes" end
  217. end
  218. if found == "yes" then config("\n\n[+] ERROR\n\nThe groupname already exists.") end
  219. if addname =~ /^none$/i then regwrite("GROUPS", "") else regwrite("GROUPS", "#{groups};#{addname}") end
  220. config("[+] Operation completed.")
  221. end
  222.  
  223. # delete groupname
  224. if key == 68 or key == 100
  225. delnum = "NOTHING"
  226. num=0
  227. for listname in $groups.split(";").each.sort do
  228. num=num+1
  229. puts " [#{num}] #{listname}"
  230. instance_variable_set "@_#{num}", listname
  231. end
  232. until not delnum == "NOTHING"
  233. print "\n\nEnter a reference number to delete the group\nor enter the word \"none\" to reset the group list: "
  234. delnum = STDIN.gets.chomp
  235. end
  236. choose = instance_variable_get "@_#{delnum}"
  237. begin
  238. groups=regread("GROUPS")
  239. rescue
  240. groups=""
  241. end
  242. begin
  243. for delgroupname in regread("GROUPS").split(";").sort do
  244. if not delgroupname =~ /^#{Regexp.escape(choose)}$/i then delfinalgroups="#{delfinalgroups};#{delgroupname}" end
  245. end
  246. rescue
  247. config("\n\n[+] ERROR\n\nCan't find the delgroupname.")
  248. end
  249. regwrite("GROUPS", delfinalgroups[1..-1])
  250. config("[+] Operation completed.")
  251. end
  252.  
  253. # list groupnames
  254. if key == 76 or key == 108
  255. num = 0
  256. puts "\n\n[+] All your groups:\n\n"
  257. for listname in $groups.split(";").each.sort do
  258. num=num+1
  259. puts " [#{num}] #{listname}"
  260. end
  261. puts "\n\n[+] Press any other key to continue..."
  262. get_character
  263.    config("[+] Operation completed.")
  264. end
  265.  
  266. # Max pages
  267. if key == 80 or key == 112
  268. maxpages = "NOTHING"
  269. puts "\n\nThis option lets you configure the maximum pages when leeching a group..."
  270. until not maxpages[/[a-z]/i]
  271. print "\nEnter a number for the max pages value: "
  272. maxpages = STDIN.gets.chomp
  273. end
  274. regwrite("MAXPAGES", maxpages)
  275. config("[+] Operation completed.")
  276. end
  277.  
  278. # Min track duration
  279. if key == 45
  280. puts "\n\nThis option lets you configure the minimum accepted minutes duration when leeching tracks..."
  281. minlenght = "NOTHING"
  282. until minlenght[/^[0-9]+$/]
  283. print "\nEnter a number to set the min. minutes for a track (Example: \"1\"): "
  284. minlenght = STDIN.gets.chomp
  285. end
  286. regwrite("MINDURATION", minlenght)
  287. config("[+] Operation completed.")
  288. end
  289.  
  290. # Max track duration
  291. if key == 43
  292. puts "\n\nThis option lets you configure the maximum accepted minutes duration when leeching tracks..."
  293. maxlenght = "NOTHING"
  294. until maxlenght[/^[0-9]+$/]
  295. print "\nEnter a number to set the max. minutes for a track (Example: \"15\"): "
  296. maxlenght = STDIN.gets.chomp
  297. end
  298. regwrite("MAXDURATION", maxlenght)
  299. config("[+] Operation completed.")
  300. end
  301.  
  302. # Max track filesize
  303. if key == 77 or key == 109
  304. puts "\n\nThis option lets you configure the maximum accepted filesize when leeching tracks..."
  305. maxsize = "NOTHING"
  306. until maxsize[/^[0-9]+$/]
  307. print "\nEnter a number to set the max. MB for a track (Example: \"20\"): "
  308. maxsize = STDIN.gets.chomp
  309. end
  310. regwrite("MAXSIZE", maxsize)
  311. config("[+] Operation completed.")
  312. end
  313.  
  314. # exclude filetypes
  315. if key == 102 or key == 70
  316. addext = "NOTHING"
  317. puts "\n\nThis option lets you exclude tracks by their file extension..."
  318. until not addext == "NOTHING"
  319.  
  320. print "\n\nEnter a file extension (Example: \"wav\") \nor enter the word \"none\" to reset the exclusions: "
  321. addext = STDIN.gets.chomp
  322. end
  323. begin
  324. exts=regread("EXCLUDED EXTENSIONS")
  325. rescue
  326. exts=""
  327. end
  328. if addext =~ /^none$/i then regwrite("EXCLUDED EXTENSIONS", "") else regwrite("EXCLUDED EXTENSIONS", "#{exts};#{addext.gsub(".","")}") end
  329. config("[+] Operation completed.")
  330. end
  331.  
  332. # exclude tagnames
  333. if key == 84 or key == 116
  334. addtag = "NOTHING"
  335. puts "\n\nThis option lets you exclude tracks by a tagname..."
  336. until not addtag == "NOTHING"
  337. print "\n(The tagnames are not case sensitive)\n\nEnter a tagname (Example: \"session\") \nor enter the word \"none\" to reset the exclusions: "
  338. addtag = STDIN.gets.chomp
  339. end
  340. begin
  341. tags=regread("EXCLUDED TAGNAMES")
  342. rescue
  343. tags=""
  344. end
  345. if addtag =~ /^none$/i then regwrite("EXCLUDED TAGNAMES", "") else regwrite("EXCLUDED TAGNAMES", "#{tags};#{addtag}") end
  346. config("[+] Operation completed.")
  347. end
  348.  
  349. # verbose mode
  350. if key == 118 or key == 86
  351. verbkey = "NOTHING"
  352. puts "\n\nThe verbose mode lets you can see more info when leeching the group pages..."
  353. while not verbkey =~ /^78$|^89$|^110$|^121$/
  354. print "\n\nWant to use the verbose mode? [Y/N]: "
  355. verbkey = get_character.to_s
  356. end
  357. if verbkey =~ /^89$|^121$/ then regwrite("VERBOSEMODE", "yes") else regwrite("VERBOSEMODE", "no") end
  358. config("[+] Operation completed.")
  359. end
  360.  
  361.  
  362. # show the current settings
  363. if key == 83 or key == 115
  364. config("
  365.  
  366. Log file path       : #{$logfile}
  367.  
  368. Leecher file path   : #{$leecherfile}
  369.  
  370. Max. pages per group: #{$max_pages} pages
  371.  
  372. Min. track duration : #{$min_duration.to_s[0..-3]} min
  373.  
  374. Max. track duration : #{$max_duration.to_s[0..-3]} min
  375.  
  376. Max. track filesize : #{$max_size.to_s[0..-3]} mb
  377.  
  378. Verbose mode        : #{$verbose}
  379.  
  380. Excluded extensions : #{$excluded_exts.gsub(";","|")}
  381.  
  382. Excluded tagnames   : #{$excluded_tags.gsub(";","|")}
  383.  
  384. ")
  385. end
  386.  
  387. # reset the settings
  388. if key == 114 or key == 82
  389. resetkey = "NOTHING"
  390. while not resetkey =~ /^78$|^89$|^110$|^121$/
  391. print "\n(This not affect to group list)\n\nWant to reset all the settings, Are you sure? [Y/N]: "
  392. resetkey = get_character.to_s
  393. end
  394. if resetkey =~ /^89$|^121$/
  395. Win32::Registry::HKEY_CURRENT_USER.open("SOFTWARE\\Soundcloud Leecher\\", Win32::Registry::KEY_ALL_ACCESS) do |reg|
  396. reg['LOGFILEPATH'] = 'DELETE'
  397. reg.delete_value("LOGFILEPATH")
  398. reg['LEECHERFILEPATH'] = 'DELETE'
  399. reg.delete_value("LEECHERFILEPATH")
  400. reg['MAXPAGES'] = 'DELETE'
  401. reg.delete_value("MAXPAGES")
  402. reg['MINDURATION'] = 'DELETE'
  403. reg.delete_value("MINDURATION")
  404. reg['MAXDURATION'] = 'DELETE'
  405. reg.delete_value("MAXDURATION")
  406. reg['MAXSIZE'] = 'DELETE'
  407. reg.delete_value("MAXSIZE")
  408. reg['VERBOSEMODE'] = 'DELETE'
  409. reg.delete_value("VERBOSEMODE")
  410. reg['EXCLUDED EXTENSIONS'] = 'DELETE'
  411. reg.delete_value("EXCLUDED EXTENSIONS")
  412. reg['EXCLUDED TAGNAMES'] = 'DELETE'
  413. reg.delete_value("EXCLUDED TAGNAMES")
  414. end
  415. config("[+] Operation completed.")
  416. end
  417. end
  418.  
  419. # backup the settings
  420. if key == 90 or key == 122
  421. system %[ regedit /e \"%USERPROFILE%\\Desktop\\Soundcloud settings %DATE:/=-%.reg\" \"HKEY_CURRENT_USER\\Software\\Soundcloud Leecher\" ]
  422. config("\n\n[+] Settings stored in #{ENV['USERPROFILE']}\\Desktop\\SoundCloud settings.reg")
  423. end
  424.  
  425. # exit
  426. if key == 69 or key == 101 then main() end
  427.  
  428. end
  429.  
  430.  
  431. def regread(keyname)
  432. Win32::Registry::HKEY_CURRENT_USER.open("SOFTWARE\\Soundcloud Leecher\\") do |reg| reg[keyname] end
  433. end
  434.  
  435.  
  436. def regwrite(keyname, value)
  437. Win32::Registry::HKEY_CURRENT_USER.create("SOFTWARE\\Soundcloud Leecher\\") do |reg| reg[keyname, Win32::Registry::REG_SZ] = value end
  438. end
  439.  
  440.  
  441. def filewrite()
  442. if not File.exist?($logfile) then File.open($logfile, "w") do |write| write.puts "SoundCloud leeched URLs\n" end end
  443. if not File.open($logfile, "r").read[@track_url.split("/download").first.split("http://soundcloud.com/").last.gsub("-","").gsub("/","")]
  444. if $verbose == "yes" then puts @info end
  445. File.open($logfile,     "a+") do |write| write.puts @track_url.split("/download").first.split("http://soundcloud.com/").last.gsub("-","").gsub("/","") end
  446. File.open($leecherfile, "a+") do |write| write.puts "Added at #{Time.new.strftime("%H:%M")}: #{@track_url}" end
  447. end
  448. end
  449.  
  450.  
  451. def get_downloads_list()
  452.  
  453. if $verbose == "no"
  454. for name in $groups.split(";").each.sort do
  455. @group = name.chomp
  456. @page  = 0
  457. print "\n\n[+] Group: #{@group}\n[+] Leeching pages "
  458. for i in 1..$max_pages do
  459. @page = @page+1
  460. @url  = "http://soundcloud.com/groups/#{@group}/tracks?page=#{@page}"
  461. print "#{@page}/#{$max_pages}..."
  462. Net::HTTP.get_response(URI.parse(@url)).body.each_line do |line|
  463. if (line['class="info-header"'])
  464. @filename = line.split('</a').first.split('>').last.gsub(/ Artwork$/,'').gsub('&quot;','"').gsub('&amp;','&')
  465. for excluded_tag in $excluded_tags.split(";").each do
  466. if not excluded_tag == "" and @filename[/#{Regexp.escape(excluded_tag)}/i] then @downloadable = "no" end
  467. end
  468. end
  469. if (line['button download']) then @downloadable = "yes" end
  470. if (line['button download']) then @track_url    = "http://soundcloud.com#{line.split('href="').last.split('"').first}\n" end
  471. if (line['This track is not downloadable']) then @downloadable = "no" end
  472. if (line['class="file-type"'])
  473. @ext = line.split('</').first.split('>').last
  474. for excluded_ext in $excluded_exts.split(";").each do
  475. if not excluded_ext == "" and @ext =~ /^#{Regexp.escape(excluded_ext)}$/i then @downloadable = "no" end
  476. end
  477. end
  478. if (line['class="content-size"'])
  479. @size         = line.split('</').first.split('>').last
  480. if @size.gsub(".","").to_i > $max_size then @downloadable = "no" end
  481. end
  482. if (line['class="duration"']) then @duration = line.split('</').first.split('>').last.gsub(".","").to_i end
  483. if (line['class="duration"']) and @downloadable == "yes" and @duration > $min_duration and @duration < $max_duration
  484. filewrite()
  485. end
  486. end
  487. end
  488. end
  489. end
  490.  
  491. if $verbose == "yes"
  492. for name in $groups.split(";").each.sort do
  493. @group = name.chomp
  494. @page  = 0
  495. print "\n\n[+] Group: #{@group}\n[+] Leeching pages "
  496. for i in 1..$max_pages do
  497. @page = @page+1
  498. @url  = "http://soundcloud.com/groups/#{@group}/tracks?page=#{@page}"
  499. print "#{@page}/#{$max_pages}..."
  500. Net::HTTP.get_response(URI.parse(@url)).body.each_line do |line|
  501. if (line['class="info-header"'])
  502. @filename = line.split('</a').first.split('>').last.gsub(/ Artwork$/,'').gsub('&quot;','"').gsub('&amp;','&')
  503. for excluded_tag in $excluded_tags.split(";").each do
  504. if not excluded_tag == "" and @filename[/#{Regexp.escape(excluded_tag)}/i] then @downloadable = "no" end
  505. end
  506. end
  507. if (line['button download']) then @downloadable = "yes" end
  508. if (line['button download']) then @track_url    = "http://soundcloud.com#{line.split('href="').last.split('"').first}\n" end
  509. if (line['This track is not downloadable']) then @downloadable = "no" end
  510. if (line['class="file-type"'])
  511. @ext = line.split('</').first.split('>').last
  512. for excluded_ext in $excluded_exts.split(";").each do
  513. if not excluded_ext == "" and @ext =~ /^#{Regexp.escape(excluded_ext)}$/i then @downloadable = "no" end
  514. end
  515. end
  516. if (line['class="content-size"'])
  517. @size         = line.split('</').first.split('>').last
  518. if @size.gsub(".","").to_i > $max_size then @downloadable = "no" end
  519. end
  520. if (line['class="duration"']) then @duration     = line.split('</').first.split('>').last end
  521. if (line['class="duration"']) and @downloadable == "yes" and @duration.gsub(".","").to_i > $min_duration and @duration.gsub(".","").to_i < $max_duration
  522. @info = "\n\nFilename : #{@filename} \nExtension: #{@ext} \nFilesize : #{@size}  \nDuration : #{@duration} minutes\nURL      : #{@track_url}\n"
  523. filewrite()
  524. end
  525. end
  526. end
  527. end
  528. end
  529.  
  530. end
  531.  
  532.  
  533. logo()
  534. get_settings()
  535. main()
  536.  
  537.  
  538. __END__
  539.  
  540.  
10225  Programación / Scripting / Re: [Batch] Virulator 1.0c en: 15 Noviembre 2012, 07:49 am
Hola,

Gracias pero tus preguntas no son relacionadas con el aporte, debiste crear un nuevo tema...

Citar
¿.bat es la extensión de los programas escritos en Batch?
Sí. También pueden ser ".cmd" (No hay diferencia).

Citar
¿Por qué no se considera a Batch como un lenguaje de programación?
¿por qué está en la zona Scripting?
Porque es un lenguaje interpretado, como todos los de scripting... En cambio VB, C, Java, y todo el resto no necesitan un intérprete para su ejecución, ya que son compilados.

100% cierto es que Batch es un lenguaje de scripting, pero si lo diferencias con el resto de lenguajes de scripting puedes apreciar como haría falta añadir otro término a la lista solamente para apartar a Batch y dejarlo ahí, porque es el más limitado en todos los aspectos respecto a los otros...

Citar
¿Este lenguaje no hace distinción entre mayúsculas y minúsculas en sus funciones verdad?
Correcto.

Un saludo.

Porfavor no seguir haciendo preguntas que no tienen nada que ver con el post o lo acabaré cerrando.
10226  Programación / Programación General / Re: Teamviewer en: 14 Noviembre 2012, 00:49 am
En logmein hay una aplicacion hack que lo hace,,no se si lo habeis visto,,es hacer algo parecido......

Esa "aplicación hack" es una de las mayores chorradas que ya ví hace un tiempo, de aplicación tiene poco, y de hack menos. es un simple script en batch que ejecuta el instalador de logmein con las opciones silenciosas, han querido hacerlo "bonito" y llamarlo "aplicación hack", pero lo cierto es que nada de eso sería posible si Logmein no dispusiera de dichas opciones en el instalador, depende únicamente de eso, del instalador "installShield".

Un ejemplo:
Código
  1. @Echo OFF
  2. msiexec.exe /qn /i "logmein.msi" USERPASSWORD="TU_PASSWORD" USERVERIFYPWD="TU_PASSWORD_OTRA_VEZ" USEREMAIL="TU_EMAIL" USERWEBPASSWORD="EL_PASSWORD_DEL_EMAIL" LicenseType=free
Eso es lo que hace la tán popular aplicación xD
Info aquí: http://foro.elhacker.net/empty-t366923.0.html

El instalador de Teamvier es un instalador de tipo "NSIS", así que puedes usar este comando para instalarlo de forma silenciosa:
Código:
TeamViewer_Setup_es.exe /S
(LA "S" EN MAYÚSCULA)

Pero en Windows, sin programas de terceros no vas a poder ocultar la ventana que sale trás la instalación...
NIRCMD - http://www.nirsoft.net/utils/nircmd.html
CMDOW - http://www.commandline.co.uk/cmdow/

Puedes hacer un pequeño script en Batch que primero ejecute el instalador silencioso, y con un bucle para esperar a que se cargue el teamviewer y ocultar la ventana ene se momento con NIRCMD o CMDOW. Todo eso, lo metes en un RAR autoextraible y silencioso también.

Saludos
10227  Foros Generales / Sugerencias y dudas sobre el Foro / Re: Insertar fuente "Lucida Console" en un post en: 14 Noviembre 2012, 00:13 am
Si lo que necesitas es una letra monoespaciada utiliza el tag [tt][/tt]

eso lo he probado pero no me funciona

Esto está con teletipo:
abcde
iiiii


y esto con Lucida (sin teletipo, claro):
abcde
iiiii


A mi no me sale monoespaciada si uso el teletipo, ah, y gracias por el término, no lo conocía.

Saludos
10228  Programación / Scripting / Re: [RUBY] [APPORTE PARA WINDOWS] PATHS v0.1 - Una utilidad para el PATH en: 14 Noviembre 2012, 00:05 am
Buen aporte, oye tio tu como te dosificas el tiempo? xD

(Gracias)

Tengo una máquina del tiempo

Un saludo.
10229  Programación / Scripting / Re: Interpretar una palabra con otra (o remplazarla) en: 13 Noviembre 2012, 23:56 pm
da un ejemplo detallado porque no entendí lo que quieres que haga el bat con la variable del SET /P

¿Podrías escribir un pseudocódigo de ejemplo?, o algo parecido para entenderlo, porque de verdad... lo que pides no lo entiendo ni le veo sentido...

Código
  1. @Echo OFF
  2. Set /P "VAR=>> "
  3. REM Echo Hola
  4. Set "VAR=Adios"
  5. Echo %VAR%
  6. Pause&Exit

Dudo que séa eso lo que quieres... explica el proceso que debe haber en medio para poder ayudarte.

un saludo
10230  Programación / Scripting / [RUBY] [APPORTE PARA WINDOWS] PATHS v0.3 - Una utilidad para el PATH en: 13 Noviembre 2012, 23:44 pm
    

  PATHS v0.3
   By Elektro H@cker  













   Opciones:

   /? (or) -help  | Muestra la ayuda.

   -l (or) -list  | Lista las entradas del PATH.

   -c (or) -clean | Limpia entradas inválidas o duplicados en los PATH.

   -r (or) -reset | Resetea el PATH al PATH de Windows por defecto.

   -a (or) -add   | Añade una entrada.

   -d (or) -del   | Elimina una entrada.

   -add -current  | Fuerza el añadido de una entrada al "Current_User" PATH.

   -add -local    | Fuerza el añadido de una entrada al "Local_Machine" PATH.



   Ejemplos:

   PATHS -l
  
  • Lista (Indexa) las entradas dle path.

   PATHS -a "C:\Folder"
  
  • Añade la entrada "C:\Folder" al LOCAL_MACHINE PATH.

   PATHS -a current "C:\Folder"
  
  • Añade la entrada "C:\Folder" al CURRENT_USER PATH..

   PATHS -d "3"
  
  • Elimina la entrada nº3 de la lista.

   PATHS -d "C:\Folder"
  
  • Elimina la entrada "C:\Folder".


Compilado: http://elektrostudios.tk/PATHS.exe

PATHS.rb

(El código está algo sucio, pero lo que importa es que funciona xD)

Código
  1. require 'win32/registry'
  2. require 'rainbow'
  3.  
  4.  
  5. # PATHS v0.3
  6. #
  7. # By Elektro H@cker
  8.  
  9.  
  10. # Description:
  11. # -----------
  12. # This is a tool to manage the windows PATH enviroment.
  13. # Add, delete, backup, clean, list, and reset the PATH.
  14.  
  15.  
  16. exit if Object.const_defined?(:Ocra)
  17.  
  18.  
  19. def logo()
  20.  print "
  21.   PATHS v0.3
  22.  
  23.   By Elektro H@cker
  24.  
  25. ".foreground(:white)
  26. end
  27.  
  28.  
  29. def help()
  30.  print '
  31.  
  32.   Options:
  33.  
  34.   /? (or) -help   | Show this info.
  35.  
  36.   -l (or) -list   | List the entries.
  37.  
  38.   -b (or) -backup | Backup the entries.  
  39.  
  40.   -c (or) -clean  | Clean duplicates and invalid directories in the paths.
  41.  
  42.   -r (or) -reset  | Reset the paths to the Windows defaults.
  43.  
  44.   -a (or) -add    | Add a entry.
  45.  
  46.   -d (or) -del    | Delete a entry.
  47.  
  48.   -add -current   | Force adding a entry into the current user path.
  49.  
  50.   -add -local     | Force adding a entry into the local machine path.
  51.  
  52.  
  53.  
  54.   Examples:
  55.  
  56.   PATHS -l
  57.   [+] Indexes all the entries.
  58.  
  59.   PATHS -a "C:\Folder"
  60.   [+] Adds a entry into the local path.
  61.  
  62.   PATHS -a current "C:\Folder"
  63.   [+] Adds a entry into the current user path.
  64.  
  65.   PATHS -d "3"
  66.   [+] Deletes the 3rd entry of the indexed list.
  67.  
  68.   PATHS -d "C:\Folder"
  69.   [+] Deletes a entry.
  70.  
  71.  '
  72.  exit
  73. end
  74.  
  75.  
  76. def error(kind)
  77.  print "[+] ERROR"
  78.  if kind == "pos"      then print "\n    Index #{ARGV[1]} is out of range, only #{$pos} entries.\n" end
  79.  if kind == "notfound" then print "\n    Directory \"#{ARGV[1]}\" not found in PATH.\n" end
  80.  exit
  81. end
  82.  
  83.  
  84. def args()
  85.  if ARGV.empty?                                   then get_paths("visible") end
  86.  if ARGV[0] == "/?"    or ARGV[0] =~ /^-help$/i   then help()               end  
  87.  if ARGV[0] =~ /^-l$/i or ARGV[0] =~ /^-list$/i   then get_paths("visible") end
  88.  if ARGV[0] =~ /^-b$/i or ARGV[0] =~ /^-backup$/i then backup_path()        end
  89.  if ARGV[0] =~ /^-c$/i or ARGV[0] =~ /^-clean$/i  then clean_path()         end    
  90.  if ARGV[0] =~ /^-d$/i or ARGV[0] =~ /^-del$/i    then del_path()           end
  91.  if ARGV[0] =~ /^-a$/i or ARGV[0] =~ /^-add$/i    then add_path()           end
  92.  if ARGV[0] =~ /^-r$/i or ARGV[0] =~ /^-reset$/i  then reset_path()         end
  93. end
  94.  
  95.  
  96. def get_paths(visibility)
  97.  
  98.  $pos = 0
  99.  
  100.  # HKCU path
  101.  if not visibility == "hidden" then puts "\n   [+] Current User PATH:\n\n" end
  102.  Win32::Registry::HKEY_CURRENT_USER.open('Environment') do |reg|
  103.    for dir in reg['Path'].split(";").sort do
  104.  $pos = $pos+1
  105.  dir = dir.gsub(/^PATH=/, "")
  106.      instance_variable_set "@_#{$pos}", dir + "?CURRENT_USER"
  107.      if not File.directory? dir then invalid = "(Directory doesn't exist)".foreground(:red).bright else invalid ="" end
  108.      if not visibility == "hidden"
  109.        if $pos < 10 then puts "    #{$pos.to_s} = #{dir} #{invalid}" else puts "    #{$pos.to_s}= #{dir} #{invalid}"end
  110.      end
  111.    end
  112.  end
  113.  
  114.  # HKLM path
  115.  if not visibility == "hidden" then puts "\n\n   [+] Local Machine PATH:\n\n" end
  116.  Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment') do |reg|
  117.    for dir in reg['Path'].split(";").sort do
  118.  $pos = $pos+1
  119.  dir = dir.gsub(/^PATH=/, "")
  120.      instance_variable_set "@_#{$pos}", dir + "?LOCAL_MACHINE"
  121.      if not File.directory? dir then invalid = "(Directory doesn't exist)".foreground(:red).bright else invalid ="" end
  122.      if not visibility == "hidden"
  123.        if $pos < 10 then puts "    #{$pos.to_s} = #{dir} #{invalid}" else puts "    #{$pos.to_s}= #{dir} #{invalid}"end
  124.      end
  125.    end
  126.  end
  127.  if not visibility == "hidden" then exit end
  128.  $max_pos = $pos
  129.  
  130. end
  131.  
  132.  
  133. def add_path()
  134.  
  135.  if ARGV[1] =~ /^-current$/ then key = "current" else key = "local" end
  136.  
  137.  # HKCU path
  138.  if key == "current"
  139.    Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  140.      value = reg['Path']
  141.      reg.write('Path', Win32::Registry::REG_SZ, "#{value};#{ARGV.last}")
  142.      puts "[+] Entry added in User PATH: #{ARGV.last}"
  143.    end
  144.  end
  145.  
  146.  # HKLM path
  147.  if key == "local"
  148.    Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  149.      value = reg['Path']
  150.      reg.write('Path', Win32::Registry::REG_SZ, "#{value};#{ARGV.last}")
  151.      puts "[+] Entry added in Local PATH: #{ARGV.last}"
  152.    end
  153.  end
  154.  
  155. end
  156.  
  157.  
  158. def del_path()
  159.  
  160.    get_paths("hidden")
  161.    final_path = ""
  162.    found      = 0
  163.    notfound   = 0
  164.  
  165.  if ARGV[1] =~ /^[1-9]+$/
  166.  
  167.    choose     = instance_variable_get "@_#{ARGV[1]}"
  168.  
  169.    if ARGV[1].to_i > $max_pos.to_i then error("pos") end
  170.  
  171.    # HKCU PATH index deletion
  172.    if choose["?CURRENT_USER"]
  173.      Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  174.        value = reg['Path']
  175.        for dir in reg['Path'].split(";").sort do
  176.          if not dir == choose.split("?").first then final_path << ";" + dir end
  177.        end
  178.        reg.write('Path', Win32::Registry::REG_SZ, final_path[1..-1])
  179.      end
  180.      puts "[+] Entry deleted in User PATH: #{choose.split("?").first}"
  181.    end
  182.  
  183.    # HKLM PATH index deletion
  184.    if choose["?LOCAL_MACHINE"]
  185.      Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  186.        value = reg['Path']
  187.        for dir in reg['Path'].split(";").sort do
  188.          if not dir == choose.split("?").first then final_path << ";" + dir end
  189.        end
  190.        reg.write('Path', Win32::Registry::REG_SZ, final_path[1..-1])
  191.      end
  192.      puts "[+] Entry deleted in Local PATH: #{choose.split("?").first}"
  193.    end
  194.  
  195.  elsif
  196.  
  197.    # HKCU PATH str deletion
  198.      Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  199.        value = reg['Path']
  200.        for dir in reg['Path'].split(";").sort do
  201.          if not dir =~ /^#{Regexp.escape(ARGV[1])}$/i then final_path << ";" + dir else found = "yes" end
  202.        end
  203.        reg.write('Path', Win32::Registry::REG_SZ, final_path[1..-1])
  204.        if found == "yes" then puts "[+] Entry deleted in User PATH: #{ARGV[1]}" else notfound = 1 end
  205.      end
  206.  
  207.    # HKLM PATH str deletion
  208.      final_path = ""
  209.      found = ""
  210.      Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  211.        value = reg['Path']
  212.        for dir in reg['Path'].split(";").sort do
  213.          if not dir =~ /^#{Regexp.escape(ARGV[1])}$/i then final_path << ";" + dir else found = "yes" end
  214.        end
  215.        reg.write('Path', Win32::Registry::REG_SZ, final_path[1..-1])
  216.        if found == "yes" then puts "[+] Entry deleted in Local PATH: #{ARGV[1]}" else notfound = notfound+1 end
  217.        if notfound == 2 then error("notfound") end
  218.      end
  219.  
  220.    end
  221.  
  222. end
  223.  
  224.  
  225. def backup_path()
  226.  
  227.  # if type REG_EXPAND_SZ convert it first to REG_SZ
  228.  # HKCU path
  229.    Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  230.      value = reg['Path']
  231.      reg.write('Path', Win32::Registry::REG_SZ, value)
  232.    end
  233.  # HKLM path
  234.    Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  235.      value = reg['Path']
  236.      reg.write('Path', Win32::Registry::REG_SZ, value)
  237.    end
  238.  # Conversion end
  239.  
  240.  system('Regedit.exe /E "%TEMP%\HKCU PATH.reg" "HKEY_CURRENT_USER\Environment"')
  241.  system('Regedit.exe /E "%TEMP%\HKLM PATH.reg"  "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"')
  242.  system('type "%TEMP%\HKCU PATH.reg" | Findstr /I "\"PATH\" HKEY_CURRENT_USER Registry" > "%USERPROFILE%\Desktop\HKCU PATH %DATE:/=-%.reg"')
  243.  system('type "%TEMP%\HKLM PATH.reg" | Findstr /I "\"PATH\" HKEY_LOCAL_MACHINE Registry" > "%USERPROFILE%\Desktop\HKLM PATH %DATE:/=-%.reg"')
  244.  puts "[+] A copy of your current PATH saved at your desktop."
  245.  exit
  246. end
  247.  
  248.  
  249. def reset_path()
  250.  Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg| reg.write('Path', Win32::Registry::REG_SZ, 'C:\Windows;C:\Windows\system32;C:\Windows\System32\Wbem;C:\Windows\syswow64;C:\Windows\System32\WindowsPowerShell\v1.0') end
  251.  Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg| reg.write('Path', Win32::Registry::REG_SZ, 'C:\Windows;C:\Windows\system32;C:\Windows\System32\Wbem;C:\Windows\syswow64;C:\Windows\System32\WindowsPowerShell\v1.0') end
  252.  puts "[+] PATH restored to Windows defaults."
  253. end
  254.  
  255.  
  256. def clean_path()
  257.  
  258.  puts "\n[+] Searching invalid or duplicated entries in the PATH...\n\n"
  259.  
  260.  # HKCU PATH
  261.  final_path = ""
  262.  Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  263.    value = reg['Path']
  264.    for dir in reg['Path'].split(";").sort do
  265.      if File.directory? dir and not final_path[/#{Regexp.escape(dir)}$/i] then final_path << ";" + dir else puts "[+] Entry deleted in User PATH: #{dir}" end
  266.    end
  267.    reg.write('Path', Win32::Registry::REG_SZ, final_path[1..-1])
  268.  end
  269.  
  270.  # HKLM PATH
  271.  final_path = ""
  272.  Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  273.    value = reg['Path']
  274.    for dir in reg['Path'].split(";").sort do
  275.      if File.directory? dir and not final_path[/#{Regexp.escape(dir)}$/i] then final_path << ";" + dir else puts "[+] Entry deleted in Local PATH: #{dir}" end
  276.    end
  277.    reg.write('Path', Win32::Registry::REG_SZ, final_path[1..-1])
  278.  end
  279.  
  280.  puts "\n[+] PATH is cleaned.\n\n"
  281.  
  282. end
  283.  
  284. logo()
  285. args()
  286.  
  287. exit
Páginas: 1 ... 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 [1023] 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 ... 1235
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines