App - System

Friday 29 May 2015, 01:51  #1
ELF32 - Stack buffer overflow basic 1 & 2
Ejeden
  • 4 posts

Hi, I perform the state of the art buffer overflow and in both challenges the function pointers are properly replaced (I can see it in gdb and in 1 I get "Yeah dude ! You win !\n" displayed). However the shell doesn’t get executed for me.

Do I miss something? Again in gdb I can see a notification that a new thread was started, but system("/bin/dash") has no effect in the console and I don’t get the shell.

Any hints would be great.

Cheers

Friday 29 May 2015, 08:52  #2
ELF32 - Stack buffer overflow basic 1 & 2
L12345v
  • 2 posts

try to keep the shell ’open’.

Tuesday 2 June 2015, 00:52  #3
ELF32 - Stack buffer overflow basic 1 & 2
Ejeden
  • 4 posts

How can I do that? I tried to use popedn from python subprocess. It closes the stdin once the command is executed. I suspect that perhaps I overlooked some sh/bash parameter...

Anyway, thanks for a suggestion.

Tuesday 2 June 2015, 02:32  #4
ELF32 - Stack buffer overflow basic 1 & 2
Ejeden
  • 4 posts

How can I do that? I tried to use popedn from python subprocess. It closes the stdin once the command is executed. I suspect that perhaps I overlooked some sh/bash parameter...

Anyway, thanks for a suggestion.

UPDATE: I found a solution! Thanks!

Tuesday 2 June 2015, 12:22  #5
ELF32 - Stack buffer overflow basic 1 & 2
L12345v
  • 2 posts

well done Ejeden

Friday 5 June 2015, 17:07  #6
ELF32 - Stack buffer overflow basic 1 & 2
Santiago
  • 2 posts

any hint ? How to get dash open ?

Thursday 16 July 2015, 00:43  #7
ELF32 - Stack buffer overflow basic 1 & 2
ato
ato
  • 3 posts

how to do you keep the shell ’open’? another hint pls

Thursday 20 August 2015, 22:49  #8
ELF32 - Stack buffer overflow basic 1 & 2
mandrake
  • 2 posts

thats my problem too. in several buffer overflow challenges i overwrite the right address and a subprocess is forked, but no shell for me. ?????

Tuesday 25 August 2015, 18:59  #9
ELF32 - Stack buffer overflow basic 1 & 2
psycho4pattes
  • 2 posts

no shell for me also 🙁
any hint please.

Monday 31 August 2015, 23:50  #10
ELF32 - Stack buffer overflow basic 1 & 2
surkasu
  • 3 posts

Im having trouble keeping the shell using either gdb or Popen. Am i on the right track?

Friday 11 September 2015, 11:36  #11
ELF32 - Stack buffer overflow basic 1 & 2
sudhackar
  • 1 posts

If you are having your payload generated by [**moderated - no spoil please**]


moderated.png
moderated.png
 (PNG, 3.6 kb)
Saturday 9 January 2016, 16:45  #12
ELF32 - Stack buffer overflow basic 1 & 2
cameleon
  • 1 posts

When you succeed to execute /bin/dash , make sure that the process keep working ... ( Think of "cat" ...)

Sunday 31 January 2016, 11:14  #13
ELF32 - Stack buffer overflow basic 1 & 2

Hello, I’m stuck at the same point as others. /bin/dash get executed but I don’t get a dash prompt.

I tried to reproduce the situation on my machine (same suid context, same rights, ...) and I definitely get a prompt.

From man I can read :
system() returns after the command has been completed.

Why /bin/dash doesn’t give me a prompt and ends unexpectedly ?

Tuesday 5 April 2016, 10:33  #14
ELF32 - Stack buffer overflow basic 1 & 2
LVA
LVA
  • 1 posts

Weird bug in gdb as well: it does not accept the character "c" (yes, I’m not making this up).

app-systeme-ch13@challenge02: $ gdb
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/> .
gdb$ show opying
Undefined show command: "opying". Try "help show".

Outside gdb, it works just peachy. But, no "set-follow-fork child" now, since "hild" obviously isn’t working.

Wednesday 21 March 2018, 19:04  #15
ELF32 - Stack buffer overflow basic 1 & 2
Matrix89
  • 1 posts

Is this good or am I doing something wrong?

WARNING:root:could not open file ’/etc/apt/sources.list.d/nodesource.list’

Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.4.3 final 0
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
Exception information:

’utf-8’ codec can’t encode character ’\udc84’ in position 129: surrogates not allowed
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
callback()
File "/usr/lib/command-not-found", line 90, in main
if not cnf.advise(args[0], options.ignore_installed) and not options.no_failure_msg:
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 265, in advise
packages = self.getPackages(command)
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 157, in getPackages
result.update([(pkg, db.component) for pkg in db.lookup(command)])
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 85, in lookup
result = self.db.lookup(command)
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 41, in lookup
key = key.encode(’utf-8’)
UnicodeEncodeError: ’utf-8’ codec can’t encode character ’\udc84’ in position 129: surrogates not allowed

This happens when I try to run my ’exploit’

Saturday 12 May 2018, 09:25  #16
ELF32 - Stack buffer overflow basic 1 & 2
xxx
xxx
  • 2 posts

you should send the payload to both the program and shell