I am trying your tool on the toy firmware that is used for the example commands. Everything seems to be working as expected until I try to trace the example PoC with HeapHopper, where it does not recognize a vulnerability but in the example it is implied that it should.
I would appreciate if you could please let me know if I am doing something wrong or if it might be configuration issues.
Thanks a lot.
~/heapster# python3 /root/heapster/heaphopper/heaphopper_client.py trace -c /root/heapster/heaphopper_analyses/p2im_drone.bin/p2im_drone.bin_fake_free_3/analysis_bad_alloc.yaml -b /root/heapster/heaphopper_analyses/p2im_drone.bin/p2im_drone.bin_fake_free_3/zoo_dir/bin/2.bin
WARNING | 2024-01-29 19:59:57,430 | heap-tracer | Config at <_io.TextIOWrapper name='/root/heapster/heaphopper_analyses/p2im_drone.bin/p2im_drone.bin_fake_free_3/analysis_bad_alloc.yaml' mode='r' encoding='UTF-8'>
CRITICAL | 2024-01-29 19:59:57,444 | heap-tracer | Loading project file at /root/fw-dataset/ground_truth/p2im_drone.bin/hb_analysis/p2im_drone.bin.proj
WARNING | 2024-01-29 19:59:57,566 | cle.backends.elf.elf | User specified <Arch ARMCortexM (LE)> but autodetected <Arch ARMHF (LE)>. Proceed with caution.
INFO | 2024-01-29 19:59:57,600 | cle.loader | Loading libc.so.6...
INFO | 2024-01-29 19:59:57,601 | cle.loader | ... not found
INFO | 2024-01-29 19:59:57,601 | cle.loader | Linking /root/heapster/heaphopper_analyses/p2im_drone.bin/p2im_drone.bin_fake_free_3/zoo_dir/bin/2.bin
INFO | 2024-01-29 19:59:57,601 | cle.loader | Linking /root/fw-dataset/ground_truth/p2im_drone.bin/p2im_drone.bin
INFO | 2024-01-29 19:59:57,601 | cle.loader | Linking ram
INFO | 2024-01-29 19:59:57,601 | cle.loader | Linking mmio
WARNING | 2024-01-29 19:59:57,601 | cle.loader | The main binary is a position-independent executable. It is being loaded with a base address of 0x400000.
INFO | 2024-01-29 19:59:57,601 | cle.loader | Mapping /root/heapster/heaphopper_analyses/p2im_drone.bin/p2im_drone.bin_fake_free_3/zoo_dir/bin/2.bin at 0x400000
INFO | 2024-01-29 19:59:57,601 | cle.loader | Mapping /root/fw-dataset/ground_truth/p2im_drone.bin/p2im_drone.bin at 0x8000000
INFO | 2024-01-29 19:59:57,601 | cle.loader | Mapping cle##externs at 0x500000
INFO | 2024-01-29 19:59:57,603 | cle.loader | Linking cle##externs
INFO | 2024-01-29 19:59:57,603 | cle.loader | Mapping cle##externs at 0x600000
INFO | 2024-01-29 19:59:57,604 | cle.loader | Linking cle##tls
INFO | 2024-01-29 19:59:57,604 | cle.loader | Mapping cle##tls at 0x700000
INFO | 2024-01-29 19:59:57,604 | cle.loader | Mapping cle##kernel at 0x800000
INFO | 2024-01-29 19:59:57,604 | heap-tracer | [+]PoC and Blob loaded inside HeapHopper
INFO | 2024-01-29 19:59:57,605 | heap-tracer | [+] PoC Entry Point at [0x400445]
INFO | 2024-01-29 19:59:57,605 | heap-tracer | [+] PoC Arch [ARMCortexM]
INFO | 2024-01-29 19:59:57,605 | heap-tracer | [+] PoC Initial Stack Pointer [0x20005000]
INFO | 2024-01-29 19:59:57,605 | heap-tracer | [+] PoC Regions:
INFO | 2024-01-29 19:59:57,605 | heap-tracer | [+] Region 0: <ELF Object 2.bin, maps [0x400000:0x4110a7]>
INFO | 2024-01-29 19:59:57,605 | heap-tracer | [+] Region 1: <ExternObject Object cle##externs, maps [0x500000:0x500009]>
INFO | 2024-01-29 19:59:57,605 | heap-tracer | [+] Region 2: <ExternObject Object cle##externs, maps [0x600000:0x608000]>
INFO | 2024-01-29 19:59:57,605 | heap-tracer | [+] Region 3: <ELFTLSObjectV1 Object cle##tls, maps [0x700000:0x705808]>
INFO | 2024-01-29 19:59:57,605 | heap-tracer | [+] Region 4: <KernelObject Object cle##kernel, maps [0x800000:0x808000]>
INFO | 2024-01-29 19:59:57,605 | heap-tracer | [+] Region 5: <Blob Object p2im_drone.bin, maps [0x8000000:0x80079c0]>
INFO | 2024-01-29 19:59:57,605 | heap-tracer | [+] Region 6: <NamedRegion ram, maps [0x1fff0000:0x30000000]>
INFO | 2024-01-29 19:59:57,605 | heap-tracer | [+] Region 7: <NamedRegion mmio, maps [0x40000000:0x50000000]>
INFO | 2024-01-29 19:59:57,633 | heaphopper.angr_tools | Updating memory with following pages:
INFO | 2024-01-29 19:59:57,633 | heap-tracer | Heap base address is at 0x20001698
INFO | 2024-01-29 19:59:57,635 | heap-tracer | Setupping HeapHopper initial state
INFO | 2024-01-29 19:59:57,635 | heap-tracer | ctrl_data_0 at 0x411068
INFO | 2024-01-29 19:59:57,635 | heap-tracer | ctrl_data_1 at 0x411070
INFO | 2024-01-29 19:59:57,635 | heap-tracer | Storing mem2chunk_offset value <BV32 0x4> at 0x411050
INFO | 2024-01-29 19:59:57,636 | heap-tracer | Storing sym_data value at 0x411078
INFO | 2024-01-29 19:59:57,636 | heap-tracer | Storing sym_data value at 0x41107c
INFO | 2024-01-29 19:59:57,637 | heap-tracer | Storing sym_data value at 0x411080
INFO | 2024-01-29 19:59:57,637 | heap-tracer | Storing sym_data value at 0x411084
INFO | 2024-01-29 19:59:57,637 | heap-tracer | Storing sym_data value at 0x411088
INFO | 2024-01-29 19:59:57,638 | heap-tracer | Storing sym_data value at 0x41108c
INFO | 2024-01-29 19:59:57,638 | heap-tracer | Storing sym_data value at 0x411090
INFO | 2024-01-29 19:59:57,639 | heap-tracer | Storing sym_data value at 0x411094
INFO | 2024-01-29 19:59:57,640 | heap-tracer | Storing write_mem_element value at 0x411008
INFO | 2024-01-29 19:59:57,640 | heap-tracer | Storing write_mem_element value at 0x41100c
INFO | 2024-01-29 19:59:57,641 | heap-tracer | Storing write_mem_element value at 0x411010
INFO | 2024-01-29 19:59:57,641 | heap-tracer | Storing write_mem_element value at 0x411014
INFO | 2024-01-29 19:59:57,641 | heap-tracer | Storing write_mem_element value at 0x411018
INFO | 2024-01-29 19:59:57,642 | heap-tracer | Storing write_mem_element value at 0x41101c
INFO | 2024-01-29 19:59:57,642 | heap-tracer | Storing write_mem_element value at 0x411020
INFO | 2024-01-29 19:59:57,643 | heap-tracer | Storing write_mem_element value at 0x411024
INFO | 2024-01-29 19:59:57,643 | heap-tracer | Storing write_mem_element value at 0x411028
INFO | 2024-01-29 19:59:57,644 | heap-tracer | Storing write_mem_element value at 0x41102c
INFO | 2024-01-29 19:59:57,644 | heap-tracer | Storing write_mem_element value at 0x411030
INFO | 2024-01-29 19:59:57,644 | heap-tracer | Storing write_mem_element value at 0x411034
INFO | 2024-01-29 19:59:57,645 | heap-tracer | Storing write_mem_element value at 0x411038
INFO | 2024-01-29 19:59:57,645 | heap-tracer | Storing write_mem_element value at 0x41103c
INFO | 2024-01-29 19:59:57,646 | heap-tracer | Storing write_mem_element value at 0x411040
INFO | 2024-01-29 19:59:57,646 | heap-tracer | Storing write_mem_element value at 0x411044
INFO | 2024-01-29 19:59:57,646 | heap-tracer | Storing header_size value <BV32 0x4> at 0x41104c
[4264020, 4264024]
INFO | 2024-01-29 19:59:57,648 | heap-tracer | Storing malloc_size value at 0x411054
INFO | 2024-01-29 19:59:57,649 | heap-tracer | Storing malloc_size value at 0x411058
INFO | 2024-01-29 19:59:57,649 | heap-tracer | Storing fill_size value <BV32 0x0> at 0x41105c
INFO | 2024-01-29 19:59:57,650 | heap-tracer | Storing fill_size value <BV32 0x0> at 0x411060
INFO | 2024-01-29 19:59:57,651 | heap-tracer | Storing at 0x411098
INFO | 2024-01-29 19:59:57,652 | heap-tracer | Storing at 0x41109c
INFO | 2024-01-29 19:59:57,652 | heap-tracer | Storing at 0x4110a0
INFO | 2024-01-29 19:59:57,830 | heap-tracer | [+] State is configured. Ready to execute.
INFO | 2024-01-29 19:59:57,830 | heap-tracer | [+] Starting HeapHopper with timeout [1800] secs
INFO | 2024-01-29 19:59:57,830 | angr.sim_manager | Stepping active of <SimulationManager with 1 active>
DEBUG | 2024-01-29 19:59:57,833 | HHExecutor | [+] State to step is <SimState @ 0x400445>
INFO | 2024-01-29 19:59:57,923 | angr.sim_manager | Stepping active of <SimulationManager with 1 active>
DEBUG | 2024-01-29 19:59:57,925 | HHExecutor | [+] State to step is <SimState @ 0x400408>
INFO | 2024-01-29 19:59:57,929 | angr.sim_manager | Stepping active of <SimulationManager with 1 active>
DEBUG | 2024-01-29 19:59:57,931 | HHExecutor | [+] State to step is <SimState @ 0x500000>
DEBUG | 2024-01-29 19:59:58,150 | HHExecutor | [+] Reached address 0xdeadbeef
DEBUG | 2024-01-29 19:59:58,151 | HHExecutor | [!] Reached end of function. Exiting.
INFO | 2024-01-29 19:59:58,151 | heap-tracer | [+] HeapHopper terminated!
INFO | 2024-01-29 19:59:58,151 | heap-tracer | Found 0 vulns
INFO | 2024-01-29 19:59:58,151 | heap-tracer | These are the errored state:
END-METADATA-EXPERIMENTS
POC-TRACING-TOTAL-TIME: 0.32115936279296875
Hello there,
I am trying your tool on the toy firmware that is used for the example commands. Everything seems to be working as expected until I try to trace the example PoC with HeapHopper, where it does not recognize a vulnerability but in the example it is implied that it should.
I would appreciate if you could please let me know if I am doing something wrong or if it might be configuration issues.
Thanks a lot.
And this is the hb_state.json: