Get local IP address (exposed to the remote/target)
()
| 1975 | kb.absFilePaths.add(absFilePath) |
| 1976 | |
| 1977 | def getLocalIP(): |
| 1978 | """ |
| 1979 | Get local IP address (exposed to the remote/target) |
| 1980 | """ |
| 1981 | |
| 1982 | retVal = None |
| 1983 | |
| 1984 | try: |
| 1985 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
| 1986 | s.connect((conf.hostname, conf.port)) |
| 1987 | retVal, _ = s.getsockname() |
| 1988 | s.close() |
| 1989 | except: |
| 1990 | debugMsg = "there was an error in opening socket " |
| 1991 | debugMsg += "connection toward '%s'" % conf.hostname |
| 1992 | logger.debug(debugMsg) |
| 1993 | |
| 1994 | return retVal |
| 1995 | |
| 1996 | def getRemoteIP(): |
| 1997 | """ |