title: This seems to be right everywgere But I am getting IndexError everytime at the bin_bash line. but with the puts line its running fine
body: <pre><code>#!/usr/bin/env python
  import pwn
  import re
  
  gdb_puts = 0x7ffff7a649c0
  gdb_system = 0x7ffff7a33440
  
  offset = gdb_puts - gdb_system
  
  elf = pwn.ELF('./vuln') 
  p = elf.process()
  
  prompt = p.recv()
  print prompt
  
  puts = re.findall('puts: (.*)', prompt)[0]
  bin_bash = re.findall('useful_string: (.*)', prompt)[0]
  
  print puts
  print bin_bash
  </code></pre>
  
  <p>This gives me    </p>
  
  <pre><code>Traceback (most recent call last):
    File "ape.py", line 17, in &lt;module&gt;
      bin_bash = re.findall('useful_string: (.*)', prompt)[0]
  IndexError: list index out of range
  </code></pre>