Giter Site home page Giter Site logo

ios_mips_gdb's Introduction

Cisco IOS MIPS GDB remote serial protocol implementation

A hacky implementation of GDB RSP to aid exploit development for MIPS based Cisco routers

Command reference

Command reference:
c                           - continue program execution
stepi                       - step into
nexti                       - step over
reg                         - print registers
setreg <reg_name> <value>   - set register value
break <addr>                - set breakpoint
info break                  - view breakpoints set
del <break_num>             - delete breakpoint
read <addr> <len>           - read memory
write <addr> <value         - write memory
dump <startaddr> <endaddr>  - dump memory within specified range
gdb kernel                  - send "gdb kernel" command to IOS to launch GDB. Does not work on recent IOS versions.
disas <addr> [aslr]         - disassemble at address. Optional "aslr" parameter to account for code randomization
set_aslr_offset             - set aslr offset for code section

you can also send any GDB RSP command manually

Usage example

  • Launch GDB on the device
$ sudo picocom -b 9600  /dev/ttyS0
picocom v2.2
Type [C-a] [C-h] to see available commands

Terminal ready

cisco.local>en
Password: 
cisco.local#gdb kernel
||||

  • Connect the debugger
$ python mips_rsp.py /dev/ttyS0
> command: reg
All registers:
...
Control registers:
PC: 4008f3e0 SP: 47c354d8 RA: 403a026c
> command: disas
...
0x4008f3c4: move    $v0, $zero
0x4008f3c8: lui $t0, 0x45fc
0x4008f3cc: lw  $t0, 0x7ea8($t0)
0x4008f3d0: nop 
0x4008f3d4: ori $t0, $t0, 0x100
0x4008f3d8: mtc0    $t0, $t5, 0
0x4008f3dc: nop 
0x4008f3e0: nop 
0x4008f3e4: j   0x4008f3f0
0x4008f3e8: addiu   $v0, $zero, 1
0x4008f3ec: move    $v0, $zero
0x4008f3f0: lw  $ra, 0x10($sp)
...
> command:     

Dependencies

Capstone - www.capstone-engine.org

Credits

Based on https://github.com/nccgroup/IODIDE

Author

Artem Kondratenko https://twitter.com/artkond

ios_mips_gdb's People

Contributors

artkond avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.