Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

basic 6 syntax


ghost's Avatar
0 0

Picky one here. I have the 2 file names including their parent directory, and I am familiar with basic bash commands. BUT, I can't seem to get it right. I assume the challenge doesn't want arguments like '-f' for the command to remove the files. I think my problem is probably in chmod. I am using alpha characters and the file to chmod is located in /(dir_name)/logs.txt and /(dir_name)/(other_file_name).php Can someone point me in the right direction please?


j4m32's Avatar
Member
0 0

This challenge has tricky syntax no doubt, it even took me a good 30 minutes to figure out how I did it - forgot to write down my solution…

There is not an easy way to say this, it is all about "spacing" and that initialiser "$"…

Play around with it is all I can say. I'm fairly sure you know enough about the UNIX commands here, the challenge in itself is strait forward as you say it is just the syntax.

Hope that helps.

Jim,


ghost's Avatar
0 0

Got it. Thanks for the input. Turns out that it didn't like the '/' before the directory, so format for the files should be '(dir_name)/logs.txt'


ADIGA's Avatar
Member
0 0

txwooley wrote: Got it. Thanks for the input. Turns out that it didn't like the '/' before the directory, so format for the files should be '(dir_name)/logs.txt'

when using / in the start of the path it will take as in absolute path.

as an example.

lets say your in /home/user1 and you want to read /home/user1/dir2/file1.txt

its either you enter 'cat /home/user1/dir2/file1.txt' or 'cat dir2/file1.txt'

if you used 'cat /dir2/file1.txt' it will not read the '/home/user1/dir2/file1.txt' it will ignore you current location and try to open the file 'file1' in dir named 'dir2' at the base of your system.

therefore keep in mind how linux acts with relative and absolute paths when trying to run any command.


ghost's Avatar
0 0

Great info! I learned something new. Thanks for the shared wisdom.


ghost's Avatar
0 0

I am having issues with this. I am familiar with html and not much else.


GTADarkDude's Avatar
Member
0 0

erio wrote: I am having issues with this. I am familiar with html and not much else. Then the quite obvious advice would be to get familiar with other things, such as *nix commands, as the challenge so kindly suggests. ;-)


ghost's Avatar
0 0

correct. and for this challenge, you might want to also look up "chmod" in google as it is mentioned on the challenge.


ghost's Avatar
0 0

I don't mean to thread jack, but I don't want to make another thread for the same challenge.

I had all the syntax correct. I finished this challenge getting the directory name by guessing. There has to be a better way though. I was able to browse the directory after I completed the challenge, but I'm wondering if I didn't miss a step in getting the directory name.

Can anyone point me in the right direction? I don't want the answer, but a general hint so I can figure it out would be appreciated. PM is fine so it doesn't give it away to anyone else. TIA.


starofale's Avatar
Member
0 0

I'm pretty sure I just guessed the directory name. Also, from the HBH bot:

…try a obvious directory name for the files to be in Seems like guessing is what you are meant to do.


ghost's Avatar
0 0

Fair enough. Thanks for the reply.


_nephelim's Avatar
Member
0 0

I found a beginners guide since I am not familiar with *:nix >> http://vic.gedris.org/Manual-ShellIntro/1.2/ShellIntro.pdf

It said the common place for logs are in the directory "/var" I am not done this challange yet, but does this help me?

and If so, it takes away your problems for guessing the directory.


Futility's Avatar
:(
80 120

_nephelim wrote: It said the common place for logs are in the directory "/var" I am not done this challange yet, but does this help me?

This may be true, however it's not what you're looking for in this challenge. You're overthinking it. Just a quick "Hmm… I wonder what directory would hold the logs" should get you by quite nicely.

The purpose of this one is more for you to learn some Unix commands than it is finding the files.


ghost's Avatar
0 0

I think I got the chmod part right and deleting the file right, I think my problem is the directory, is it possible to better hint me towards the directory than the hint that the HBHbot gives


alphausr's Avatar
Member
0 0

is t****_l***.php generally in the same directory as logs.txt, also is that what its usually called or is it the web developers choice where files like this are stored and named?¿