You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.2 KiB

6 years ago
  1. ### Instructions to setup VirtualBox scenario
  2. In each machine, remember to setup the dns server, for example, in /etc/resolv.conf:
  3. ```
  4. nameserver 8.8.8.8
  5. ```
  6. ### Victim
  7. - network adapter:
  8. - Host-only Adapter
  9. - /etc/network/interfaces:
  10. ```
  11. auto lo
  12. iface lo inet loopback
  13. auto eth0
  14. iface eth0 inet static
  15. address 10.0.2.20
  16. netmask 255.255.255.0
  17. gateway 10.0.2.15
  18. ```
  19. ### Attacker
  20. - network adapter:
  21. - Host-only Adapter
  22. - /etc/network/interfaces:
  23. ```
  24. auto lo
  25. iface lo inet loopback
  26. auto eth0
  27. iface eth0 inet static
  28. address 10.0.2.10
  29. netmask 255.255.255.0
  30. gateway 10.0.2.15
  31. ```
  32. ### Gateway
  33. - network adapter:
  34. - Bridged Adapter
  35. - Host-only Adapter
  36. - /etc/network/interfaces:
  37. ```
  38. auto lo
  39. iface lo inet loopback
  40. auto eth0
  41. iface eth0 inet dhcp
  42. auto eth1
  43. iface eth1 inet static
  44. address 10.0.2.15
  45. netmask 255.255.255.0
  46. ```
  47. Clean IPTABLES:
  48. ```
  49. iptables --flush
  50. iptables --table nat --flush
  51. ```
  52. Configure the Gateway machine as a router:
  53. ```
  54. echo 1 > /proc/sys/net/ipv4/ip_forward
  55. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  56. iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
  57. iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
  58. ```