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.10.tar.gz (16.7 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.10-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for PwnModules-1.10.tar.gz
Algorithm Hash digest
SHA256 2972f2421b2ea4f9900ff99c75a3ee825cdfd0e3257d2874f728a1a7d9265beb
MD5 3b8c9facffaa423c116b0c0389f1e780
BLAKE2b-256 84476be97021d1f44ae0f50ef96b55a098acac5da670d1db74bf5aaa6782fd27

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PwnModules-1.10-py3-none-any.whl
  • Upload date:
  • Size: 15.5 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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 e86ba0b6d0603ed0f313f8b645348c8564f65646297ecf6c42bcea6dc786deba
MD5 b469e732f2fbe27a5914705ef617727a
BLAKE2b-256 14bca310f4e1293cb6a5a9ff3a73314142359bf9a64d1f701eeb421db1d04b5e

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