Questions tagged [pwntools]

pwntools is a CTF framework and exploit development library.

pwntools is a CTF framework and exploit development library.

77 questions
0
votes
2 answers

Unable to install pwn package for python

I am trying to install the pwn library on my MacBook Air (M2, 2022) but it's failing while building the wheel for unicorn. I'm using python version 3.10.6. This is the command I'm using: python3 -m pip install --upgrade pwn without the --upgrade…
Kolliden
  • 33
  • 7
0
votes
0 answers

How to fix error message "from: can't read /var/mail/pwn"

I am practicing Buffer Overflow exploits, and I am following this website. My code looks like this: # Run the program, waits until it sees ':' (end of prompt), send our format strings, then prints # the output. The last line ensures that we don't…
Mampenda
  • 661
  • 4
  • 21
0
votes
0 answers

unsupported operand type(s) for ^: 'int' and 'str'

I am trying to decrypt a one time pad, and looking at a bunch of resourses led me to putting together this script. File "p.py", line 37, in key.append( ord(message[e])^encoded[e] ) TypeError: unsupported operand type(s) for ^: 'int' and…
I am Jakoby
  • 577
  • 4
  • 19
0
votes
1 answer

How to Pack a variable with p32() ik python?

I would like to pack a variable and also multiply it .But i can't did it properly can anyone help me to fix it from pwn import * p= process (./format2) target = "deadbeef" payload = p32("A"*64) payload +=…
0
votes
1 answer

Trying to run a buffer-overflow with Python/pwntools

I work on a online program in which I should do a buffer Overflow. When I run the program, I have to complete a sum of two numbers generated randomly) : >>> 451389913 + 1587598959 = If I put the right result, I get a "That's okay". Otherwise the…
Julien
  • 699
  • 3
  • 14
  • 30
0
votes
1 answer

Create array with ROP chain (64-bit)?

in order to solve a binary exploitation CTF-Challenge I have to create an array of arguments to pass to a syscall. I searched a lot on the internet, but I can't find a description on how to create an array of strings with a ROP-Chain on a 64-bit…
pekusbill
  • 1
  • 1
0
votes
0 answers

Why local variable addresses are different by which program started it?

I ran into a confusion about memory address issue during my experiment to practice CTF pwn questions. I tried to find the start pointer address of a local array variable to insert shellcode with Radare2. But the obtained pointer address was…
kyasbal
  • 1,132
  • 3
  • 12
  • 27
0
votes
0 answers

Use send() functions to send numbers to __isoc99_scanf("%d", &number)

I am trying to solve a pwn problem in a ctf platform. The program only uses scanf() to get index and content of a number array from standard input: for ( i = 0; i <= 3; ++i ) { puts("enter index:"); __isoc99_scanf("%d",…
Non
  • 11
  • 4
0
votes
1 answer

Is there a way to convert memory adress string to little endian input?

this thing could easily be solves by writing a function that builds the string that I want. But it would be a bit nicer, and a bit more concise if there is something that I can just import and use, it seems lik there should be. I have a python…
Grazosi
  • 603
  • 1
  • 10
0
votes
2 answers

Using pwntools to interact with executable just halts on receive

I have a c exectuable that I want to exploit. The output of that file looks like this: $ ./vuln_nostack Enter some text: enteringTEXT You entered: enteringTEXT You enter some text, and the program spits it back. I want to run this prorgam (and…
Grazosi
  • 603
  • 1
  • 10
0
votes
1 answer

Is there any way to use pwn tools to find the address of a function in an executable?

Let's say that I have a simple executable and I want to find the address of the main. Usually, I take the address from the objdump output, and then I use it in my pwn script. I want to make my script more generic without using any of the hardcoded…
Mocanu Gabriel
  • 490
  • 5
  • 19
0
votes
2 answers

pwntools: Use gdb api to interrupt a process

When running gdb cmd I can manually stop cmd via Ctrl-C. This invokes the debugger and lets me inspect memory. In pwntools, I can attach gdb, and can manually stop the process by hitting Ctrl-C in the gdb window. I'd like to be able to do this…
SRobertJames
  • 8,210
  • 14
  • 60
  • 107
0
votes
1 answer

Using pwntools process interactive mode to control python3

I am trying to use pwntools to control a python3 session. Here is my code: from pwn import process r = process(['python3']) r.interactive() However, after I enter r.interactive(), when I type into the terminal, the python3 sub-process has strange…
Eric Stdlib
  • 1,292
  • 1
  • 18
  • 32
0
votes
1 answer

No such file or directory error when attempting to attach to gdb with pwntools

I am attempting a binary exploitation challenge, but am yet to even get round to trying to exploit it as I'm having some trouble with pwntools. My code is currently very simple: from pwn import * p = process("./restaurant") gdb.attach(p) but when…
elmuscovado
  • 114
  • 3
  • 6
  • 13
0
votes
1 answer

How to send an eof to a process/server in pwntools?

I was trying to make read return 0 in a program (the one in the while loop), and then execute the second read properly, which worked perfectly by hand, with CTRL-D. However I wanted to do the same in pwntools (p = process("./test")). I have already…
BitFriends
  • 379
  • 5
  • 18