Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #45836
    AvatarNikolajevZj
    Participant

    Hello,
    Recently I’ve been using the arp spoofing program written in this course.I encountered a following problem.When i run the MITM attack windows VM loses connection,i executed the echo 1 > /proc/sys/net/ipv4/ip_forward command but it still doesn’t work,I had this problem before but i somehow fixed it, I don’t remember how.Could you help me?

    #45848
    diegodiego
    Moderator

    Hi!
    Try by flushing iptables before running the attack:
    iptables –flush
    iptables –table nat –flush
    iptables –delete-chain
    iptables –table nat –delete-chain
    iptables -P FORWARD ACCEPT

    Enable port forwarding
    echo 1 > /proc/sys/net/ipv4/ip_forward

    Hope it helps!
    Diego

    #45867
    AvatarNikolajevZj
    Participant

    Hello!
    Thanks to the commands you’ve mentioned I was able to deal with my issue.Firstly I’ve noticed that I’ve been calling the commands with the subprocess in an innapropriate way,I can’t figure out how to call them properly,they just don’t get executed,I need to type them manually.Before when I typed the echo command manually I think the iptables were blocking it,cause I think I didn’t stop the dns spoofer and they were refreshing each second.Anyway what I did,was just typing iptables –flush and restarting the spoofer,it works now,thanks once again!

    But there’s is one thing,the dns spoofer cuts the connection,and as I have written I can’t deal with calling the echo and iptables commands.
    I would like to make to make the program more convienient to use,by automating the necessary commands.

    I was calling both the echo and iptables commands like this:
    def ip_tab():
    command_line = “iptables -I FORWARD -j NFQUEUE –queue-num 0”
    args = shlex.split(command_line)
    subprocess.Popen(args)
    I copied this method from stack overflow,because with the echo command it was showing some kind of directory error.
    I also tried the subprocess.call with both commands but it didn’t work either.I’m stuck!Can you help me out?

    #45870
    diegodiego
    Moderator

    Hi!
    Yeah, that shlex implemenattion might be used in a different situation.

    I’ll recommend to use the os module, it’s quite simple to use, as an example:

    os.system(“echo 1 > /proc/sys/net/ipv4/ip_forward”)

    I have used this my self and works pretty well.

    Hope it helps!
    Diego

    #45904
    AvatarNikolajevZj
    Participant

    Hi!
    Yeah,the os.system command worked,the kali is forwarding the packets correctly.Thanks!

    #45961
    diegodiego
    Moderator

    Hi!
    Cool you got it!
    Diego

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.