MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _check_localhost

Method _check_localhost

lib/request/dns.py:90–102  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

88 self._initialized = False
89
90 def _check_localhost(self):
91 response = b""
92
93 try:
94 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
95 s.connect(("", 53))
96 s.send(binascii.unhexlify("6509012000010000000000010377777706676f6f676c6503636f6d00000100010000291000000000000000")) # A www.google.com
97 response = s.recv(512)
98 except:
99 pass
100 finally:
101 if response and b"google" in response:
102 raise socket.error("another DNS service already running on '0.0.0.0:53'")
103
104 def pop(self, prefix=None, suffix=None):
105 """

Callers 1

__init__Method · 0.95

Calls 4

sendMethod · 0.80
recvMethod · 0.80
connectMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected