• Giving Root Execute Permission on a New Tool
  • L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t h




    Download 7,3 Mb.
    Pdf ko'rish
    bet71/125
    Sana14.05.2024
    Hajmi7,3 Mb.
    #232858
    1   ...   67   68   69   70   71   72   73   74   ...   125
    Bog'liq
    linuxbasicsforhackers

    chmod u-w hashcat.hcstat
    This command says to remove (
    -
    ) the write (
    w
    ) permission from hashcat 
    .hcstat for the user (
    u
    ).
    Now when you check the permissions with 
    ls –l
    again, you should see 
    that the hashcat.hcstat file no longer has write permission for the user:
    kali >
    ls -l
    total 32952
    drwxr-xr-x 5 root root 4096 Dec 5 10:47 charsets
    -r-xr-xr-- 1 root root 33685504 June 28 2018 hashcat.hcstat
    -rw-r--r-- 1 root root 33685504 June 28 2018 hashcat.hctune
    drwxr-xr-x 2 root root 4096 Dec 5 10:47 masks
    drwxr-xr-x 2 root root 4096 Dec 5 10:47 OpenCL
    drwxr-xr-x 3 root root 4096 Dec 5 10:47 rules
    You can also change multiple permissions with just one command. If 
    you want to give both the user and other users (not including the group) 
    execute permission, you could enter the following:
    kali >chmod u+x, o+x hashcat.hcstat
    This command tells Linux to add the execute permission for the user 
    as well as the execute permission for others for the hashcat.hcstat file.
    Giving Root Execute Permission on a New Tool
    As a hacker, you’ll often need to download new hacking tools, but Linux 
    automatically assigns all files and directories default permissions of 
    666
    and 
    777
    , respectively. This means that, by default, you won’t be able to execute a 
    file immediately after downloading it. If you try, you’ll usually get a message 
    that says something like “Permission denied.” For these cases, you’ll need to 
    give yourself root and execute permissions using 
    chmod
    in order to execute 
    the file.
    For example, say we download a new hacker tool called 
    newhackertool
    and place it into the root user’s directory (/).
    kali >
    ls -l
    total 80
    drwxr-xr-x 7 root root 4096 Dec 5 11.17 Desktop
    drwxr-xr-x 7 root root 4096 Dec 5 11.17 Documents
    drwxr-xr-x 7 root root 4096 Dec 5 11.17 Downloads
    drwxr-xr-x 7 root root 4096 Dec 5 11.17 Music
    -rw-r--r-- 1 root root 1072 Dec 5 11.17 newhackertool
    u
    drwxr-xr-x 7 root root 4096 Dec 5 11.17 Pictures


    56
    Chapter 5
    drwxr-xr-x 7 root root 4096 Dec 5 11.17 Public
    drwxr-xr-x 7 root root 4096 Dec 5 11.17 Templates
    drwxr-xr-x 7 root root 4096 Dec 5 11.17 Videos
    We can see newhackertool at 
    u
    , along with the rest of the contents of the 
    root directory. We can see that our newhackertool doesn’t have execute per-
    mission for anyone. This makes it impossible to use. It might seem strange 
    that by default, Linux won’t let you execute a file you downloaded, but over-
    all this setting makes your system more secure.
    We can give ourselves permission to execute newhackertool by entering 
    the following:
    kali >

    Download 7,3 Mb.
    1   ...   67   68   69   70   71   72   73   74   ...   125




    Download 7,3 Mb.
    Pdf ko'rish

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t h

    Download 7,3 Mb.
    Pdf ko'rish