Jump to content
Sign in to follow this  
Ibrahim

The GateWay Watcher(detect speeofing)

Recommended Posts

Ibrahim

Share this post


Link to post
Share on other sites
jvanegmond

Why do you ping www.autoitscript.com and do nothing with the return value or the error flag?

Share this post


Link to post
Share on other sites
BrettF
Ibrahim

as for binging www.autoitscript.com i shortened the script and forgot to delete that line

as for being banned from your router "nice try" is good or bad!!!!

Share this post


Link to post
Share on other sites
cdtoews

I needed a function for getting a mac address from an ip address,

I customized your script for my purposes.

Here is the function I came up with

#include <Constants.au3>

Func _get_mac($hostname)

    local $foo, $bar
     If (Ping($hostname, 1000) > 0) Then    
        $foo = Run("arp -a", @SystemDir, @SW_HIDE, $STDOUT_CHILD)
        Global $line = ""
        While 1
            $line = $line & StdoutRead($foo)
            If @error Then ExitLoop
        Wend

        $result = StringRegExp($line, "(?i)((?:\d{1,3}\.){3}\d{1,3})\s+?((?:[0-9A-F]{2}-){5}[0-9A-F]{2})", 3)

        For $i = 0 to UBound($result) - 1 step 2
            if $result[$i]=$hostname Then
                 $bar = $result[$i+1]
             EndIf
        Next
    EndIf

    Return $bar

EndFunc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×