Code Monkey home page Code Monkey logo

winpwn's Introduction

winpwn: mini pwntools for Windows

for CTF windows pwn

pre

  1. there are two versions of winpwn: winpwn-deps and winpwn-nodeps
  2. for winpwn-deps:
    • based on pwintools,but I complete the IO interactive and debug module
    • have bug, and I will not update it anymore, so I suggest you use winpwn-nodeps
    • not support python3 and just can install from source code
  3. for winpwn-nodeps: written by myself.
    • just use ctypes to invoke Windows API.
    • support python2.7 and python3
    • can use pip to install winpwn-nodeps

install

  1. for debug
    • if you install by source code, modify the PATH of debugger in winpwn/var.py
    • or if you use winpwn-nodeps, touch a json file in HOMEDIR(named ".winpwn") whose content format refers winpwn-nodeps/.winpwn
  2. I just test winpwn on cmder(if use cmder , please must use it on "cmd::cmder as Admin", not bash)

winpwn-nodeps

install with pip

  • pip install winpwn
  • or pip3 install winpwn

install from source code

  1. git clone https://github.com/Byzero512/winpwn.git
  2. cd winpwn\winpwn-nodeps
  3. python setup.py install / python3 setup.py install

usage

1. process
   + process("./pwn")
   + process(["./pwn"])
2. remote
   + remote("127.0.0.1", 65535)
   
3. context
   + context.timeout=512
   + context.debugger="gdb" # or "windbg" or "x64dbg"
   + context.endian="little"
   + context.log_level="" # or "debug"
   + context.terminal=[ ]
   + context.newline="\r\n"
   
4. dbg: gdb(mingw gdb), windbg, x64dbg
   + gdb.attach(p, script="b *0x401000")
   + windbg.attach(p,script="bp 0x123456")
   + x64dbg.attach(p) #can not parse script file yet

configure

if you want to use debugger like gdb-peda, you need to deal with the deps yourself

mingw-gdb

for gdb-peda like show as bellow, you need:

  1. mingw-gdb installer:
  1. https://github.com/Byzero512/wibe (a gdb-peda like gdb-script supports mingw-gdb on windows)
  2. https://github.com/Byzero512/vmmap-win-cmd (for the command "vmmap" in wibe)

windbg

  1. pykd
  2. TWindbg: https://github.com/bruce30262/TWindbg

photos

mingw gdb

gdb

windbg

windbg

x64dbg

because lacks some commandline options, so just can use x64dbg attach to process and can not deliver init script yet

winpwn's People

Contributors

byzero512 avatar

Stargazers

ylzs 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.