How to prevent local users from using fsockopen for DDOS attacks in the IIS environment

Source: Internet
Author: User
How to prevent local users from using fsockopen for DDOS attacks in the IIS environment

  1. /*
  2. From: http://bbs.it-home.org
  3. Date: 2013/2/17
  4. */
  5. $ Fp = fsockopen ("udp: // $ ip", $ rand, $ errno, $ errstr, 5 );
  6. If ($ fp ){
  7. Fwrite ($ fp, $ out );
  8. Fclose ($ fp );
  9. ?>

In this case, you can modify php. ini, disable the fsockopen function, and use the security policy of Windows 2003 to shield the UDP port of the local machine.

1) disable functionsFind disable_functions and add the function name to be disabled, as shown in the following example:

  1. Passthru, exec, system, chroot, scandir, chgrp, chown, shell_exec, proc_open, proc_get_status, ini_alter, ini_alter, ini_restore, dl, pfsockopen, openlog,
  2. Syslog, readlink, symlink, popepassthru, stream_socket_server, fsocket, fsockopen

It takes effect after you restart IIS.

2) shield UDP portsCopy the file to notepad and save it as a bat file with any name. double-click it to run it.

  1. Add Security Policy, name

  2. Netsh ipsec static add policy name = my security policy

  3. Add IP filter list by REM

  4. Netsh ipsec static add filterlist name = allowed List
  5. Netsh ipsec static add filterlist name = Reject List

  6. Add the REM filter to the IP filter list (allow Internet access)

  7. Netsh ipsec static add filter filterlist = allow list srcaddr = me dstaddr = any description = dns access protocol = udp mirrored = yes dstport = 53

  8. Add the REM filter to the IP filter list (not accessible to others)

  9. Netsh ipsec static add filter filterlist = reject list srcaddr = any dstaddr = me description = anyone else sends me any access to protocol = udp mirrored = yes

  10. REM add filter operation

  11. Netsh ipsec static add filteraction name = yes action = permit
  12. Netsh ipsec static add filteraction name = no action = block

  13. @ REM http://bbs.it-home.org.

  14. REM creates a link to specify the IPSec policy, filter list, and filter operation rules (add rules to my security policy)
  15. Netsh ipsec static add rule name = allow rule policy = my security policy filterlist = allow list filteraction = yes
  16. Netsh ipsec static add rule name = deny rule policy = my security policy filterlist = deny list filteraction = no

  17. REM activates my security policy

  18. Netsh ipsec static set policy name = my security policy assign = y

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.