James_inthe_box

VM

Sep 9th, 2017
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. Requirements on guest:
  2. mitmproxy
  3. proxychains
  4. socat
  5. iptables
  6. remote server (router) running tor
  7.  
  8. Host: vboxnet0 x.x.0.1
  9. Guest: host-only x.x.0.2
  10.  
  11. Remote tor server:
  12. /etc/tor/torrc
  13. VirtualAddrNetworkIPv4 10.192.0.0/10
  14. AutoMapHostsOnResolve 1
  15. SocksPort 127.0.0.1:9050
  16. SocksPort tor_server_ip:9050
  17. TransPort 127.0.0.1:9040
  18. TransPort tor_server_ip:9040
  19. DNSPort 127.0.0.1:9053
  20. DNSPort tor_server_ip:9053
  21. SocksPolicy accept guest_ip_range/24
  22. ControlPort 9051
  23. DisableDebuggerAttachment 0
  24.  
  25. On guest
  26. /etc/proxychains.conf:
  27. strict_chain
  28. proxy_dns
  29. tcp_read_time_out 15000
  30. tcp_connect_time_out 8000
  31. [ProxyList]
  32. socks4 tor_server_ip 9050
  33.  
  34. run mitmproxy once, look for and import certs from ~/.mitmproxy
  35.  
  36. on the host create these:
  37.  
  38. malwaretor script:
  39. ########################
  40. #!/bin/bash
  41. #turn on ipforward and ip dynaddr
  42. echo "1" > /proc/sys/net/ipv4/ip_forward
  43. echo "1" > /proc/sys/net/ipv4/ip_dynaddr
  44. echo "1" > /proc/sys/net/ipv4/tcp_syncookies
  45.  
  46. /sbin/iptables -F
  47. /sbin/iptables -F -t nat
  48. /sbin/iptables -X
  49. /sbin/iptables -P FORWARD ACCEPT
  50. /sbin/iptables -F FORWARD
  51. /sbin/iptables -A INPUT -i lo -j ACCEPT
  52.  
  53. /sbin/iptables -t nat -A PREROUTING -i vboxnet0 -s x.x.0.2 -p tcp -j REDIRECT --to-port 8889
  54. /sbin/iptables -t nat -A PREROUTING -i vboxnet0 -s x.x.0.2 -p udp -j REDIRECT --to-port 5002
  55.  
  56. /usr/bin/socat UDP-LISTEN:5002,fork UDP:tor_server_ip:9053 &
  57. /usr/bin/proxychains /mitmproxy/mitmdump --insecure -T -b x.x.0.1 -p 8889 --cert *=~/.mitmproxy/mitmproxy-ca-cert.pem -w <where_to_save_file>/mitm.dump
  58. ########################
  59.  
  60. when finished ctrl+c then reset and kill socat script:
  61. ########################
  62. #!/bin/bash
  63. /sbin/iptables -F
  64. /sbin/iptables -F -t nat
  65. /sbin/iptables -X
  66. /sbin/iptables -P FORWARD ACCEPT
  67. /sbin/iptables -F FORWARD
  68. /sbin/iptables -A INPUT -i lo -j ACCEPT
  69.  
  70. killall socat
  71. #######################
Advertisement
Add Comment
Please, Sign In to add comment