Compilation error: stray ‘\302’ in program etc

后端 未结 13 2104
眼角桃花
眼角桃花 2020-12-01 14:03

I am having problem compiling the followed exploit code:

http://downloads.securityfocus.com/vulnerabilities/exploits/59846-1.c

I am using: \"gcc file.c\" and

相关标签:
13条回答
  • 2020-12-01 14:34

    Change the name of the file.c to some other file423.c. it may be because of the name conflict between c files.

    0 讨论(0)
  • 2020-12-01 14:36

    Codo was exactly right on Oct. 5 that &current[i] is the intended text (with the currency symbol inadvertently introduced when the source was put into HTML (see original): http://downloads.securityfocus.com/vulnerabilities/exploits/59846-1.c

    Codo's change makes this exploit code compile without error. I did that and was able to use the exploit on Ubuntu 12.04 to escalate to root privilege.

    0 讨论(0)
  • 2020-12-01 14:37

    It's perhaps because you copied code from net ( from a site which has perhaps not an ASCII encoded page, but UTF-8 encoded page), so you can convert the code to ASCII from this site :

    "http://www.percederberg.net/tools/text_converter.html"

    There you can either detect errors manually by converting it back to UTF-8, or you can automatically convert it to ASCII and remove all the stray characters.

    0 讨论(0)
  • 2020-12-01 14:39

    The explanations given here are correct. I just wanted to add that this problem might be because you copied the code from somewhere, from a website or a pdf file due to which there are some invalid characters in the code.

    Try to find those invalid characters, or just retype the code if you can't. It will definitely compile then.

    Source: stray error reason

    0 讨论(0)
  • 2020-12-01 14:40

    This problem comes when you have copied some text from html or you have done modification in windows environment and trying to compile in Unix/Solaris environment.

    Please do "dos2unix" to remove the special characters from the file:

    dos2unix fileName.ext fileName.ext

    0 讨论(0)
  • 2020-12-01 14:40

    Invalid character on your code. A common copy paste error specially when code is copied from Word Documents or PDF files.

    0 讨论(0)
提交回复
热议问题