| 88 | |
| 89 | |
| 90 | class TestShellcode(unittest.TestCase): |
| 91 | def test_linux_x86(self): |
| 92 | print("Linux X86 32bit Shellcode") |
| 93 | ql = Qiling(code=X86_LIN, archtype=QL_ARCH.X86, ostype=QL_OS.LINUX, verbose=QL_VERBOSE.OFF) |
| 94 | ql.run() |
| 95 | |
| 96 | def test_linux_x64(self): |
| 97 | print("Linux X86 64bit Shellcode") |
| 98 | ql = Qiling(code=X8664_LIN, archtype=QL_ARCH.X8664, ostype=QL_OS.LINUX, verbose=QL_VERBOSE.OFF) |
| 99 | ql.run() |
| 100 | |
| 101 | def test_linux_mips32(self): |
| 102 | print("Linux MIPS 32bit EL Shellcode") |
| 103 | ql = Qiling(code=MIPS32EL_LIN, archtype=QL_ARCH.MIPS, ostype=QL_OS.LINUX, verbose=QL_VERBOSE.OFF) |
| 104 | |
| 105 | ql.os.set_syscall('execve', graceful_execve, QL_INTERCEPT.EXIT) |
| 106 | ql.run() |
| 107 | |
| 108 | # This shellcode needs to be changed to something non-blocking |
| 109 | def test_linux_arm(self): |
| 110 | print("Linux ARM 32bit Shellcode") |
| 111 | ql = Qiling(code=ARM_LIN, archtype=QL_ARCH.ARM, ostype=QL_OS.LINUX, verbose=QL_VERBOSE.OFF) |
| 112 | ql.run() |
| 113 | |
| 114 | def test_linux_arm_thumb(self): |
| 115 | print("Linux ARM Thumb Shllcode") |
| 116 | ql = Qiling(code=ARM_THUMB, archtype=QL_ARCH.ARM, ostype=QL_OS.LINUX, verbose=QL_VERBOSE.OFF, thumb=True) |
| 117 | ql.run() |
| 118 | |
| 119 | def test_linux_arm64(self): |
| 120 | print("Linux ARM 64bit Shellcode") |
| 121 | ql = Qiling(code=ARM64_LIN, archtype=QL_ARCH.ARM64, ostype=QL_OS.LINUX, verbose=QL_VERBOSE.OFF) |
| 122 | |
| 123 | ql.os.set_syscall('execve', graceful_execve, QL_INTERCEPT.EXIT) |
| 124 | ql.run() |
| 125 | |
| 126 | # #This shellcode needs to be changed to something simpler not requiring rootfs |
| 127 | # def test_windows_x86(self): |
| 128 | # print("Windows X86 32bit Shellcode") |
| 129 | # ql = Qiling(code=X86_WIN, archtype=QL_ARCH.X86, ostype=QL_OS.WINDOWS, rootfs="../examples/rootfs/x86_reactos", verbose=QL_VERBOSE.OFF) |
| 130 | # ql.run() |
| 131 | |
| 132 | # #This shellcode needs to be changed to something simpler not requiring rootfs |
| 133 | # def test_windows_x64(self): |
| 134 | # print("\nWindows X8664 64bit Shellcode") |
| 135 | # ql = Qiling(code=X8664_WIN, archtype=QL_ARCH.X8664, ostype=QL_OS.WINDOWS, rootfs="../examples/rootfs/x86_reactos", verbose=QL_VERBOSE.OFF) |
| 136 | # ql.run() |
| 137 | |
| 138 | # #This shellcode needs to be changed to something simpler, listen is blocking |
| 139 | # def test_freebsd_x64(self): |
| 140 | # print("FreeBSD X86 64bit Shellcode") |
| 141 | # ql = Qiling(code=X8664_FBSD, archtype=QL_ARCH.X8664, ostype=QL_OS.FREEBSD, verbose=QL_VERBOSE.OFF) |
| 142 | # ql.run() |
| 143 | |
| 144 | # def test_macos_x64(self): |
| 145 | # print("macos X86 64bit Shellcode") |
| 146 | # ql = Qiling(code=X8664_macos, archtype=QL_ARCH.X8664, ostype=QL_OS.MACOS, verbose=QL_VERBOSE.OFF) |
| 147 | # ql.run() |
no outgoing calls