title: Buffer over flow exploit not working as intended
body: <p>I am writing a simple buffer overflow exploit for educational purposes in c++, the exploit code is running perfectly because when I supply the 612 "A" chars with the return address it outputs "welcome!" to gdb<br>
  and then crashes, but when i try to supply the shellcode to make a new user it simply does not work </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(){
      char buff[600];
      scanf('%s', buff);
      printf("Welcome! %s \n");
      return 0;
  }
  </code></pre>
  
  <p>this is the c++ exploit code that i wrote my self to exploit
  i found the offset to be 612 and got the return address "0x81f0e483"</p>
  
  <pre><code>EIP = struct.pack("I", 0x81f0e483)
  </code></pre>
  
  <p>when i open a cmd and type </p>
  
  <pre><code>python print ("A"*612+EIP) 
  </code></pre>
  
  <p>then pipe the output to the compiled c++ executable everything works perfectly i get "Welcome!" a couple of time then the program crashes</p>
  
  <p>now when i use a any shellcode from <a href="http://shell-storm.org/shellcode/files/shellcode-874.php" rel="nofollow noreferrer">http://shell-storm.org/shellcode/files/shellcode-874.php</a>
  for windows machines for example :"Add Admin User Shellcode (194 bytes)"
  i get an error or the program just crashes</p>
  
  <p>to clarify my buffer is 612 and the shellcode is 194 i am left with 418 bytes 200 bytes for the nope slide and 100 for the padding i am left with 18 bytes for the return address 
  the output is (padding +nope_slide +shellcode +EIP)
  the output gets piped to the vulnerable c++ executeable but i do not get a new user
  and i tried making custom shellcodes with msfvenom but was not lucky got the same result  </p>
  
  <p>what am i doing wrong </p>