-->

ABOUT US

Our development agency is committed to providing you the best service.

OUR TEAM

The awesome people behind our brand ... and their life motto.

  • Kumar Atul Jaiswal

    Ethical Hacker

    Hacking is a Speed of Innovation And Technology with Romance.

  • Kumar Atul Jaiswal

    CEO Of Hacking Truth

    Loopholes are every major Security,Just need to Understand it well.

  • Kumar Atul Jaiswal

    Web Developer

    Techonology is the best way to Change Everything, like Mindset Goal.

OUR SKILLS

We pride ourselves with strong, flexible and top notch skills.

Marketing

Development 90%
Design 80%
Marketing 70%

Websites

Development 90%
Design 80%
Marketing 70%

PR

Development 90%
Design 80%
Marketing 70%

ACHIEVEMENTS

We help our clients integrate, analyze, and use their data to improve their business.

150

GREAT PROJECTS

300

HAPPY CLIENTS

650

COFFEES DRUNK

1568

FACEBOOK LIKES

STRATEGY & CREATIVITY

Phasellus iaculis dolor nec urna nullam. Vivamus mattis blandit porttitor nullam.

PORTFOLIO

We pride ourselves on bringing a fresh perspective and effective marketing to each project.

Showing posts with label kali linux. Show all posts
Showing posts with label kali linux. Show all posts
  • HACK Your Offensive Security Side


    HACK Your Offensive Security Side

     

    HACK Your Offensive Security Side


    In short, offensive security is the process of breaking into computer systems, exploiting software bugs, and finding loopholes in applications to gain unauthorized access to them.


    To beat a hacker, you need to behave like a hacker, finding vulnerabilities and recommending patches before a cybercriminal does.

    On the flip side, there is also defensive security, which is the process of protecting an organization's network and computer systems by analyzing and securing any potential digital threats; learn more in the digital forensics room.

    In a defensive cyber role, you could be investigating infected computers or devices to understand how it was hacked, tracking down cybercriminals, or monitoring infrastructure for malicious activity.


    Practical


    First of for your kind information all kinds of things which is used here all exercises are fake simulations so don't panic and don't go dark side okay!!.


    Find hidden website pages



    Most companies will have an admin portal page, giving their staff access to basic admin controls for day-to-day operations. For a bank, an employee might need to transfer money to and from client accounts. Often these pages are not made private, allowing attackers to find hidden pages that show, or give access to, admin controls or sensitive data.


    HACK Your Offensive Security Side



    Type the following command into the terminal to find potentially hidden pages on FakeBank's website using GoBuster (a command-line security application).


    gobuster -u http://420fakebank.co.uk -w wordlist.txt dir




    HACK Your Offensive Security Side





    In the command above, -u is used to state the website we're scanning, -w takes a list of words to iterate through to find hidden pages.

    You will see that GoBuster scans the website with each word in the list, finding pages that exist on the site. GoBuster will have told you the pages it found in the list of page /directory names (indicated by Status: 200).




    Hack the bank


    You should have found a secret bank transfer page that allows you to transfer money between accounts at the bank (/bank-transfer). Type the hidden page into the FakeBank website on the machine.

     

     

    HACK Your Offensive Security Side
     



    This page allows an attacker to steal money from any bank account, which is a critical risk for the bank. As an ethical hacker, you would (with permission) find vulnerabilities in their application and report them to the bank to fix before a hacker exploits them.

     

     

    HACK Your Offensive Security Side

     

     


    Transfer $2000 from the bank account 2276, to your account (account number 8881).




    HACK Your Offensive Security Side



    How can I start learning?


    People often wonder how others become hackers (security consultants) or defenders (security analysts fighting cybercrime), and the answer is simple. Break it down, learn an area of cyber security you're interested in, and regularly practice using hands-on exercises. Build a habit of learning a little bit each day on differnt types of website, and you'll acquire the knowledge to get your first job in the industry.



    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.


     

  • chattr Command with Permissions and Attributes on Linux


     

    chattr Command with Permissions and Attributes on Linux

     

     

    Apart from usual read, write, and execute file permissions, Linux documents (files) have another set of attribute that control other characteristics of the file.


    Permissions and Attributes


    In Linux, who can access a file and what they can do with it is controlled by a user-centric set of permissions. Whether you can read the contents of a file, write new data into the file, or execute a file if it is a script or a program, is all governed by that set of permissions. The permissions are applied to the file, but they define the restrictions and capabilities for different categories of user.

    There are permissions for the owner of the file, for the group of the file, and for others—that is, users who are not in the first two categories. You can use the ls command with the -l (long listing) option to see the permissions on a file or directory.

    We can see that file permissions are user-centeric because they have choices to remove permissions at the user level. By contrast, the attributes of a file system centric. Like persmissions, they're set on the file or directory. But once they're set, they're the same for all users.

    Attrbiutes are a separate collection of settings from permissions. Attributes control characteristics such as immutability and other file system-level behaviors. To see the attributes of a file or directory we use the lsattr command. To set the attributes we use the chattr command.


    Inode File system 


    Permissions and attributes are stored inside inodes. An inode is a file system structure that holds information about file system objects such as files and directories. A file’s location on the hard drive, its creation date, its permissions, and its attributes are all stored within its inode.

    Because different file systems have different underlying structures and capabilities, attributes can behave differently—or be completely ignored—by some file systems. In this article, we’re using ext4 which is the default file system for many Linux distributions.



    Looking at a File’s Attributes


    The chattr and lsattr commands will already be present on your computer so there’s no need to install anything.

    To check the attributes on the files in the current directory, use lsattr:

    lsattr



    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ lsattr 
    --------------e------- ./f.txt
    --------------e------- ./a.txt
    --------------e------- ./e.txt
    --------------e------- ./g.txt
    --------------e------- ./b.txt
    --------------e------- ./atul.txt
    --------------e------- ./hackingtruth.txt
    --------------e------- ./c.txt
    --------------e------- ./d.txt
    --------------e------- ./atulkumar.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ 
     
     
     


     

     The dashed lines are placeholders for attributes that are not set. The only attribute that is set is the e (extents) attribute. This shows that the file system inodes are using—or will use if required—extents to point to all portions of the file on the hard drive.


    If the file is held in one contiguous sequence of hard drive blocks, its inode only has to record the first and last blocks used to store the file. If the file is fragmented, the inode has to record the number of the first and last block of each piece of the file. These pairs of hard drive block numbers are called extents.



    This is the list of the most commonly used attributes.


    a: Append only. A file with this attribute can only be appended to. It can still be written to, but only at the end of the file. It is not possible to overwrite any of the existing data within the file.


    c: Compressed. The file is automatically compressed on the hard drive and uncompressed when it is read. Data written to the files is compressed before it is written to the hard drive.


    A: No atime updates. The atime is a value in an inode that records the last time a file was accessed.


    C: No copy-on-write. If two processes request access to a file, they can be given pointers to the same file. They are only given their own unique copy of the file if they try to write to the file, making it unique to that process.


    d: No dump. The Linux dump command is used to write copies of entire file systems to backup media. This attribute makes dump ignore the file. It is excluded from the backup.


    D: Synchronous directory updates. When this attribute is turned on for a directory, all changes to that directory are written synchronously—that is, immediately—on the hard drive. Data operations can be buffered.


    e: Extent format. The e attribute indicates that the file system is using extents to map the location of the file on the hard drive. You cannot change this with chattr. It is a function of the operation of the file system.


    i: Immutable. An immutable file cannot be modified, including renaming and deleting. The root user is the only person who can set or unset this attribute.


    s: Secure deletion. When a file with this attribute set is deleted, the hard drive blocks that held the file data are overwritten with bytes containing zeroes. Note that this is not honored by the ext4 file system.


    S: Synchronous updates. Changes to a file with its S attribute set are written to the file synchronously.


    u: Deleting a file that has its u attribute set causes a copy of the file to be made. This can be beneficial to file recovery if the file was removed in error.




    Changing a File’s Attributes



    The chattr command lets us change the attributes of a file or directory. We can use the + (set) and - (unset) operators to apply or remove an attribute, similar to the chmod command and permissions.

    The chattr command also has an = (set only) operator. This sets the attributes of a file or directory to only the attributes that are specified in the command. That is, all attributes not listed on the command line are unset.



    Setting the Append Only Attribute



    If you want use a: append attributes then if you want to change the overwrite the file and add something, but it is not possible because A file with this attribute can only be appended to. It can still be written to, but only at the end of the file. It is not possible to overwrite any of the existing data within the file.






    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ echo "Qm9iIC0gIVBAJCRXMHJEITEyMw== | base64 -d" > atul.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ cat atul.txt      
    Qm9iIC0gIVBAJCRXMHJEITEyMw== | base64 -d
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ 
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ sudo chattr +a atul.txt                                   
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ lsattr
    --------------e------- ./f.txt
    --------------e------- ./a.txt
    --------------e------- ./e.txt
    --------------e------- ./g.txt
    --------------e------- ./b.txt
    -----a--------e------- ./atul.txt
    --------------e------- ./hackingtruth.txt
    --------------e------- ./c.txt
    --------------e------- ./d.txt
    --------------e------- ./atulkumar.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ echo "Qm" > atul.txt 
    zsh: operation not permitted: atul.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$               
    
    
    
    
    

     

    We’ll redirect the output from ls into the file:

    ls -l > text-file.txt

    sudo ls -l > text-file.txt



    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ lsattr atul.txt
    -----a--------e------- atul.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ ls -la > atul.txt 
    zsh: operation not permitted: atul.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ sudo ls -la > atul.txt                                                                                                                              1 ⨯
    zsh: operation not permitted: atul.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$                                                                                                                                                     1 ⨯
    
    
    
    






    The operation is not permitted, even if we use the sudo command.

    If we use two angle brackets  “>>” to redirect output it is appended to the existing data in the file. That should be acceptable to our append-only text file.

    sudo ls -l >> text-file.txt


    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ lsattr atul.txt     
    -----a--------e------- atul.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ cat  atul.txt 
    Qm9iIC0gIVBAJCRXMHJEITEyMw== | base64 -d
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ sudo ls -l >> atul.txt 
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ cat  atul.txt
    Qm9iIC0gIVBAJCRXMHJEITEyMw== | base64 -d
    total 8
    -rwxrwxrwx 1 root      1006  0 May  2 08:57 atulkumar.txt
    -rw-r--r-- 1 hackerboy root 41 May  3 12:59 atul.txt
    -rwxrwxrwx 1 hackerboy root  0 May  2 08:56 a.txt
    -rwxrwxrwx 1 hackerboy root  0 May  2 08:56 b.txt
    -rwxrwxrwx 1 hackerboy root 40 May  3 13:01 c.txt
    -rwxrwxrwx 1 hackerboy root  0 May  2 08:56 d.txt
    -rwxrwxrwx 1 hackerboy root  0 May  2 08:56 e.txt
    -rwxrwxrwx 1 hackerboy root  0 May  2 08:56 f.txt
    -rwxrwxrwx 1 hackerboy root  0 May  2 08:56 g.txt
    -rwxrwxrwx 1 root      1006  0 May  2 08:57 hackingtruth.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ 
    
    
    
    






    Although we can append data to the file, that is the only change we can make to it. We can’t delete it and neither can root.

    rm text-file.txt

    sudo rm text-file.txt





    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ lsattr atul.txt       
    -----a--------e------- atul.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ rm atul.txt         
    rm: cannot remove 'atul.txt': Operation not permitted
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ sudo rm atul.txt                                                                                                                                    1 ⨯
    rm: cannot remove 'atul.txt': Operation not permitted
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$                                                                                                                                                     1 ⨯
    
    
    
    






    Don’t Rely on Secure Deletion on ext4



    As we pointed out, some operating systems do not support all of the attributes. The secure delete attribute is not honored by the ext family of file systems, including ext4. Don’t rely on this for the secure deletion of files.

    It’s easy to see that this doesn’t work in ext4. We’ll set the s (secure deletion) attribute on a text file.



    sudo chattr +s atul.txt


    s: Secure deletion. When a file with this attribute set is deleted, the hard drive blocks that held the file data are overwritten with bytes containing zeroes. Note that this is not honored by the ext4 file system.


    What we’re going to do is find out the inode that holds the metadata about this file. The inode holds the first hard drive block occupied by the file. The file contains some lorem ipsum placeholder text.
    Advertisement

    We’ll read that block directly from the hard drive to verify we’re reading the correct hard drive location. We’ll delete the file and then read that same hard dive block once more. If the secure deletion attribute is being honored, we should read zeroed bytes.

    We can find the inode of the file by using the hdparm command with the --fibmap (file block map) option.

    sudo hdparm --fibmap third-file.txt




    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ lsattr atul.txt          
    -----a--------e------- atul.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ chattr +s atul.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ lsattr atul.txt   
    s----a--------e------- atul.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ 
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ sudo hdparm --fibmap  atul.txt
    
    atul.txt:
     filesystem blocksize 4096, begins at LBA 872241152; assuming 512 byte sectors.
     byte_offset  begin_LBA    end_LBA    sectors
               0  931425384  931425391          8
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ 
    




    The first hard drive block is 18100656. We’ll use the dd command to read it.

    The options are:
     

    • if=/dev/sda: Read from the first hard drive on this computer. 
    • bs=512: Use a hard drive block size of 512 bytes.
    • skip=18100656: Skip all blocks before block 18100656. In other words, start reading at block 18100656.
    • count=1: Read one block of data.


     

    sudo dd if=/dev/sda bs=512 skip=18100656 count=1


    As expected we see the lorem ipsum placeholder text. We’re reading the correct block on the hard drive.


    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ sudo dd if=/dev/sda bs=512 skip=931425384 count=1
    Qm9iIC0gIVBAJCRXMHJEITEyMw== | base64 -d
    total 8
    -rwxrwxrwx 1 root      1006  0 May  2 08:57 atulkumar.txt
    -rw-r--r-- 1 hackerboy root 41 May  3 12:59 atul.txt
    -rwxrwxrwx 1 hackerboy root  0 May  2 08:56 a.txt
    -rwxrwxrwx 1 hackerboy root  0 May  2 08:56 b.txt
    -rwxrwxrwx 1 hackerboy root 40 May  3 13:01 c.txt
    -rwxrwxrwx 1 hackerboy root  0 May  2 08:56 d.txt
    -rwxrwxrwx 1 hackerboy root  0 May  2 08:56 e.txt
    -rwxrwxrwx 1 hackerboy root  0 May  2 08:56 f.txt
    -rwxrwxrwx 1 hackerboy root  0 May  2 08:56 g.txt
    -r1+0 records in
    1+0 records out
    512 bytes copied, 0.0237929 s, 21.5 kB/s
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ 
                      
    



    Now we’ll delete the file.

    rm third-file.txt



    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ lsattr atul.txt
                                                                                                                                       1 ⨯
    s--------------------- atul.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ 
    
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$ rm atul.txt
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/hackingtruth.org]
    └─$                        
    
    
    
    
    

    Again, don’t depend on this for secure deletion on ext4.There are better methods available to delete files so that they can’t be recovered.




    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.


  • How to display a ASCII message after SSH login on linux

     

     

    How to display a ASCII message after SSH login on linux

     

     

    Display a ASCII Message After SSH Login

     

    Sometimes when you want to provide remote access to your system via SSH, you want to display a customized message on the terminal for the remotely logged-in user. In this tutorial, I will show you how to display a custom ASCII text and text message upon SSH login to your Linux server.



    Requirement

     

    You need to have installed SSH



    Let's Displaying a Message

     

    For displaying a ASCII text or normal text in linux or any other distro ,you will to perform the following steps:


    Step 1 :- First you need to open a MOTD or create a file on your system with the COMMAND shown below.



    ┌──(hackerboy㉿KumarAtulJaiswal)-[~]
    └─$ sudo nano /etc/motd
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~]
    └─$
    
    


    How to display a ASCII message after SSH login on linux




    and once this file is created or open (as you can see i have already this file in our linux system ), you can type in any messages or ASCII text as of your choice just like we did. After that, you can save this file and exit.


    ASCII Creator - CLICK HERE



    How to display a ASCII message after SSH login on linux




    Step 2 :- Check your system IP

    Step 3 :- Log into your machine through SSH to Display the message.


    You need to log into your machine through SSH by executing the following command. You can either run this command on your own machine’s terminal or you can even use any other machine on the same network for serving the very same purpose.




    ┌──(hackerboy㉿KumarAtulJaiswal)-[~]
    └─$ sudo su
    KumarAtulJaiswal# ssh hackerboy@192.168.43.152
    hackerboy@192.168.43.152's password: 
    Linux KumarAtulJaiswal 5.10.0-kali8-amd64 #1 SMP Debian 5.10.40-1kali1 (2021-05-31) x86_64
    
    The programs included with the Kali GNU/Linux system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.
    
    Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
    permitted by applicable law.
    
    WELCOME  TO
    ██   ██  █████   ██████ ██   ██ ██ ███    ██  ██████      ████████ ██████  ██    ██ ████████ ██   ██ 
    ██   ██ ██   ██ ██      ██  ██  ██ ████   ██ ██              ██    ██   ██ ██    ██    ██    ██   ██ 
    ███████ ███████ ██      █████   ██ ██ ██  ██ ██   ███        ██    ██████  ██    ██    ██    ███████ 
    ██   ██ ██   ██ ██      ██  ██  ██ ██  ██ ██ ██    ██        ██    ██   ██ ██    ██    ██    ██   ██ 
    ██   ██ ██   ██  ██████ ██   ██ ██ ██   ████  ██████         ██    ██   ██  ██████     ██    ██   ██ 
                                                                                     www.hackingtruth.in 
    
    
    
                                                                                                         
    You have new mail.
    Last login: Sun Jul 11 20:07:56 2021 from 192.168.43.152
    ┏━(Message from Kali developers)
    ┃
    ┃ This is a minimal installation of Kali Linux, you likely
    ┃ want to install supplementary tools. Learn how:
    ┃ ⇒ https://www.kali.org/docs/troubleshooting/common-minimum-setup/
    ┃
    ┃ We have kept /usr/bin/python pointing to Python 2 for backwards
    ┃ compatibility. Learn how to change this and avoid this message:
    ┃ ⇒ https://www.kali.org/docs/general-use/python3-transition/
    ┃
    ┗━(Run: “touch ~/.hushlogin” to hide this message)
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~]
    └─$ 
    
    


    How to display a ASCII message after SSH login on linux




    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.



      - Hacking Truth by Kumar Atul Jaiswal


  • visual studio code install in linux version 2021.2


    visual studio code install in linux version 2021.2


    VSCode a.k.a


    In this short tutorial shows how to install Visual Studio Code on Linux and the new version of kali linux 2021.2 version have alread installed visual studio code on that linux. visual studio code install in linux version 2021.2

    Visual Studio Code is one of top IDEs for Python.

    Visual Studio Code is an open source IDE developed by Microsoft which is available for Linux. It offers many interesting features like:


        Syntax highlight
        Code completion
        Version control
        IntelliSense
        marketplace
        Developer Community

     


    Install Visual Studio Code


    VSCode a.k.a. Visual Studio Code Open Source (“Code-OSS”) - Code editor

    VSCode have been included into the kali-linux-large metapackage, so they are included on the installer image for people doing a fresh install. Otherwise you will need to upgrade Kali (if you already have the kali-linux-large install) or manually install them (if you want them!):

     

    sudo apt update && sudo apt install -y code-oss
     

     

     

    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop]
    └─$ sudo apt update && sudo apt install -y code-oss
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop]
    └─$ 
    

     

     

     

     

    ┌──(hackerboy㉿KumarAtulJaiswal)-[~]
    └─$ sudo apt-get install code-oss
    [sudo] password for hackerboy: 
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      autopoint debugedit dh-autoreconf dh-strip-nondeterminism dwz kbuild libarchive-cpio-perl libdebhelper-perl
      libfile-stripnondeterminism-perl libmail-sendmail-perl librpmbuild9 librpmsign9 libsub-override-perl libsys-hostname-long-perl
      linux-headers-5.9.0-kali5-amd64 linux-headers-5.9.0-kali5-common linux-image-5.9.0-kali5-amd64 linux-kbuild-5.9
      python3-distro-info python3-software-properties rpm unattended-upgrades
    Use 'sudo apt autoremove' to remove them.
    The following additional packages will be installed:
      libjs-highlight.js libnode72 nodejs nodejs-doc
    Suggested packages:
      npm
    The following NEW packages will be installed:
      code-oss libjs-highlight.js libnode72 nodejs nodejs-doc
    0 upgraded, 5 newly installed, 0 to remove and 3 not upgraded.
    Need to get 85.9 MB of archives.
    After this operation, 321 MB of additional disk space will be used.
    Do you want to continue? [Y/n] Y
    Get:1 http://ftp.harukasan.org/kali kali-rolling/main amd64 libnode72 amd64 12.21.0~dfsg-3 [8,382 kB]
    Get:2 http://ftp.harukasan.org/kali kali-rolling/main amd64 nodejs amd64 12.21.0~dfsg-3 [146 kB]                                     
    Get:3 http://ftp.harukasan.org/kali kali-rolling/main amd64 code-oss amd64 1.56.1-0kali2 [74.4 MB]                                   
    Get:4 http://ftp.harukasan.org/kali kali-rolling/main amd64 libjs-highlight.js all 9.18.5+dfsg1-1 [397 kB]                           
    Get:5 http://ftp.harukasan.org/kali kali-rolling/main amd64 nodejs-doc all 12.21.0~dfsg-3 [2,538 kB]                                 
    Fetched 85.9 MB in 7min 47s (184 kB/s)                                                                                               
    Selecting previously unselected package libnode72:amd64.
    (Reading database ... 416536 files and directories currently installed.)
    Preparing to unpack .../libnode72_12.21.0~dfsg-3_amd64.deb ...
    Unpacking libnode72:amd64 (12.21.0~dfsg-3) ...
    Selecting previously unselected package nodejs.
    Preparing to unpack .../nodejs_12.21.0~dfsg-3_amd64.deb ...
    Unpacking nodejs (12.21.0~dfsg-3) ...
    Selecting previously unselected package code-oss.
    Preparing to unpack .../code-oss_1.56.1-0kali2_amd64.deb ...
    Unpacking code-oss (1.56.1-0kali2) ...
    Selecting previously unselected package libjs-highlight.js.
    Preparing to unpack .../libjs-highlight.js_9.18.5+dfsg1-1_all.deb ...
    Unpacking libjs-highlight.js (9.18.5+dfsg1-1) ...
    Selecting previously unselected package nodejs-doc.
    Preparing to unpack .../nodejs-doc_12.21.0~dfsg-3_all.deb ...
    Unpacking nodejs-doc (12.21.0~dfsg-3) ...
    Setting up libnode72:amd64 (12.21.0~dfsg-3) ...
    Setting up libjs-highlight.js (9.18.5+dfsg1-1) ...
    Setting up nodejs (12.21.0~dfsg-3) ...
    update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
    Setting up nodejs-doc (12.21.0~dfsg-3) ...
    Setting up code-oss (1.56.1-0kali2) ...
    Processing triggers for doc-base (0.11.1) ...
    Processing 1 added doc-base file...
    Processing triggers for libc-bin (2.31-12) ...
    Processing triggers for man-db (2.9.4-2) ...
    Processing triggers for shared-mime-info (2.0-1) ...
    Processing triggers for mailcap (3.69) ...
    Processing triggers for kali-menu (2021.2.3) ...
    Processing triggers for desktop-file-utils (0.26-1) ...
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~]
    └─$ 
    

     

     

     

     

    For open visual studio code, it is simple, simply type vscode in terminal and hit enter but here is a problem if you exit the terminal your VS code will be terminated but how do fixed it!!! 

     





     

     

    How to set VS code in Panel 


    So now we will see some steps, with the help of which we will be able to set up VS Code in the Linux panel. 


    Step 1 - Open panel preferences






    Step 2 - add some launcher so click on add button

     

     


     

     

     

    Step 3 - select launcher and add it..






     

     

    Step 5 - As you can see the launcher has been created


     

     


     

     

     

    Step 6 - Double click on the launcher, after that a box will open next to you, in which you have to click on the plus icon.






     

     

    Step 7 -Then we find a VS code installation file, so simple type "locate vscode" and as you can see /home/hackerboy/.vscode file, copy this (There may be a different directory in your case). NOTE - this is optional. 

     


     




     

     

    Step 8 - Then, add Name, command and working directory and add icon


    Name - visual studio code ( you can change )

    Command - vscode (not change)

    Working Directory - /home/hackerboy/.vscode (There may be a different directory in your case).

    Icon - Click Here 

     

    Create.

     


     


     



     

    Step 9 - You can easily open it whenever you want 







     

    Customization 


    Before running the program in Visual Code, we will do some setting which will help you a lot in automation means to run the code smoothly. for example

    IDE :- python, c/c++ ✅

    Code runner :- clear previous output

    Code runner :- run in terminal ✅

    Code runner :- save file before run ✅

     

    Click on extension section

     

     


     

     

     

    Search code runner and install them

     

     

     


     

     

     

    then go to setting option and in user simple search code runner

    Then tick mark on -

    clear previous output ✅

    Code runner :- run in terminal ✅

    Code runner :- save file before run ✅

     


     

     


     

     

     

    so as you can after installing IDE (IDE already installed in VS code) as you can see our c++ program is running. 



     


     

     

    Vola!!!

     

    A few notes about code-oss (aka VSCode): (credit kali linux)

    • We are compiling this from source, rather than using the pre-built binaries
    •  
    • The upside to this is that telemetry data is disabled by default
    •  
    • The downside is that some aspects of the marketplace may not work. If you find these limitations a problem, you may wish to uninstall the Kali package and switch to the VSCode pre-built binaries





    You also may question why it was named code-oss, rather than code


    • Code-OSS is what the source-code calls itself, which is used as the base before the configurations are applied for the pre-compiled binaries that gets distributed as “code”.
    •  
    • As we are using the source-code, we used the variables defined by it.
    •  
    • The two different names help to distinguish the differences between them (also prevents any clashes and conflicts!).
    •  
    • We also included various aliases in our package to help bridge between the two different versions. Meaning, calling vscode and code will use our package, code-oss, with a friendly notice (when installed).

     

     

     


    Disclaimer

     

    This was written for educational purpose and pentest only.
    The author will not be responsible for any damage ..!
    The author of this tool is not responsible for any misuse of the information.
    You will not misuse the information to gain unauthorized access.
    This information shall only be used to expand knowledge and not for causing  malicious or damaging attacks. Performing any hacks without written permission is illegal ..!


    All video’s and tutorials are for informational and educational purposes only. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. We believe that it is impossible to defend yourself from hackers without knowing how hacking is done. The tutorials and videos provided on www.hackingtruth.in is only for those who are interested to learn about Ethical Hacking, Security, Penetration Testing and malware analysis. Hacking tutorials is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used.


    All tutorials and videos have been made using our own routers, servers, websites and other resources, they do not contain any illegal activity. We do not promote, encourage, support or excite any illegal activity or hacking without written permission in general. We want to raise security awareness and inform our readers on how to prevent themselves from being a victim of hackers. If you plan to use the information for illegal purposes, please leave this website now. We cannot be held responsible for any misuse of the given information.



    - Hacking Truth by Kumar Atul Jaiswal



    I hope you liked this post, then you should not forget to share this post at all.
    Thank you so much :-)

     

  • atop a CLI monitoring tool for linux


    atop a CLI monitoring tool for linux




     

    The atop command displays you a more anatomized view of your server's performance. The program atop is an interactive monitor to view the load on a Linux system. It shows the occupation of the most critical hardware resources (from a performance point of view) on system level, i.e. cpu, memory, disk and network. It also shows which processes are responsible for the indicated load with respect to cpu and memory load on process level. Disk load is shown per process if "storage accounting" is active in the kernel. Network load is shown per process if the kernel module `netatop' has been installed. atop a CLI monitoring tool for linux

     

     

    Installation






    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop]
    └─$ sudo apt-get install atop        
    [sudo] password for hackerboy: 
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      libbasicusageenvironment1 libdap25 libgarcon-gtk3-1-0 libgroupsock8 libgtop-2.0-11 libgtop2-common libjsoncpp1 liblivemedia77 libre2-8
      librpm8 librpmbuild8 librpmio8 librpmsign8 libsane libusageenvironment3 libxdo3 libxfce4ui-utils libxpresent1 light-locker
      linux-headers-5.9.0-kali2-amd64 linux-headers-5.9.0-kali2-common linux-image-5.9.0-kali2-amd64 python3-atomicwrites python3-pathtools
      tango-icon-theme x11-session-utils xdotool xfce4-appfinder xfce4-helpers xfce4-panel xfce4-pulseaudio-plugin xfce4-session xfce4-settings
      xfdesktop4 xfdesktop4-data xfwm4 xiccd xinit xorg
    Use 'sudo apt autoremove' to remove them.
    The following NEW packages will be installed:
      atop
    0 upgraded, 1 newly installed, 0 to remove and 137 not upgraded.
    Need to get 201 kB of archives.
    After this operation, 511 kB of additional disk space will be used.
    Get:1 http://ftp.harukasan.org/kali kali-rolling/main amd64 atop amd64 2.6.0-2 [201 kB]
    Fetched 201 kB in 18s (11.1 kB/s)
    Selecting previously unselected package atop.
    (Reading database ... 407475 files and directories currently installed.)
    Preparing to unpack .../atop_2.6.0-2_amd64.deb ...
    Unpacking atop (2.6.0-2) ...
    Setting up atop (2.6.0-2) ...
    update-rc.d: We have no instructions for the atopacct init script.
    update-rc.d: It looks like a non-network service, we enable it.
    Created symlink /etc/systemd/system/timers.target.wants/atop-rotate.timer → /lib/systemd/system/atop-rotate.timer.
    Created symlink /etc/systemd/system/multi-user.target.wants/atop.service → /lib/systemd/system/atop.service.
    atop-rotate.service is a disabled or a static unit, not starting it.
    atopacct.service is a disabled or a static unit, not starting it.
    Processing triggers for kali-menu (2021.2.0) ...
    Processing triggers for man-db (2.9.4-2) ...
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/python/pygeoip/GeoOccupy-new]
    └─$ 
    
    
    
    








     

    Every interval (default: 10 seconds) information is shown about the resource occupation on system level (cpu, memory, disks and  network  layers), followed by a list of processes which have been active during the last interval (note that all pro‐ cesses that were unchanged during the last interval are not shown, unless the key 'a' has been pressed or unless sorting on memory  occupation is done). If the list of active processes does not entirely fit on the screen, only the top of the list is shown (sorted in order of activity). The intervals are repeated till the number of samples (specified as command argument) is reached, or till the  key  'q' is pressed in interactive mode.

     

     

     

    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop]
    └─$ atop
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop]
    └─$ 
    
    
    







     

    When atop is started, it checks whether the standard output channel is connected to a screen, or to a file/pipe. In the first case it produces screen control codes (via the ncurses library) and behaves interactively; in the second case it pro‐ duces flat ASCII-output.

     

     


    ATOP - KumarAtulJaiswal                                       2021/05/13  21:03:18                                       ----------------                                        10s elapsed
    PRC | sys    1.07s | user   4.10s |               | #proc    177 | #trun      2 | #tslpi   565 |               | #tslpu     0 | #zombie    0 | clones     9 |               | no  procacct |
    CPU | sys       9% | user     37% |  irq       0% | idle    354% | wait      0% | steal     0% |  guest     0% |              | ipc notavail | cycl unknown |  curf  500MHz | curscal  25% |
    cpu | sys       3% | user      9% |  irq       0% | idle     88% | cpu002 w  0% | steal     0% |  guest     0% |              | ipc notavail | cycl unknown |  curf  500MHz | curscal  25% |
    cpu | sys       2% | user     10% |  irq       0% | idle     88% | cpu000 w  0% | steal     0% |  guest     0% |              | ipc notavail | cycl unknown |  curf  500MHz | curscal  25% |
    cpu | sys       2% | user      9% |  irq       0% | idle     89% | cpu001 w  0% | steal     0% |  guest     0% |              | ipc notavail | cycl unknown |  curf  500MHz | curscal  25% |
    cpu | sys       2% | user      9% |  irq       0% | idle     89% | cpu003 w  0% | steal     0% |  guest     0% |              | ipc notavail | cycl unknown |  curf  500MHz | curscal  25% |
    CPL | avg1    0.65 | avg5    0.61 |               | avg15   0.51 |              |              |  csw    27567 | intr   10817 |              |              |  numcpu     4 |              |
    MEM | tot     3.6G | free  125.7M |  cache   1.4G | dirty   0.9M | buff  146.2M | slab  175.2M |  slrec 103.7M | shmem 221.1M | shrss  30.5M | vmbal   0.0M |  zfarc   0.0M | hptot   0.0M |
    SWP | tot     7.5G | free    7.5G |               |              |              | swcac   0.0M |               |              |              | vmcom   4.3G |               | vmlim   9.4G |
    PSI | cpusome   1% | memsome   0% |  memfull   0% | iosome    0% | iofull    0% | cs     1/2/2 |               | ms     0/0/0 | mf     0/0/0 | is     0/0/2 |  if     0/0/1 |              |
    DSK |          sda | busy      1% |  read       0 |              | write      3 | KiB/r      0 |  KiB/w     26 | MBr/s    0.0 | MBw/s    0.0 |              |  avq     1.70 | avio 20.0 ms |
    NET | transport    | tcpi      18 |  tcpo      23 | udpi       2 | udpo       2 | tcpao      2 |  tcppo      0 | tcprs      0 | tcpie      0 | tcpor      0 |  udpnp      0 | udpie      0 |
    NET | network      | ipi       21 |  ipo       26 |              | ipfrw      0 | deliv     21 |               |              |              |              |  icmpi      1 | icmpo      1 |
    NET | usb0    ---- | pcki      21 |  pcko      26 | sp    0 Mbps | si    6 Kbps | so    4 Kbps |  coll       0 | mlti       0 | erri       0 | erro       0 |  drpi       0 | drpo       0 |
    
        PID       SYSCPU       USRCPU       RDELAY         VGROW        RGROW       RUID           EUID            ST       EXC        THR        S       CPUNR        CPU       CMD         1/3
      28734        0.04s        1.64s        0.01s            0K           0K       hackerbo       hackerbo        --         -          7        R           1        17%       qterminal
        846        0.33s        0.76s        0.01s         7052K           0K       root           root            --         -         21        S           0        11%       Xorg
       3478        0.14s        0.32s        0.07s            0K        7708K       hackerbo       hackerbo        --         -         71        S           0         5%       firefox-esr
       3662        0.04s        0.23s        0.03s            0K         192K       hackerbo       hackerbo        --         -         25        S           2         3%       Web Content
       3629        0.05s        0.20s        0.04s            0K         264K       hackerbo       hackerbo        --         -         25        S           2         3%       Web Content
      31181        0.04s        0.20s        0.00s            0K        -620K       hackerbo       hackerbo        --         -         26        S           1         2%       Web Content
       2281        0.05s        0.14s        0.00s            0K           0K       hackerbo       hackerbo        --         -          7        S           0         2%       xfwm4
       3679        0.03s        0.13s        0.00s            0K           0K       hackerbo       hackerbo        --         -         24        S           3         2%       Web Content
       2685        0.03s        0.11s        0.00s            0K           0K       hackerbo       hackerbo        --         -          3        S           1         1%       panel-38-netlo
       2688        0.03s        0.10s        0.00s            0K           0K       hackerbo       hackerbo        --         -          3        S           0         1%       panel-40-cpugr
       3649        0.05s        0.07s        0.01s            0K           0K       hackerbo       hackerbo        --         -         24        S           1         1%       Web Content
      24581        0.11s        0.00s        0.02s            0K           0K       root           root            --         -          1        I           2         1%       kworker/2:0-ev
      32260        0.04s        0.04s        0.00s         4912K        3724K       hackerbo       hackerbo        --         -          1        R           3         1%       atop
       3801        0.00s        0.07s        0.00s            0K         264K       hackerbo       hackerbo        --         -         23        S           1         1%       WebExtensions
       3641        0.02s        0.03s        0.00s            0K           0K       hackerbo       hackerbo        --         -         24        S           0         1%       Web Content
        823        0.00s        0.02s        0.00s            0K           0K       debian-t       debian-t        --         -          1        S           1         0%       tor
       2693        0.01s        0.01s        0.00s            0K           0K       hackerbo       hackerbo        --         -          3        S           0         0%       panel-17-pulse
      32236        0.01s        0.01s        0.00s          132K          28K       root           root            --         -          1        S           1         0%       4nonimizer
       9614        0.01s        0.00s        0.00s            0K           0K       hackerbo       hackerbo        --         -         24        S           0         0%       Web Content
       2511        0.00s        0.01s        0.00s            0K           0K       hackerbo       hackerbo        --         -          3        S           3         0%       xfce4-panel
       2262        0.00s        0.01s        0.00s            0K           0K       hackerbo       hackerbo        --         -          3        S           2         0%       at-spi2-regist
        745        0.01s        0.00s        0.00s            0K           0K       root           root            --         -          4        S           1         0%       rsyslogd
         13        0.01s        0.00s        0.00s            0K           0K       root           root            --         -          1        I           2         0%       rcu_sched
         23        0.01s        0.00s        0.00s            0K           0K       root           root            --         -          1        S           2         0%       ksoftirqd/2
      30029        0.01s        0.00s        0.00s            0K           0K       root           root            --         -          1        I           0         0%       kworker/u8:4-e
      29732        0.00s        0.00s        0.00s            0K           0K       hackerbo       hackerbo        --         -         25        S           1         0%       Web Content
    
    





     

    Any Help?





    ┌──(hackerboy㉿KumarAtulJaiswal)-[~]
    └─$ atop -h
    Usage: atop [-flags] [interval [samples]]
                    or
    Usage: atop -w  file  [-S] [-a] [interval [samples]]
           atop -r [file] [-b [YYYYMMDD]hhmm] [-e [YYYYMMDD]hhmm] [-flags]
    
            generic flags:
              -V  show version information
              -a  show or log all processes (i.s.o. active processes only)
              -R  calculate proportional set size (PSS) per process
              -W  determine WCHAN (string) per thread
              -P  generate parseable output for specified label(s)
              -L  alternate line length (default 80) in case of non-screen output
              -f  show fixed number of lines with system statistics
              -F  suppress sorting of system resources
              -G  suppress exited processes in output
              -l  show limited number of lines for certain resources
              -y  show threads within process
              -Y  sort threads (when combined with 'y')
              -1  show average-per-second i.s.o. total values
    
              -x  no colors in case of high occupation
              -g  show general process-info (default)
              -m  show memory-related process-info
              -d  show disk-related process-info
              -n  show network-related process-info
              -s  show scheduling-related process-info
              -v  show various process-info (ppid, user/group, date/time)
              -c  show command line per process
              -o  show own defined process-info
              -u  show cumulated process-info per user
              -p  show cumulated process-info per program (i.e. same name)
              -j  show cumulated process-info per container
    
              -C  sort processes in order of cpu consumption (default)
              -M  sort processes in order of memory consumption
              -D  sort processes in order of disk activity
              -N  sort processes in order of network activity
              -E  sort processes in order of GPU activity
              -A  sort processes in order of most active resource (auto mode)
    
            specific flags for raw logfiles:
              -w  write raw data to   file (compressed)
              -r  read  raw data from file (compressed)
                  symbolic file: y[y...] for yesterday (repeated)
                  file name '-': read raw data from stdin
              -S  finish atop automatically before midnight (i.s.o. #samples)
              -b  begin showing data from specified date/time
              -e  finish showing data after specified date/time
    
            interval: number of seconds   (minimum 0)
            samples:  number of intervals (minimum 1)
    
    If the interval-value is zero, a new sample can be
    forced manually by sending signal USR1 (kill -USR1 pid_atop)
    or with the keystroke 't' in interactive mode.
    
    Please refer to the man-page of 'atop' for more details.
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~]
    └─$                                              
    
    




     

    Advantages of atop


    Atop is an ASCII, full-screen performance monitor which can log and report the activity of all server processes. One feature I really like is that atop stays active in the background for long-term server analysis (up to 28 days by default). Other advantages include:

    • Shows resource usage of all processes, even those that are closed or completed.
    • More Linux resources.
    • Advanced Linux Commands Cheat Sheet for Developers.
    • Get Started with Red Hat Insights.
    • Download Now: Basic Linux Commands Cheat Sheet.
    • Linux System Administration Skills Assessment.
    • Monitors threads within processes and ignores processes that are unused.
    • Accumulates resource usage for all processes and users with the same name.
    • Highlights critical resources using colors (red).
    • Adds or removes columns as the size of the display window changes.
    • Includes disk I/O and network utilization.
    • Uses the netatop kernel module to monitor TCP, UDP, and network bandwidth.






    Disclaimer

     

    This was written for educational purpose and pentest only.
    The author will not be responsible for any damage ..!
    The author of this tool is not responsible for any misuse of the information.
    You will not misuse the information to gain unauthorized access.
    This information shall only be used to expand knowledge and not for causing  malicious or damaging attacks. Performing any hacks without written permission is illegal ..!


    All video’s and tutorials are for informational and educational purposes only. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. We believe that it is impossible to defend yourself from hackers without knowing how hacking is done. The tutorials and videos provided on www.hackingtruth.in is only for those who are interested to learn about Ethical Hacking, Security, Penetration Testing and malware analysis. Hacking tutorials is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used.


    All tutorials and videos have been made using our own routers, servers, websites and other resources, they do not contain any illegal activity. We do not promote, encourage, support or excite any illegal activity or hacking without written permission in general. We want to raise security awareness and inform our readers on how to prevent themselves from being a victim of hackers. If you plan to use the information for illegal purposes, please leave this website now. We cannot be held responsible for any misuse of the given information.



    - Hacking Truth by Kumar Atul Jaiswal



    I hope you liked this post, then you should not forget to share this post at all.
    Thank you so much :-)

     

  • TryHackMe NIS - Linux Part I

     

     

    Task 2 ls   This task should give you a better understanding of the command ls and a few of the switches that the command can take and what are some of the more efficient ones. Below is a screenshot of the help menu, however, feel free to use the man. TryHackMe NIS - Linux Part I

     

     

    NIS - Linux Part I

    Enhance your Linux knowledge with this beginner friendly room! 

     

    Task 1 What is this room about?

    In this task, we will be looking back at ZTH Linux and a few other topics that seem to cause some trouble around the beginners. A requirement for this room is to finish the Learn Linux room - https://tryhackme.com/room/zthlinux.

    As it covers all the basic requirements and this is just a follow up to it in order to strengthen the understanding you gained throughout the room. In order to do so.
    Below I will be asking a few questions related to that room, so please, make sure to complete it first :). If you didn't feel free to go through the tasks and come back to this once you finished the room.



    The commands you are allowed to use in this room are:

    •     cat
    •     tac
    •     head
    •     tail
    •     xxd
    •     base64
    •     find
    •     grep
    •     echo
    •     xargs
    •     hexeditor
    •     tar
    •     gzip
    •     7zip
    •     binwalk


     

    Bear in mind, commands such as cd are not allowed.


    *The SSH credentials are chad:Infinity121 *

    1)What is shiba3's password?

    Ans :-

     

    2) What is shiba4's password?

    Ans :- 


     

    3)What is the root.txt flag? 

    Ans :- 

     

     


     

    Task 2 ls


    This task should give you a better understanding of the command ls and a few of the switches that the command can take and what are some of the more efficient ones. Below is a screenshot of the help menu, however, feel free to use the man. TryHackMe NIS - Linux Part I








    Task 3 cat

     

    Hopefully, the above screenshot should help you go through a few of the tasks below, however further research is required. A good thing to know is that ls supports multiple ways of chaining switches. Such as:



    •     ls -x -y -z
    •     ls -xyz


     

    In some cases, you would need to keep evidence of your findings. Below we will start with some basic commands you should be familiar with.

     

    1) How do you run the ls command?

    Ans :- ls


     

    2) How do you run the ls command to show all the files inside the folder?

    Ans :- ls -a

     


    3) How do you run the ls command to not show the current directory and the previous directory in the output? (almost everything)

    Ans :- ls -a


     

    4) How do you show the information in a long listing format using ls?

    Ans :- ls -l
     

     

    5) How do you show the size in readable format? e.g. k, Mb, etc

    Ans :- ls -h

     

    6) How do you do a recursive ls?

    Ans :- ls --recursive


     

    7) How many files did you locate in the home folder of the user?(non-hidden and not inside other folders)

    Ans :- 13



     

    Task 3 cat


    The cat command is one of the most common Linux commands that people use, however, in some instances, the cat command cannot be used as it's removed.

    Below is a screenshot of the cat command's help menu.


     





    But, as we are professionals we know about a few alternatives of going around it:
     
    The first command we are going to learn about is tac. Yes, cat spelt backwards. It is similar to the command, with the downside of less functionality.







    Thus being a good tool to add to your toolbelt when you are limited by your reverse shell.


    Another tool that can be used is head. This is usually used to get the beginning part of a file, however, you can use it to your heart's content and grab as many lines as you want.







    One more tool that can be used to grab the content of a file is tail. This is similar to the head command, however, as the name implies it will grab the last part of a file.





     




     

    Another useful command is xxd. this can be used to generate a hex dump of the content of a file. Then, if you want you can either just read the text from the right-hand side or convert from hex to ASCII.





     


     

     

    Similar to the above you can use the base64 command to convert the text to base64 and then convert it back to ASCII.




















    1) What is the content of cat.txt?

    Ans :- THM{11adbee391acdffee901}



    2) What is the content of tac.txt?

    Ans :- THM{acab0111aaa687912139}



    3) What is the content of head.txt?

    Ans :- THM{894abac55f7962abc166}



    4) What is the content of tail.txt?

    Ans :- THM{1689acafdd20751acff6}



    5) What is the content of the xxd.txt?

    Ans :- THM{fac1aab210d6e4410acd}



    6) What is the content of base64.txt?

    Ans :- THM{aa462c1b2d44801c0a31}









    Task 4 find


    The find command is one of the most useful commands on a Linux operating system.



     





    This command can help us find specific files that match a pattern like:


    find . -name *.txt


    Or we can use it to find files that have a specific extension:


    find / -type f -name "*.bak"



    This simple command will start browsing the machine directory, finding all the files with extension .bak (backup).










    But we can also use it to find files that have the SUID or SGID bit set like so:



    find / -type f \( -perm -4000 -o -perm -2000 \) -exec ls -l {} \;

    This command combines permissions 4000 (SUID) and 2000 (SGID)


     





     

     

     

    1) How many .txt files did you find in the current folder?

    Ans :- 8

     

    2) How many SUID files have you found inside the home folder?

    Ans :- 0









    Task 5 grep


    grep is a really useful command to grab text from files.






    Let's read through a few examples of grep commands and see how we can use them for our own benefit in a scenario.

    grep "word" file



     


     

    Grep not only allows us to check if a certain word exists in the file but also outputs us the context in which the word had appeared. As you can see on the screenshot above, we were able to find an exact match to the word 'if' in the file script.py.

    We can also compare two files with similar names using.

     

    grep "word" file*







    How many times does the word "hacker" appear in the grep files? (including variations)











    Task 6 sudo



    sudo command allows certain users to execute a command as another user, according to settings in the /etc/sudoers file. By default, sudo requires that users authenticate themselves with a password of another user.

    In the real-life scenario, sudo is mostly used to switch to root account and gain an ability to fully interact with the system.






    sudo -l appears to be the most commonly used switch. It can always tell you which commands are you allowed to run as another user on the following system, and in some cases, can give you a clue to root access.

     

    1) Is the user allowed to run the above command? (Yay/Nay)

    Ans :- 








    Task 7 chmod

    The chmod command sets the permissions of files or directories.







     

    Those permissions are divided between three main characters:

       

    • User
    • Group
    • Other


     

    All of them can rather read, write or execute a file. Permission to do so can be granted using chmod.



    It can be done rather using letter notation or numerical values.



    Let's take a look at the following command:

     

    chmod u=rwx,g=rx,o=rw myfile


    •     u = user is being giver read, write and execute permission
    •     g = group can now read and execute
    •     o = other can read and write



    This long notion can be eliminated by numerical values for permission. There are exactly four of them:



    • 0 stands for "no permission."
    • 1 stands for "execute";
    • 2 stands for "write";
    • 4 stands for "read".


     

     

    Those values can be easily combined by adding them up.

    For example, permission to read, write and execute would be 7 (1 + 2 + 4).

     

    chmod 777 file

     

     

    The following command will grant full file access to everyone on the system. (Those numerical values can be easily calculated using an interactive chmod-calculator).

    chmod command comes in handy with ssh key files (id_rsa). By editing their permissions to 'user read-write only' we can use other people's id_rsa files to connect via ssh.



    chmod 600 id_rsa











    Task 8 echo


    echo is the most fundamental command found in most operating systems. It used to prints text to standard output, for example, terminal. It is mostly used in bash scripts in order to display output directly to user's console.





     

    echo can also be used to interact with other system commands and pass some value to them.








     

    echo also has a small trick which allows to print out any command output to console.



    echo "$( [command] )"

     

    What command would you use to echo the word "Hackerman" ?








    Task 9 xargs


    xargs command builds and executes command lines from standard input. It allows you to run the same command on a large number of files.





     

     

     

    xargs is often used with the find command, in order to easily interact with its input.



    Let's take a look at the given command:



    find /tmp -name test -type f -print | xargs /bin/rm -f


     

    On the left side, we can see a command which should technically display all files under a name 'test'. xargs command on the left allows us to execute rm (remove) on those files and easily delete all of them.
    Same can be done with reading all the files under the name 'test'.

     

     

    1) How would you read all files with extension .bak using xargs?

    Ans :- find / -name *.bak -type f -print | xargs /bin/cat








    Task 10 hexeditor


    Hexeditor is an awesome tool designed to read and modify hex of a file, this comes in handy especially when it comes to troubleshooting magic numbers for files such as JPG, WAV and any other types of files. This tool is also helpful when it comes to CTFs and text is hidden inside a file or when the magic number of a file was altered.

    Another tool that is good for this kind of scenarios is called strings but we won't be talking about it in this part of our course.







     

     

     

    For this task, I will be providing you with resources to help you along your journey around challenges you might be facing in which you need the hexeditor tool.



    A few resources I use for tasks that involve analysing files and fixing the magic 

    number I use the following resources:



    https://en.wikipedia.org/wiki/List_of_file_signatures

    https://gist.github.com/leommoore/f9e57ba2aa4bf197ebc5

    https://www.garykessler.net/library/file_sigs.html











    Task 11 curl 

    The curl command transfers data to or from a network server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE). It is designed to work without any user interaction, so could be ideally used in a shell script.



    curl is a huge tool with a lot of switches and possibilities. Let's take a look at some of the most important ones.



    curl http://www.ismycomputeron.com/






     

    The most basic command. Fetches data from the website using the HTTP protocol, and display it using standard HTML code. This is essentially the same as "viewing the source" of the webpage.



    The following command will limit the connection speed to 1,234 bytes/second:



    curl --limit-rate 1234B http://www.ismycomputeron.com/


    Another example is saving the output to a file using either:



    -o to save the file under a different name
    curl -o loginpage.html https://tryhackme.com/login



    -O to save the file under the same name:


    curl -O https://tryhackme.com/login

    Or, you might be interested in fetching the headers silently?


    curl -I -s https://tryhackme.com

     

     

    1) How would you grab the headers silently of https://tryhackme.com but grepping only the HTTP status code?

    Ans :- 






    Task 12 wget


    The wget command downloads files from HTTP, HTTPS, or FTP connection a network.






     

     

     

    wget http://somewebsite.com/files/images.zip






     

    Adding a -b switch will allow us to run wget in the background and return the terminal to its initial state.



    wget -b http://www.example.org/files/images.zip




    1) What command would you run to get the flag.txt from https://tryhackme.com/ ?

    Ans :- 



    2) What command would you run to download recursively up to level 5 from https://tryhackme.com ?

    Ans :-








    Task 13 tar


    tar is a command that allows creating, maintain, modify, and extracts files that are archived in the tar format.






     

     

    The most common example for tar extraction would be:

    tar -xf archive.tar

     




     

     

    -x tells tar to extract files from an archive.

    -f tells tar that the next argument will be the name of the archive to operate on.
     

     

    1) What is the flag from the tar file?

    Ans :-








    Task 14 gzip


    gzip - a file format and a software application used for file compression and decompression. gzip-compressed files have .gz extension.





     

    A gzip file can be decompressed using a simple gzip -d file.gz command, where -d stands for decompress.


    1) What is the content of gzip.txt?

    Ans :-









    Task 15 7zip


    7-Zip is a free and open-source file archiver, a utility used to place groups of files within compressed containers known as "archives".







    7z is as simple as the gzip or tar and you can use the following command:

    7z x file.zip to extract the file

    This tool comes in handy as it works with a lot more file extensions than other tools. You name the archive extension and 7z should be the tool for you.

     

    1) What is the flag inside the 7zip file?

    Ans :-






    Task 16 binwalk


    binwalk allows users to analyze and extract firmware images and helps in identifying code, files, and other information embedded in those, or inside another file, taking as an example steganography.








    A simple command such as binwalk file allows us to perform a simple file scan and identify code information.

    binwalk -e
    file allows us to extract files from firmware. This method is usually used in CTFs, where some important information can be hidden within the file.

    binwalk -Me file does the same as-e, but recursively.






     

     

    1) What is the content of binwalk.txt?

    Ans :-








    Disclaimer


    This was written for educational purpose and pentest only.
    The author will not be responsible for any damage ..!
    The author of this tool is not responsible for any misuse of the information.
    You will not misuse the information to gain unauthorized access.
    This information shall only be used to expand knowledge and not for causing  malicious or damaging attacks. Performing any hacks without written permission is illegal ..!


    All video’s and tutorials are for informational and educational purposes only. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. We believe that it is impossible to defend yourself from hackers without knowing how hacking is done. The tutorials and videos provided on www.hackingtruth.in is only for those who are interested to learn about Ethical Hacking, Security, Penetration Testing and malware analysis. Hacking tutorials is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used.


    All tutorials and videos have been made using our own routers, servers, websites and other resources, they do not contain any illegal activity. We do not promote, encourage, support or excite any illegal activity or hacking without written permission in general. We want to raise security awareness and inform our readers on how to prevent themselves from being a victim of hackers. If you plan to use the information for illegal purposes, please leave this website now. We cannot be held responsible for any misuse of the given information.



    - Hacking Truth by Kumar Atul Jaiswal



    I hope you liked this post, then you should not forget to share this post at all.
    Thank you so much :-)


      



  • WHAT WE DO

    We've been developing corporate tailored services for clients for 30 years.

    CONTACT US

    For enquiries you can contact us in several different ways. Contact details are below.

    Hacking Truth.in

    • Street :Road Street 00
    • Person :Person
    • Phone :+045 123 755 755
    • Country :POLAND
    • Email :contact@heaven.com

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.