Git Product home page Git Product logo

tar1000's Introduction

tar1000

This is a bash script for linux to decompress a file that has been compressed by tar 1000 times.

I made this in response to being a problem in the PicoCTF in 2019 in order to get the flag for the answer.

STATUS: The project is currently complete as a working program was developed. The reset script has also been complete meaning this project currently is 100% done, unless someone posts an issue or bug. However, going back and revising it by adding a reset script and fix the issues with the project. Will update status once those are finished.

UPDATE: All issues have been resolved in the extractor.sh, so now working on the reset.sh script.

UPDATE: Added and finished a working reset script that now works to reset the enviroment.

What Is In This Repo

Included in this repository is the Liscense document for copyright protection of this program as well as the readme. Looking further you can see that there is a folders called tar1000. The folder contains the program and the compressed file for testing. There are three files:

  • 1000.tar (the flag flie that was compressed by tar 1000 times)

  • extractor.sh (the code that when run, extracts the flag file from the compressed 1000.tar)

  • reset.sh (undoes the extraction that extractor.sh did by deleting extra files created so that are left with just the 1000.tar and extractor.sh once again)

How it Works

Essentialy, after you download the repository and read the License agreeement, just navigate to the 1000.tar folder.

NOTE: THERE IS NO SUPPORT FOR DIFFERENT DIRECTORIES! ALL PROGRAM AND 1000.tar FILES MUST BE IN THE SAME DIRECTORY!

Once in the directory ensure that the program you want to run, whether the extractor.sh or reset.sh, has the linux executable permissions. One way do enable the permissions is to run the command:

chmod +x {name of program}.sh

Note: You may need to run this as the super user which you can do by adding sudo to front of command.

Once the program is given permission to allow you to execute it you can run the program. First, run the extractor.sh by typing:

./extractor.sh

This will then extract the files from 1000.tar Once finished, you should be able to see the flag.txt file in the directory. This shows that the program worked.

To reset the situation, run the reset.sh program which will delete the filler.txt and all the tar files 999.tar to 1.tar This resets the directory back to the orginal state before you ran the extractor.sh program so you do not have to redownload it again.

tar1000's People

Contributors

savvydolphin77 avatar

Stargazers

 avatar

Watchers

 avatar

tar1000's Issues

Exits With Error

The program exists successfully with the new exit condition however, it exits with an error as seen in the picture:

image

Just Keeps Going

When running the tar program, it did not exit the while loop and kept subtracting 1 from c (the counter variable used in the program). I believe it has to do with the way the condition is set up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.