LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Trouble compiling a .tgz with GCC compiler (https://www.linuxquestions.org/questions/linux-software-2/trouble-compiling-a-tgz-with-gcc-compiler-4175496471/)

Venet 02-27-2014 07:09 PM

Trouble compiling a .tgz with GCC compiler
 
Hello, I've been following the instructions to install a program.

So far, I've did everything but i eventually get stuck on when i have to compile the program 'stress' with the GCC compiler. I also updated to the latest compiler. I'm logged in as root.


When I insert either of the 2 below into Debian GNU(debian-7.0-x86) - I get the following errors;

Code:

gcc: error: stress.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.


The above 2 errors appear when i insert either one of the below;

Code:

gcc -Wall -c stress.c
gcc -pthread -o stress stress.o


If anyone can assist me with this problem further, contact me on skype via; @ eminem2ka9


Thank you =]

notKlaatu 02-27-2014 09:52 PM

The error says there's no such file or directory. This leads me to believe that you may have attempted to run gcc against a file or directory that does not exist in your current location.

From what directory (provide full path please) are you attempting to execute the command?

And also, why are you using gcc directly? does `stress` not come with a Makefile or some kind of inbuilt build system?

Emerson 02-27-2014 09:53 PM

Furthermore, there is Debian package stress. Why are you trying to build it by hand?

szboardstretcher 02-27-2014 09:55 PM

show me the output of:

Code:

ls
pwd

And I'll show you files not existing, or permission issues.

Firerat 02-27-2014 10:25 PM

Quote:

Originally Posted by Venet (Post 5126142)
Hello, I've been following the instructions to install a program.

Would be a good idea to provide a link to those instructions.
We will get a better picture of what it is you are trying to achieve.

Venet 02-28-2014 12:34 PM

Quote:

Originally Posted by szboardstretcher (Post 5126241)
show me the output of:

Code:

ls
pwd

And I'll show you files not existing, or permission issues.

Output of 'ls'; http://prntscr.com/2wn5c0
Output of 'pwd'; root/sockstress (Though now I'm pretty sure I used 'make' which was built in, so no need for the compiler now?

Instructions are here; http://samsclass.info/123/proj10/sockstress.htm

OR; https://defuse.ca/sockstress.htm

I tried to insert a command, but; http://prntscr.com/2wn9ku

I used 'sudo' before the command, and the abort never appeared then, but still everything above it did.

szboardstretcher 02-28-2014 12:49 PM

Look at your directory listing more closely, and youll see that there is no sockstress.c to compile. it looks like a binary called 'sockstress' already.

Ie: You cant use gcc to compile something that is already compiled.

Just run './sockstress'

Venet 02-28-2014 12:58 PM

Quote:

Originally Posted by szboardstretcher (Post 5126618)
Look at your directory listing more closely, and youll see that there is no sockstress.c to compile. it looks like a binary called 'sockstress' already.

Ie: You cant use gcc to compile something that is already compiled.

Just run './sockstress'

I've already tried to run ./sockstress = http://prntscr.com/2wnir3

notKlaatu 03-01-2014 01:02 AM

What Linux system are you using? I'm assuming you're ssh'd in to something.

Sockstress compiles and runs fine for me. What copy of the source code did you download? your source folder looks nothing like what I see. Go to the github link and download a copy of the latest version, then perform a `make` and then run it.

Venet 03-01-2014 11:09 AM

Quote:

Originally Posted by notKlaatu (Post 5126865)
What Linux system are you using? I'm assuming you're ssh'd in to something.

Sockstress compiles and runs fine for me. What copy of the source code did you download? your source folder looks nothing like what I see. Go to the github link and download a copy of the latest version, then perform a `make` and then run it.

I've tried this on ubuntu, and debian. You have centos?

And yes, I'm using SSH connection(putty). I downloaded the source just now(github) - the same thing occurs.

1) I typed "wget https://github.com/defuse/sockstress/archive/master.zip"
2) Then i typed "cd sockstress"
3) Then i typed "make" - http://prntscr.com/2wx9e4
4) But If i typed "./sockstress", I'd only get an "buffer overflow detected - ./sockstress terminated" - http://prntscr.com/2wxamp

notKlaatu 03-02-2014 12:24 AM

Quote:

Originally Posted by Venet (Post 5127028)
1) I typed "wget https://github.com/defuse/sockstress/archive/master.zip"
2) Then i typed "cd sockstress"
3) Then i typed "make" - http://prntscr.com/2wx9e4
4) But If i typed "./sockstress", I'd only get an "buffer overflow detected - ./sockstress terminated" -

If that is literally what you did, you have done something wrong.

1. wget command looks ok

But you did not unzip the archive you downloaded, according to you. Here's what I would do :

mkdir ~/src
wget blahblah/master.zip
unzip *.zip -d ~/src (that unzips the master.zip file into the src directory)
cd ~/src
ls (just to make sure you see the files you need)
pwd (to make sure you're where you think you are)
make
./sockstress

notKlaatu 03-02-2014 12:27 AM

I should also add, and I do not mean this in a pedantic way, that you ought to consider using Linux more often, as your primary OS. To get really good at the stuff you are doing in that course, knowing Linux would be invaluable and it would make all those commands and the logic of those commands make a lot more sense. I know using Linux is frustrating if you're really good on Windows, as you probably are, but after the initial learning curve, you have so much at your disposal. An t's free, after all, so the only real investment is the learning part. But it looks like you're ok with learning new stuff, since you're taking that course.

Just my thoughts. Again, not attempting to patronize you.

Venet 03-02-2014 12:15 PM

Okay Everything looks grand! Thank you man =]

You're helpfulness is most appreciated by me.

I'm using this to test on my hosted website for vulnerabilities test purposes, so which command would be most effective?

notKlaatu 03-02-2014 02:06 PM

I wasn't thinking of one command in particular; just saying that 1) if you know your way around a unix shell, then 2) testing for vulns is easier because you know your way around a unix shell, and 3) the way to learn your way around a shell is to use a shell, ergo 4) use unix often.

Anyway, glad it worked for you! If you go to the top of this thread > Thread Tools > Mark Thread as Solved, that'll close this thread. Also, if you found my advice helpful, mark 'yes' to "did you find this response helpful?"

Good luck, mate!

Venet 03-02-2014 03:47 PM

Right, voted and 1 more thing;

Do you know how to add payload?


All times are GMT -5. The time now is 02:52 PM.