MCPcopy Create free account
hub / github.com/sqlmapproject/sqlmap / getRemoteIP

Function getRemoteIP

lib/core/common.py:1996–2016  ·  view source on GitHub ↗

Get remote/target IP address >>> pushValue(conf.hostname) >>> conf.hostname = "localhost" >>> getRemoteIP() == "127.0.0.1" True >>> conf.hostname = popValue()

()

Source from the content-addressed store, hash-verified

1994 return retVal
1995
1996def getRemoteIP():
1997 """
1998 Get remote/target IP address
1999
2000 >>> pushValue(conf.hostname)
2001 >>> conf.hostname = "localhost"
2002 >>> getRemoteIP() == "127.0.0.1"
2003 True
2004 >>> conf.hostname = popValue()
2005 """
2006
2007 retVal = None
2008
2009 try:
2010 retVal = socket.gethostbyname(conf.hostname)
2011 except socket.gaierror:
2012 errMsg = "address resolution problem "
2013 errMsg += "occurred for hostname '%s'" % conf.hostname
2014 singleTimeLogMessage(errMsg, logging.ERROR)
2015
2016 return retVal
2017
2018def getFileType(filePath):
2019 """

Callers 2

_initVarsMethod · 0.90
_initVarsMethod · 0.90

Calls 1

singleTimeLogMessageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…