| 6762 | return |
| 6763 | |
| 6764 | def search_shellcode(self, search_options: List) -> None: |
| 6765 | # API : http://shell-storm.org/shellcode/ |
| 6766 | args = "*".join(search_options) |
| 6767 | |
| 6768 | res = http_get(self.search_url + args) |
| 6769 | if res is None: |
| 6770 | err("Could not query search page") |
| 6771 | return |
| 6772 | |
| 6773 | ret = gef_pystring(res) |
| 6774 | |
| 6775 | # format: [author, OS/arch, cmd, id, link] |
| 6776 | lines = ret.split("\\n") |
| 6777 | refs = [line.split("::::") for line in lines] |
| 6778 | |
| 6779 | if refs: |
| 6780 | info("Showing matching shellcodes") |
| 6781 | info("\t".join(["Id", "Platform", "Description"])) |
| 6782 | for ref in refs: |
| 6783 | try: |
| 6784 | _, arch, cmd, sid, _ = ref |
| 6785 | gef_print("\t".join([sid, arch, cmd])) |
| 6786 | except ValueError: |
| 6787 | continue |
| 6788 | |
| 6789 | info("Use `shellcode get <id>` to fetch shellcode") |
| 6790 | return |
| 6791 | |
| 6792 | |
| 6793 | @register |