C compilation error!!

4,258 views
Skip to first unread message

adwardlee not

unread,
May 27, 2014, 8:11:29 AM5/27/14
to null-...@googlegroups.com
Hi folks,
I'm getting this freaking error..

error: ‘MAP_32BIT’ undeclared (first use in this function)

Any fix Please!!!  Expecting some quick reply..

Source code u can download from the below linkgiven below..
http://www.exploit-db.com/exploits/17787/



Thanks,
Adee

eQuiNoX

unread,
May 27, 2014, 8:55:43 AM5/27/14
to null-...@googlegroups.com
Are you running it on the proper platform i.e. x64?
Which kernel version are you on?

>
>
>
> Thanks,
> Adee
>
> --
> _______________________________________________________________________________
> null - Spreading the right Information
> null Mailing list charter:
> http://null.co.in/section/about/null_list_charter/
> ---
> You received this message because you are subscribed to the Google Groups
> "null" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to null-co-in+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

eQuiNoX

unread,
May 27, 2014, 9:00:51 AM5/27/14
to null-...@googlegroups.com
>
> error: ‘MAP_32BIT’ undeclared (first use in this function)

A second after I hit "Send", I realised that perhaps I should not have
replied to this thread.

What steps did you take on your own in trying to fix this problem? If
you are having trouble fixing this compilation error on your own, how
are you going to debug the exploit?

-- eq

adwardlee not

unread,
May 27, 2014, 3:39:09 PM5/27/14
to null-...@googlegroups.com
I tried to compile on different kernel version from 2.6 to 3.7 both in 64 and 32 bit machine as it seems to be related with the kernel related issues, yea may be i might have missed something. But couldn't fix it. I have done enough home work and tried my level best fix this issues. As i'm not a very good coder to fix this issues expecting some solution from u guys..


Naresh Annangar

unread,
May 27, 2014, 3:42:07 PM5/27/14
to null-...@googlegroups.com

Make sure you've installed the Linux headers for the kernel you are using.

adwardlee not

unread,
May 28, 2014, 1:33:21 AM5/28/14
to null-...@googlegroups.com
Hi Naresh,
What Headers you are talking about??

See as I said earlier I tried all the possible things I could, Looking for any straight forward solution?? 

@@Naresh- Have you tried to compile it?? Did it compiled really??? What header you have used to compile it???

eQuiNoX

unread,
May 28, 2014, 1:56:07 AM5/28/14
to null-...@googlegroups.com
On Wed, May 28, 2014 at 10:39 AM, adwardlee not <adward...@gmail.com> wrote:
> Hi Naresh,
> What Headers you are talking about??

`uname -a` output?

If you give more information about how you are doing it, perhaps
someone on the list can help you.

>
> See as I said earlier I tried all the possible things I could, Looking for
> any straight forward solution??
>
> @@Naresh- Have you tried to compile it?? Did it compiled really???

<troll>
Yes it compiled.
...
...
No, not really.
</troll>

What
> header you have used to compile it???

I did. It did compile.



-- eq

Naresh Annangar

unread,
May 28, 2014, 1:57:09 AM5/28/14
to null-...@googlegroups.com
 * Linux Kernel < 2.6.36.2 Econet Privilege Escalation Exploit
It clearly says in the comment that this exploit is for Kernel versions < 2.6.36.2. It was pointless trying it on 3.x line of kernels.

For kernel headers, see:

No, I haven't tried compiling it as I dont have the required kernel.

eQuiNoX

unread,
May 28, 2014, 2:05:43 AM5/28/14
to null-...@googlegroups.com
On Wed, May 28, 2014 at 11:26 AM, Naresh Annangar <n...@tulhan.in> wrote:
> * Linux Kernel < 2.6.36.2 Econet Privilege Escalation Exploit
> * Jon Oberheide <j...@oberheide.org>
> * http://jon.oberheide.org
>
> It clearly says in the comment that this exploit is for Kernel versions <
> 2.6.36.2. It was pointless trying it on 3.x line of kernels.
>
> For kernel headers, see:
> http://kernelnewbies.org/KernelHeaders
> http://askubuntu.com/questions/75709/how-do-i-install-kernel-header-files
>
> No, I haven't tried compiling it as I dont have the required kernel.

It compiles on 3.8.0 too, its just that there'd be no point running it.

-- eq

Arun K

unread,
May 28, 2014, 7:35:57 AM5/28/14
to null-...@googlegroups.com
mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1, 0);

why dont you remove that flag and compile and see...



-- eq

Arun K

unread,
May 28, 2014, 7:37:00 AM5/28/14
to null-...@googlegroups.com
error: ‘MAP_32BIT’ undeclared (first use in this function)

'MAP_32BIT' should have to be declared inside <sys/mman.h> header file(which I see it included) 
other wise declare it locally

#define MAP_32BIT 0x40
put it somewhere above with the other #define

then dont have to remove the flag 
I am you will get some other error :)



On Wed, May 28, 2014 at 4:50 PM, Arun K <ultimate...@gmail.com> wrote:
mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1, 0);

now its better

adwardlee not

unread,
May 28, 2014, 4:22:34 PM5/28/14
to null-...@googlegroups.com
Naresh@@ its a local root exploit. You have to compile it in the remote machine before uploading and running in the victim machine u compromised... So you can compile it in other version of kernel if it supports..!! Not necessarily on 2.6.32.. 

adwardlee not

unread,
May 28, 2014, 4:56:39 PM5/28/14
to null-...@googlegroups.com
Hi Arun,
That really helped, now another new error has come to the picture..

17787.c: In function ‘get_kstack’:
17787.c:232:2: error: unknown register name ‘r8’ in ‘asm’


I was getting the same error from the beginning when I tried to compile it on ubuntu machine kernel 2.6..

Again I'm telling I'm not very good coder, please do mark any of my mistake..Looking forward for the solution..

Sunil Kumar

unread,
May 28, 2014, 11:20:51 PM5/28/14
to null-...@googlegroups.com

Are you sure where you compiling is a 64bit machine?

===============
     SunilKumar
------------------------------
http://in.linkedin.com/in/sunilkr86/
http://30d4.blogspot.in/
===============

adwardlee not

unread,
May 29, 2014, 2:49:10 AM5/29/14
to null-...@googlegroups.com
Ya sunil.. As I said earlier I tried to compile it in different machine both 32 and 64 bit with different version..

Sunil Kumar

unread,
May 29, 2014, 4:14:19 AM5/29/14
to null-...@googlegroups.com

I asked because 'r*' registers are only available in 64bit, so asm should compile on 64bit. I hope any flags are not forcing to make for 32bit.

Reply all
Reply to author
Forward
0 new messages