Skip to main content

A open-source Pwntools Extern Functions.

Project description

An Open-Source Pwntools External functions library.

Usage:

  1. pip install PwnModules
  2. from PwnModules import *

Features:

Format String Helper

fmt_canary

  • Prototype: fmt_canary()

  • Parameters:

    • While using fmt_canary() function, It will automaticly exploit the Canary's offset on the stack.

    • Be advised, This function only works for simple problems.

fmtstraux

  • Prototype: fmtstraux(int size, bool x64)

  • Parameters:

    • Size The number of %p

    • x64 The system arch

fmtgen

  • Prototype: fmtgen(char character, int size, int num, char separator)

  • Parameters:

    • character By default p

    • size The number of %character

    • num From num start

    • separator by default -

fmtstr_payload_64

  • Prototype: fmtstr_payload_64(int offset, dictionary writes, int numbwritten=0, write_size='byte')
  • Same as the pwntools's fmtstr_payload , But from other ppl's hand.

IO_FILE_plus_struct

  • The extern of the default IO_FILE_Struct.
  • Supports House of Apple

Basic Functions

debug

  • Prototype: debug(IOStream io, int breakpoint)
  • Parameters:
    • io Ignorable, Will be fill by global ioStream
    • breakpoint Ignorable, Will be None by default.

get_libc_base

  • Prototype: get_libc_base(string name, int addr)
  • Parameters:
    • name The name of leaked function.
    • addr The Address of leaked function.

get_utils

  • Prototype: get_utils(string binaryPath, bool local, string ip, int port)
  • Parameters:
    • binaryPath The path of binary file.
    • local Is using remote connect or local file.
    • ip The remote host ip address.
    • port The remote host ip port.

init_env

  • Prototype: init_env(int arch, string logLevel)
  • Parameters:
    • arch The context system arch.
    • logLevel The context log level.

leak_addr

  • Prototype: leak_addr(int i)
  • Parameters:
    • i Mode.
      • Mode 0 ---- > x86
      • Mode 1 ---- > Big Endian for x64
      • Mode 2 ---- > Little Endian for x64
      • Mode 3 ---- > Directly receive 8 bytes.

libc_search

  • Prototype: libc_search(string funcName, int leakedAddr, bool onlineMode)
  • Parameters:
    • funcName The leaked function name.
    • leakedAddr The leaked function address.
    • onlineMode Decides the function if going to search online.

payload_generator

  • Prototype: payload_generator(int paddingSize, int libcBaseAddr, bool stackAligned)
  • Parameters:
    • paddingSize The size of padding.
    • libcBaseAddr The libc base address.
    • stackAligned Is the stack aligned needed.

recv_int_addr

Ret2Csu

  • Prototype: Ret2Csu(payload, r12, rdi, r14, r13, csu_front, csu_rear, syscallAddr)

  • Parameters:

    • payload: The forward Payload.
    • r12, rdi, r14, r13: Register values.
    • R12 call [r12+rbx*8]
    • RDI The first argument.
    • R14 The second argument.
    • R15 The third argument.
    • csu_front, csu_rear: Addresses for the CSU gadget.
    • syscallAddr: The address for the syscall gadget.

search_one_gadget

  • Prototype: search_one_gadget(int index)
  • Parameters:
    • index The index of one_gadget list.

search_reg_gadgets

  • Prototype: search_reg_gadgets(string reg)
  • Parameters:
    • reg The register or string.

show_addr

  • Prototype: show_addr(string msg, int addr)
  • Parameters:
    • msg The output msg.
    • addr The addr that will be print.

sym_addr

  • Prototype: sym_addr(string sym)
  • Parameters:
    • sym The target function's name. By default this function will return libcBaseAddress, system, binsh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PwnModules-1.8.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PwnModules-1.8-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file PwnModules-1.8.tar.gz.

File metadata

  • Download URL: PwnModules-1.8.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for PwnModules-1.8.tar.gz
Algorithm Hash digest
SHA256 814fb639406405dd6d33c3afe006294df6538dd1f268a08ac53c4c1ab97dd24d
MD5 72f460193104b9c51f743672e868728e
BLAKE2b-256 5a325631103f7367efa110de77fe52fe2643e2964860454ab82a69eac8afd32b

See more details on using hashes here.

File details

Details for the file PwnModules-1.8-py3-none-any.whl.

File metadata

  • Download URL: PwnModules-1.8-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for PwnModules-1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7efd691fcae78bb12466635a5b206e7767cc00bfc8b82e246f098c99af95833f
MD5 9a6940b3592b739e52e7d837bb31c86d
BLAKE2b-256 b09686a1d41803a182016982a4803c0beb6f2b8ce42da6763c179d9dae78fb83

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page