I have a problem compiling the following exploit code:
http://downloads.securityfocus.com/vulnerabilities/exploits/59846-1.c
I am using "gcc file.c" and "gcc -O2 file.c", but both of them results in the following errors:
sorbolinux-exec.c: In function ‘sc’: sorbolinux-exec.c:76: error: stray ‘\302’ in program sorbolinux-exec.c:76: error: stray ‘\244’ in program sorbolinux-exec.c:76: error: ‘t’ undeclared (first use in this function) sorbolinux-exec.c:76: error: (Each undeclared identifier is reported only once sorbolinux-exec.c:76: error: for each function it appears in.)
I tried compiling them on both Kali Linux and Ubuntu 10.04 (Lucid Lynx) and got the same result.
One cause of the /(302) error is copy and paste code from a word processor. You have ASCII codes copied that add spaces, etc to your code. Go through each identified line and remove any extra spaces at the beginning and end of any identified line.
It means you have a weird character (302 is its representation) in your code. Search for Shift+space for example which is a spacenolinebreak character you might have gotten in your program by copying and pasting from the webpage or fat finger when you typed in your code.
Open the source code with an editor which is able to show special chars. Like 'vim'. Go to the line which is reported and you see the straying special char. That happens if you had opend or edited you sourcecode with an editor that enters “non breakable spaces” instead of the common whitespace.
If the error message referred to a stray \342 in the code it is most likely to have been caused by copying the code from a Web page which has Unicode characters in it.
You have an invalid character on that line. This is what I saw:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With