(self, msg, lst=None, maxValue=1, default=1)
| 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) |
no test coverage detected