state = p.factory.entry_state() simgr = p.factory.simgr(state)
simgr.explore(find = 0x8048675)
if simgr.found: sol = simgr.found[0] print(sol.posix.dumps(0)) else: print('QQ')
執行結果:
1 2 3 4 5 6 7 8 9 10 11
└─$ python exploit00.py WARNING | 2024-04-30 04:26:52,924 | cle.loader | 00_angr_find: base_addr was specified but the object is not PIC. specify force_rebase=True to override WARNING | 2024-04-30 04:26:53,021 | angr.storage.memory_mixins.default_filler_mixin | The program is accessing register with an unspecified value. This could indicate unwanted behavior. WARNING | 2024-04-30 04:26:53,021 | angr.storage.memory_mixins.default_filler_mixin | angr will cope with this by generating an unconstrained symbolic variable and continuing. You can resolve this by: WARNING | 2024-04-30 04:26:53,021 | angr.storage.memory_mixins.default_filler_mixin | 1) setting a value to the initial state WARNING | 2024-04-30 04:26:53,021 | angr.storage.memory_mixins.default_filler_mixin | 2) adding the state option ZERO_FILL_UNCONSTRAINED_{MEMORY,REGISTERS}, to make unknown regions hold null WARNING | 2024-04-30 04:26:53,021 | angr.storage.memory_mixins.default_filler_mixin | 3) adding the state option SYMBOL_FILL_UNCONSTRAINED_{MEMORY,REGISTERS}, to suppress these messages. WARNING | 2024-04-30 04:26:53,021 | angr.storage.memory_mixins.default_filler_mixin | Filling register edi with 4 unconstrained bytes referenced from 0x80486b1 (__libc_csu_init+0x1 in 00_angr_find (0x80486b1)) WARNING | 2024-04-30 04:26:53,023 | angr.storage.memory_mixins.default_filler_mixin | Filling register ebx with 4 unconstrained bytes referenced from 0x80486b3 (__libc_csu_init+0x3 in 00_angr_find (0x80486b3)) WARNING | 2024-04-30 04:26:54,235 | angr.storage.memory_mixins.default_filler_mixin | Filling memory at 0x7ffeff60 with 4 unconstrained bytes referenced from 0x8100000 (strcmp+0x0 in extern-address space (0x0)) b'JXWVXRKX'