Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support x86_64 #5

Open
mingc00 opened this issue Sep 3, 2013 · 12 comments
Open

Support x86_64 #5

mingc00 opened this issue Sep 3, 2013 · 12 comments
Assignees
Labels

Comments

@mingc00
Copy link

mingc00 commented Sep 3, 2013

OS: Ubuntu 12.04.3 LTS
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

test.c

#include<stdio.h>
int main()
{
    printf("hello world\n");
    return 0;
}

Compile and run

$ gcc test.c -static
$ sudo ./taker ./a.out

I got the message:

Calling   SYS_oldolduname   (id:59  )
Calling   SYS_dup2          (id:63  )
./taker: forbidden operation
@fanzeyi
Copy link
Collaborator

fanzeyi commented Sep 3, 2013

@lx75249

@ghost ghost assigned conopt Sep 4, 2013
@Hexcles
Copy link
Owner

Hexcles commented Sep 4, 2013

Confirmed this bug.

I tried to allow "dup2" and I have another error message saying that "chdir" is forbidden, but obviously this test sample does not call chdir or anything like that.

Looks like these "forbidden" system calls are in the parent process?

@conopt
Copy link
Collaborator

conopt commented Sep 4, 2013

无法重现.. 我换个环境再试试

@Hexcles
Copy link
Owner

Hexcles commented Sep 4, 2013

Here: Archlinux x86_64

Something related to 64 bits?

2013/9/4 LX notifications@github.com

无法重现.. 我换个环境再试试


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-23789097
.

Hexcles Ma

My Blog: http://robotshell.org/

@conopt
Copy link
Collaborator

conopt commented Sep 4, 2013

system call id in x86_64 is different from that in x86...
an `autoconf' requiring system source code may be available... (or another ugly white list)

@Hexcles
Copy link
Owner

Hexcles commented Sep 4, 2013

God damn.

2013/9/4 LX notifications@github.com

system call id in x86_64 is different from that in x86...
an `autoconf' requiring system source code may be available... (or another
ugly white list)


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-23790975
.

Hexcles Ma

My Blog: http://robotshell.org/

@conopt
Copy link
Collaborator

conopt commented Sep 4, 2013

ok... I find all system call numbers in asm/unistd_xx.h .. an autoconf will be delivered soon.. say good-bye to that brute list

@Hexcles
Copy link
Owner

Hexcles commented Sep 4, 2013

@ridethepig
Copy link

ridethepig commented Aug 12, 2018

This can be fixed by just updating that list to x64 version. I have succeeded. Thank you for all this work

@gerayking
Copy link

I met the same problem,what is the final solution?

@Hexcles Hexcles changed the title Is printf forbidden? Support x86_64 Sep 4, 2020
@Hexcles
Copy link
Owner

Hexcles commented Sep 4, 2020

Nothing. The code doesn't work in x86_64; a new syscall list is needed. PRs are welcomed.

@gerayking
Copy link

OK,I solved it by remake qaq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants