mirror of
https://github.com/k4m4/kickthemout.git
synced 2024-11-22 04:54:26 +01:00
Merge pull request #341 from ylink-lfs/patch-1
Update checkInternetConnection and getGatewayIP functions
This commit is contained in:
commit
36b7035be0
@ -127,7 +127,7 @@ def runDebug():
|
|||||||
# make sure there is an internet connection
|
# make sure there is an internet connection
|
||||||
def checkInternetConnection():
|
def checkInternetConnection():
|
||||||
try:
|
try:
|
||||||
urlopen('https://google.com', timeout=3)
|
urlopen('https://github.com', timeout=3)
|
||||||
return True
|
return True
|
||||||
except URLError as err:
|
except URLError as err:
|
||||||
return False
|
return False
|
||||||
@ -185,7 +185,7 @@ def getDefaultInterfaceMAC():
|
|||||||
def getGatewayIP():
|
def getGatewayIP():
|
||||||
global stopAnimation
|
global stopAnimation
|
||||||
try:
|
try:
|
||||||
getGateway = sr1(IP(dst="google.com", ttl=0) / ICMP() / "XXXXXXXXXXX", verbose=False)
|
getGateway = sr1(IP(dst="github.com", ttl=0) / ICMP() / "XXXXXXXXXXX", verbose=False)
|
||||||
return getGateway.src
|
return getGateway.src
|
||||||
except:
|
except:
|
||||||
# request gateway IP address (after failed detection by scapy)
|
# request gateway IP address (after failed detection by scapy)
|
||||||
@ -785,4 +785,4 @@ if __name__ == '__main__':
|
|||||||
# set to non-interactive attack
|
# set to non-interactive attack
|
||||||
interactive = False
|
interactive = False
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user