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

Method _skeletonSelection

lib/takeover/metasploit.py:134–166  ·  view source on GitHub ↗
(self, msg, lst=None, maxValue=1, default=1)

Source from the content-addressed store, hash-verified

132 }
133
134 def _skeletonSelection(self, msg, lst=None, maxValue=1, default=1):
135 if Backend.isOs(OS.WINDOWS):
136 opSys = "windows"
137 else:
138 opSys = "linux"
139
140 message = "which %s do you want to use?" % msg
141
142 if lst:
143 for num, data in lst[opSys].items():
144 description = data[0]
145
146 if num > maxValue:
147 maxValue = num
148
149 if "(default)" in description:
150 default = num
151
152 message += "\n[%d] %s" % (num, description)
153 else:
154 message += " [%d] " % default
155
156 choice = readInput(message, default="%d" % default)
157
158 if not choice or not isDigit(choice) or int(choice) > maxValue or int(choice) < 1:
159 choice = default
160
161 choice = int(choice)
162
163 if lst:
164 choice = lst[opSys][choice][1]
165
166 return choice
167
168 def _selectSMBPort(self):
169 return self._skeletonSelection("SMB port", self._msfSMBPortsList)

Callers 5

_selectSMBPortMethod · 0.95
_selectEncoderMethod · 0.95
_selectPayloadMethod · 0.95
_selectPortMethod · 0.95
_selectConnectionMethod · 0.95

Calls 4

readInputFunction · 0.90
isDigitFunction · 0.90
isOsMethod · 0.80
itemsMethod · 0.80

Tested by

no test coverage detected