exploiting root
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: exploiting root

  1. #1
    Junior Member
    Join Date
    Dec 2003
    Posts
    19

    exploiting root

    Ok. So I have my computer sitting next to mine. It's a standard RedHat 9 box with standard installs set. I set up an account for me to log onto with minimal access. I do however have access to a vi editor. So I type in my source code. How do I save/run this code as a command? In other words my question is so simple most books don't have it. How do I save my script and run it? This question I realise isn't very hard, but I cant find the answer.

  2. #2
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,324
    Ensure that the file has appropriate permissions (i.e.., execute). Depending on whether it's a c program or a shell script you'll do either:

    ./scriptname

    OR

    gcc filename.c -o filename

    ./filename
    Goodbye, Mittens (1992-2008). My pillow will be cold without your purring beside my head
    Extra! Extra! Get your FREE copy of Insight Newsletter||MsMittens' HomePage

  3. #3
    Member
    Join Date
    Sep 2002
    Posts
    74
    i reccomend using something like pico, nano, or joe as a simple text editor. VI is not exactly user friendly. i think to quit wtih saving its something like :q!

  4. #4
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,324
    :q! is to save and overread existing permissions (usually used by root)

    In vi to

    - save to file you do :w

    - save and exit you do :wq

    - save, exit and override permissions :wq! (usually root)

    Check out this tutorial on using vi. I'd actually recommend getting used to using it because of the power and the fact that you can always find it on any *nix distribution (AFAIK)
    Goodbye, Mittens (1992-2008). My pillow will be cold without your purring beside my head
    Extra! Extra! Get your FREE copy of Insight Newsletter||MsMittens' HomePage

  5. #5
    Senior Member
    Join Date
    Jun 2003
    Posts
    134
    I would also suggest Nano or something. VI takes some getting used to. Like wassup said it is not the most friendly editor there is. Actually Red Hat 9 comes with pico.

    pico filename.txt
    Sysmin Sys73m47ic
    -The Hacker Pimps
    -Development Team {FuxorWRT}
    http://www.AntiOnline.com/sig.php?imageid=563

  6. #6
    Find some command lists for VI. It is an incredibly powerful text editor if you know what you are doing. Google for commands..

    -Cheers-


    PS: http://www.chem.brown.edu/instructions/vi.html

  7. #7
    Junior Member
    Join Date
    Dec 2003
    Posts
    19
    So. I open vi. I type vi script10112 for example. I use regular scripting not C or anything of the sort. Then I do esc to get back into vi command mode. Do I just type wq, press enter and then it's saved to the appropriate area. Since I do #!/bin/bash in the very beginning, it should be ready to be executed right? So I exit and save, then i type script10112 to execute? Or do I need to chmod it to executable? Thanks for putting up with me guys!

  8. #8
    Banned
    Join Date
    Jun 2002
    Posts
    289
    yes, you do have to chmod (to like 755) to make it executable

  9. #9
    Senior Member
    Join Date
    Jun 2003
    Posts
    723
    or chmod +x
    Do unto others as you would have them do unto you.
    The international ban against torturing prisoners of war does not necessarily apply to suspects detained in America\'s war on terror, Attorney General John Ashcroft told a Senate oversight committee
    -- true colors revealed, a brown shirt and jackboots

  10. #10
    Junior Member
    Join Date
    Dec 2003
    Posts
    9
    So...let's recap:

    (Type) vi [filename]
    (To edit file - press) i
    (To stop editting) ESC
    (To Save and quit) :wq!
    (In the shell, give permissions) chmod 755 [filename]
    (Assuming you had !/bin/bash, run) ./[filename]
    (If not) bash [filename]
    There are 10 kinds of people in this world: those who understand binary, and those who don\'t.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •