Advertisement
danielcristho

modul5

Dec 6th, 2024 (edited)
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.63 KB | None | 0 0
  1. # Nomor 4 (di semua webserver)
  2. iptables -A INPUT -p tcp -m multiport --dport 80,443 -m time --timestart 07:00 --timestop 19:00 --weekdays Mon,Tue,Wed,Thu,Fri -j ACCEPT
  3. iptables -A INPUT -p tcp -m multiport --dport 80,443 -j DROP
  4.  
  5. # Nomor 4 testing ganti tanggal, terus akses WS pake curl atau lynx.
  6. date -s "2024-12-09 09:00:00"
  7. date -s "2024-12-09 21:00:00"
  8.  
  9. # Nomor 5
  10. iptables -I INPUT 1 -p tcp -s 192.168.0.2/29 -m multiport --dport 80,443 -m time --weekdays Sat,Sun -j ACCEPT
  11.  
  12. # Nomor 5 testing di haibara, ganti tanggal terus curl lagi
  13. date -s "2024-12-08 11:00:00" # haibara
  14.  
  15. # Nomor 6
  16. iptables -I INPUT 2 -p tcp -m multiport --dport 80,443 -m time --timestart 11:00 --timestop 13:00 --weekdays Fri -j DROP
  17.  
  18. # Nomor 6 testing ganti ke hari jumat
  19. date -s "2024-12-13 12:00:00"
  20.  
  21. # Nomor 7
  22. iptables -N LOGGING
  23. iptables -A INPUT -p tcp -m multiport --dport 80,443 -j LOG --log-prefix " DROPPED PACKET " --log-level=warning
  24. iptables -A LOGGING -j DROP
  25.  
  26. # Urutan rule no 4-7
  27. iptables -N LOGGING
  28. iptables -A INPUT -p tcp -m multiport --dport 80,443 -j LOG --log-prefix " DROPPED PACKET " --log-level=warning
  29. iptables -A INPUT -p tcp -m multiport --dport 80,443 -m time --timestart 11:00 --timestop 13:00 --weekdays Fri -j DROP
  30. iptables -A INPUT -p tcp -s 192.168.0.0/29 -m multiport --dport 80,443 -m time --weekdays Sat,Sun -j ACCEPT
  31. iptables -A INPUT -p tcp -m multiport --dport 80,443 -m time --timestart 07:00 --timestop 19:00 --weekdays Mon,Tue,Wed,Thu,Fri -j ACCEPT
  32. iptables -A INPUT -p tcp -m multiport --dport 80,443 -j DROP
  33. iptables -A LOGGING -j DROP
  34.  
  35.  
  36. Chain INPUT (policy ACCEPT)
  37. num  target     prot opt source               destination        
  38. 1    LOG        tcp  --  anywhere             anywhere             multiport dports http,https LOG level warning prefix " DROPPED PACKET "
  39. 2    DROP       tcp  --  anywhere             anywhere             multiport dports http,https TIME from 11:00:00 to 13:00:00 on Fri UTC
  40. 3    ACCEPT     tcp  --  192.168.0.0/29       anywhere             multiport dports http,https TIME on Sat,Sun UTC
  41. 4    ACCEPT     tcp  --  anywhere             anywhere             multiport dports http,https TIME from 07:00:00 to 19:00:00 on Mon,Tue,Wed,Thu,Fri UTC
  42. 5    DROP       tcp  --  anywhere             anywhere             multiport dports http,https
  43.  
  44. Chain FORWARD (policy ACCEPT)
  45. num  target     prot opt source               destination        
  46.  
  47. Chain OUTPUT (policy ACCEPT)
  48. num  target     prot opt source               destination        
  49.  
  50. Chain LOGGING (0 references)
  51. num  target     prot opt source               destination        
  52. 1    DROP       all  --  anywhere             anywhere
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement