Questions tagged [pwntools]

pwntools is a CTF framework and exploit development library.

pwntools is a CTF framework and exploit development library.

77 questions
1
vote
1 answer

Installing pwntools from local repo [Solved]

I have the pwntools-dev repo cloned to my machine. Using the instructions on the pwntools installation page, I am trying to install from this local repo, but am failing. The command I am typing and the terminal output are as below david:~/Apps$ pip…
David Shaw
  • 11
  • 4
1
vote
0 answers

How to use Python pwn tools to resolve a side channel case study

I work on class exercice that involves on find a password on a remote server. The goal is to use the Python pwn library. When I access to the server with a nc IP port I have : [0000014075] Initializing the exercice... [0001678255] Looking for a …
Julien
  • 699
  • 3
  • 14
  • 30
1
vote
1 answer

Remove bytes from list of bytestrings

I have this simple code: from pwn import * e = ELF(r'/home/user/Documents/pwnexercise') print("Found hex:\n" + hex(e.symbols.main)) read_only_data = e.section('.rodata').split(b'\x00') print(read_only_data) for i in read_only_data: …
Mampenda
  • 661
  • 4
  • 21
1
vote
1 answer

Why ret2shellcode fail in ubuntu 22.04 but success in ubuntu 18.04.5

I am learning ret2shellcode, and try it in ubuntu 22.04 and kali 2022.2, and fail to get shell, but in virtualbox, I host a ubuntu 18.04.5, and same pwn script , it success, so could anyone point where is wrong? The C code is here: #include…
Ma Paul
  • 19
  • 2
1
vote
0 answers

Interact to remote console by sending text with a loop with Python/pwntools

I'm playing with an remote console that asks me to return every word it gives. For example : >>> car # Remote console gives a word car # I answer Ok next word ! # Remote console after checking >>> house # Remote console gives a second word and is…
Julien
  • 699
  • 3
  • 14
  • 30
1
vote
1 answer

how do i redirect fifo to stdin using python either with subprocess or with pwntools?

As an example I am trying to "imitate" the behaviour of the following sets of commands is bash: mkfifo named_pipe /challenge/embryoio_level103 < named_pipe & cat > named_pipe In Python I have tried the following commands: import os import…
1
vote
1 answer

pwntools: Setting context.terminal in command line tools

In pwntools, how can I set the context.terminal for command line tools, such as pwn debug. Using -c fails with error.
SRobertJames
  • 8,210
  • 14
  • 60
  • 107
1
vote
2 answers

Why does the .bss segment have no executable attribute?

I have an ELF 32-bit executable file named orw from the pwnable.tw: https://pwnable.tw/challenge/. In my Ubuntu18.04, the .bss segment can be executed: But in my Ubuntu20 and IDA Pro, the .bss segment have no executable attributes, why?
Alston
  • 79
  • 4
1
vote
1 answer

Are there any way to load another version of `libc` library into a pwntools script?

I'm trying to run an executable using pwntools using a different version of libc than the one I installed locally. Is there any way I can do that? I tried this way, but it doesn't seem to work. I will attach a picture with the script and also with…
Mocanu Gabriel
  • 490
  • 5
  • 19
1
vote
1 answer

pwntools' p32 function is weird

I'm testing on Intel x86_64, Ubuntu 64bit, Python3, Pwntools v4.3.1 $ python Python 3.7.4 (default, Aug 13 2019, 20:35:49) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> from pwn…
CPUU
  • 71
  • 2
  • 7
1
vote
1 answer

How to get the raw bytes from a hex string in python

I have the following problem in python I have the value 0x402de4a in hex and would like to convert it to bytes so I use .to_bytes(3, 'little') which gives me b'J\2d@' if I print it. I am aware that this is just a representation of the bytes but I…
nad34
  • 343
  • 4
  • 13
1
vote
2 answers

pwntools Python module doesn't work in python2 but works in python3

I have a python2 script I want to run with the pwntools python module and I tried running it using: python test.py But then I get: File "test.py", line 3, in from pwn import * ImportError: No module named pwn But when I try it with…
3h6_1
  • 13
  • 1
  • 2
  • 5
1
vote
1 answer

How to properly capture output of process using pwntools

I'm currently confused on how to use the pwntools library for python3 for exploiting programs - mainly sending the input into a vulnerable program. This is my current python script. from pwn import * def executeVuln(): vulnBin =…
1
vote
1 answer

Is there any functions in python(pwntools) that I can use to know the address of environment variable at stack?

I am trying to do a return-to-libc attack. The problem is that I need the address of an environment variable at the stack for the argument of an gadget. I tried the following code with python. But it seems that it gives an offset or something else ?…
1
vote
1 answer

Get color of terminal output / color of text returned

I am currently trying to automate a simple color reading test. I connect to the service with nc and it gives me a text in a certain color and then prompts the user to name the colored text above. This would look something like this: nc Here is…
Possi
  • 11
  • 2