Extract ARJ files in linux

0

While playing CTF competition I came across this ARJ files. After doing some research found out that.

ARJ is Archiver for .arj files and Like most archive file types, they're used to store and compress multiple files and folders into one easily manageable file.

I Want to extract this ARJ files. I have 4 files named as 36 , 18914 , 19880 , E723.

I tried this command arj e 36

It gives this error,

Can't find 36.arj
Found     1 error(s)!

So, I renamed this files as 36.arj , 18914.arj , 19880.arj , E723.arj

And tried this command arj e 36.arj

It gives this error,

Processing archive: 36.arj
Archive created: 2019-01-31 17:33:18, modified: 1970-01-01 21:54:09
Bad header

Reference

UPDATE : The CTF is finally over and I read the write up related to this question. Actually I was digging the wrong hole. The main file that was given in the question was corrupted and we had to correct the headers. And later we have to extract that file using binwalk. Again thanks to kamil and roberts

Smshrimant

Posted 2019-02-03T19:05:01.713

Reputation: 11

How about you rename (mv) the file so the name ends with .arj? – Kamil Maciorowski – 2019-02-03T19:18:28.777

1OK. Please [edit] the question and put this information about your research there, so it's all in the question body, not (partially) in comments. Also add the output of file 36.arj (or whatever the name is). – Kamil Maciorowski – 2019-02-03T19:29:05.100

2It's possible that fixing the header is a part of the task in the competition. – Kamil Maciorowski – 2019-02-03T19:42:22.577

@KamilMaciorowski Might be. Added few more details related to question. – Smshrimant – 2019-02-04T06:08:36.047

Answers

0

ARJ originally comes from windows world and there file types are determined by the filename extension. I experimented with this - created archive named 36 like this arj a 36 ./*.pdf - program automatically added arj extension so I got file 36.arj. I then tested extracting - it surely worked. However when I deleted the extension and attempted analogous command arj e ./36 it gave the error that file 36.arj was not found. As soon as I added extension back on - exact same command worked. So I am afraid if you you have to manage files with arj you need to use the extension like you would on windows.

As you can see the above step solved the missing file problem.

If there are still further problems you need to troubleshoot where the error is. E.g. you create the archive on your own computer (as I did) and see if the file is processed properly. Then you test it with other software e.g. use 7zip for windows, for example - it contains arj unpacker in it. Or the cross platform equivalent peaZip - you can easily install that on Linux as well. Inform us about the results then.

It may be that you can get some files out of the archive even if it is corrupted. If during extraction, ARJ aborts with a "Bad header" or "Bad file data" error message, then using the -jr option of ARJ, you should be able to recover the uncorrupted files in the archive. The corrupted files are unrecoverable. (This is from ARJ official website.) As a preventative, you can use the -hk option to build an error correction recovery file that will allow you to correct minor data corruption problems. (That option only is good when you are building your archives).

But for the CTF competition - it may be so you have the needed info in the few non-corrupted files.

r0berts

Posted 2019-02-03T19:05:01.713

Reputation: 1 585

The OP has stated in a comment that he tried that and got a “Bad header” error.

– Scott – 2019-02-04T04:57:25.083

This is not a downvote tag, someone has actually down-voted your question. But I think this is a valid question and you are improving your way of asking a more specific question. – r0berts – 2019-02-04T07:26:55.167

I gather since you are new, is it so that you cannot accept or upvote answers? Not that this is terribly important but just nice in terms of participation. – r0berts – 2019-02-04T15:09:54.280