<?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 Mayuresh patil on Medium]]></title>
        <description><![CDATA[Stories by Mayuresh patil on Medium]]></description>
        <link>https://medium.com/@7024569052mayu?source=rss-d6256edbea8b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*AMjb4kbl6ByAa6kA</url>
            <title>Stories by Mayuresh patil on Medium</title>
            <link>https://medium.com/@7024569052mayu?source=rss-d6256edbea8b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 20:55:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@7024569052mayu/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[SQL Injection Attack and How to Prevent SQLi]]></title>
            <link>https://medium.com/@7024569052mayu/sql-injection-attack-and-how-to-prevent-sqli-809ac824a65b?source=rss-d6256edbea8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/809ac824a65b</guid>
            <dc:creator><![CDATA[Mayuresh patil]]></dc:creator>
            <pubDate>Mon, 28 Sep 2026 13:26:29 GMT</pubDate>
            <atom:updated>2026-09-28T13:26:29.214Z</atom:updated>
            <content:encoded><![CDATA[<h3>SQL Injection Attack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h4Lq8_MROVycDL-S.png" /></figure><h3>Introduction</h3><p>SQL Injection, also called SQLi, is a type of security problem that can happen in websites and applications.</p><p>It happens when a website takes information from a user and puts it directly into a database query without checking it properly. An attacker can use this mistake to change the database query and access information they should not be able to see.</p><p>SQL Injection can be dangerous, but developers can prevent it by following some simple security rules.</p><h3>What is SQL Injection?</h3><p>To understand SQL Injection, first we need to understand what SQL is.</p><p>SQL is a language used to communicate with a database. For example, a website may use SQL to find a user’s information from a database.</p><p>A simple query can look like this:</p><pre>SELECT * FROM users WHERE username = &#39;John&#39;;</pre><p>This query asks the database to find a user whose username is John.</p><p>The problem starts when a website adds user input directly into the SQL query.</p><p>For example, if a website takes a username from a login form and directly adds it to the query, an attacker may enter specially created input that changes how the query works.</p><p>So, in simple words:</p><p><strong>SQL Injection happens when a user is able to change an SQL query through their input.</strong></p><h3>How Does SQL Injection Happen?</h3><p>A simple SQL Injection attack usually happens like this:</p><ol><li>A website asks the user to enter some information.</li><li>The website sends that information to the database.</li><li>The website adds the information directly to an SQL query.</li><li>An attacker enters specially created input.</li><li>The database may understand that input as part of the SQL command.</li><li>The attacker may then access or change data they should not have access to.</li></ol><p>This is why user input should never be trusted without proper handling.</p><h3>Where Can SQL Injection Happen?</h3><p>SQL Injection can happen in many places where a website takes information from users.</p><p>Some common examples are:</p><ul><li>Login forms</li><li>Search boxes</li><li>Website URLs</li><li>Online forms</li><li>API requests</li><li>Cookies</li><li>Product or user IDs</li><li>Admin panels</li></ul><p>It is not only a problem with login pages. Any part of a website that sends user input to a database can have this problem if it is not written safely.</p><h3>Why is SQL Injection Dangerous?</h3><p>SQL Injection can cause different types of problems depending on how the website and database are set up.</p><h3>1. Stealing Data</h3><p>An attacker may be able to access information stored in the database.</p><p>This could include:</p><ul><li>Usernames</li><li>Email addresses</li><li>Customer information</li><li>Orders</li><li>Other private data</li></ul><h3>2. Login Problems</h3><p>In some cases, an attacker may be able to change the way a login query works and get access without having the correct login details.</p><h3>3. Changing Data</h3><p>If the database gives the application permission to change data, an attacker may be able to modify information in the database.</p><h3>4. Deleting Data</h3><p>In some situations, a poorly protected application may allow an attacker to delete important information from the database.</p><h3>5. Showing Database Errors</h3><p>Badly designed websites may show database errors to users. These errors can sometimes reveal useful information about the website and its database.</p><h3>Simple Example of a Vulnerable Code</h3><p>Here is an example of unsafe Python code:</p><pre>username = request.form[&quot;username&quot;]</pre><pre>query = &quot;SELECT * FROM users WHERE username = &#39;&quot; + username + &quot;&#39;&quot;<br>cursor.execute(query)</pre><p>The problem is that the user’s input is directly added to the SQL query.</p><p>An attacker may enter special input that changes the meaning of the query.</p><p>The main problem is:</p><p><strong>The website is mixing user input with SQL code.</strong></p><h3>How to Prevent SQL Injection</h3><p>There are several simple ways developers can protect their websites from SQL Injection.</p><h3>1. Use Parameterized Queries</h3><p>This is one of the most important ways to prevent SQL Injection.</p><p>Instead of joining user input directly with the SQL query, use a parameterized query.</p><p>For example:</p><pre>username = request.form[&quot;username&quot;]</pre><pre>query = &quot;SELECT * FROM users WHERE username = %s&quot;<br>cursor.execute(query, (username,))</pre><p>Here, the database knows that username is data and not part of the SQL command.</p><p>This makes it much harder for user input to change the SQL query.</p><h3>2. Check User Input</h3><p>Websites should check the information entered by users.</p><p>For example, if a website expects a number, it should make sure that the user has entered a valid number.</p><p>Input checking can help make sure that:</p><ul><li>The data has the correct type.</li><li>The input is not too long.</li><li>The input follows the expected format.</li><li>Unexpected characters are handled safely.</li></ul><p>However, input checking alone is not enough. Parameterized queries should still be used.</p><h3>3. Give the Database Only the Permissions It Needs</h3><p>A website does not always need full access to a database.</p><p>For example, if an application only needs to read certain data, its database account should not have permission to delete everything.</p><p>Giving only the required permissions can reduce the damage if an attack happens.</p><h3>4. Do Not Show Detailed Database Errors</h3><p>When something goes wrong, websites should avoid showing detailed database errors to normal users.</p><p>Instead of showing technical information, the website can show a simple message such as:</p><blockquote><em>“Something went wrong. Please try again.”</em></blockquote><p>The full error can be saved in a secure server log so that developers can check it later.</p><h3>5. Keep Software Updated</h3><p>Developers should keep their programming languages, frameworks, database software, and other libraries updated.</p><p>Updates can fix known security problems and help keep the application safer.</p><h3>6. Test the Website</h3><p>Developers should regularly test their websites for security problems.</p><p>They can use:</p><ul><li>Code reviews</li><li>Security testing tools</li><li>Automated security tests</li><li>Manual security testing</li><li>Authorized penetration testing</li></ul><p>Security testing should only be done on websites or systems where you have permission to test.</p><h3>SQL Injection Prevention Checklist</h3><p>Developers can use this simple checklist:</p><ul><li>Use parameterized queries.</li><li>Never directly add user input to SQL queries.</li><li>Check and validate user input.</li><li>Give the database only the permissions it needs.</li><li>Do not show detailed database errors to users.</li><li>Keep software and libraries updated.</li><li>Test the application for security problems.</li><li>Protect sensitive information properly.</li></ul><h3>SQL Injection and Other Attacks</h3><p>SQL Injection is one type of attack where user input is used in the wrong way.</p><p>There are other attacks that work in a similar way.</p><p>For example:</p><ul><li><strong>SQL Injection</strong> affects database queries.</li><li><strong>Command Injection</strong> can affect operating-system commands.</li><li><strong>LDAP Injection</strong> can affect LDAP queries.</li><li><strong>Cross-Site Scripting (XSS)</strong> can affect web pages and browsers.</li></ul><p>The main idea is the same: <strong>user input should not be allowed to become a command or code.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=809ac824a65b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cross-Site Scripting (XSS)]]></title>
            <link>https://medium.com/@7024569052mayu/cross-site-scripting-xss-75981923515f?source=rss-d6256edbea8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/75981923515f</guid>
            <category><![CDATA[cross-site-scripting-xss]]></category>
            <dc:creator><![CDATA[Mayuresh patil]]></dc:creator>
            <pubDate>Mon, 28 Sep 2026 13:15:13 GMT</pubDate>
            <atom:updated>2026-09-28T13:15:13.536Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Modern web applications process and display large amounts of user-generated data. Search queries, comments, profile information, messages, and form submissions can all contain data supplied by users. When an application handles this data incorrectly, attackers may be able to inject malicious scripts into pages viewed by other users.</p><p>This vulnerability is known as Cross-Site Scripting (XSS).</p><p>XSS is a client-side injection vulnerability in which untrusted data is interpreted by a browser as executable code rather than ordinary text. Depending on the context and application design, XSS can allow an attacker to manipulate page content, perform actions in a victim’s browser, or access information available to scripts running in the application’s origin.</p><p>Understanding XSS is therefore an important part of secure web development and application security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*vK8mIc_OrmmTNy2R" /></figure><h3>What Is XSS?</h3><p>Cross-Site Scripting heppend when an application includes untrusted input in a web page without applying appropriate validation, encoding, or sanitization.</p><p>For example, imagine a website displaying a user’s name:</p><pre>&lt;h2&gt;Welcome, USERNAME&lt;/h2&gt;</pre><p>If the application inserts the username directly into the HTML without safely encoding it, specially crafted input could potentially be interpreted as HTML or JavaScript.</p><p>The important distinction is:</p><blockquote><em>Data should remain data. It should not unexpectedly become executable code.</em></blockquote><p>XSS vulnerabilities generally arise when an application fails to maintain this separation.</p><h3>How XSS Works</h3><p>A typical XSS scenario involves three components:</p><ol><li>Attacker — supplies specially crafted input.</li><li>Vulnerable application — processes and returns that input unsafely.</li><li>Victim’s browser — interprets the resulting content in the application’s security context.</li></ol><p>Consider a comment feature that accepts arbitrary input and later displays it to visitors.</p><p>A secure application should treat the submitted content as text. A vulnerable implementation might insert the content directly into the page, allowing browser markup or script code to be interpreted.</p><p>The exact behavior depends on where the untrusted data is placed, such as:</p><ul><li>HTML content</li><li>HTML attributes</li><li>JavaScript strings</li><li>CSS contexts</li><li>URLs</li><li>DOM APIs</li></ul><p>This is why XSS prevention cannot rely on a single generic filtering rule.</p><h3>Types of XSS</h3><h3>1. Stored XSS</h3><p>Stored XSS, also called persistent XSS, occurs when malicious input is stored by an application and later served to other users.</p><p>Common locations include:</p><ul><li>Comment systems</li><li>User profiles</li><li>Forum posts</li><li>Support tickets</li><li>Messaging systems</li></ul><p>For example, an attacker could submit malicious content through a vulnerable comment form. If the server stores the content and subsequently renders it without proper output encoding, every user who views the affected page could be exposed.</p><p>Stored XSS can be particularly serious because the malicious content can persist until it is removed or the vulnerable application is fixed.</p><h3>2. Reflected XSS</h3><p>Reflected XSS occurs when malicious input is immediately reflected by the application in its response.</p><p>A common example is a search page that displays the submitted search term:</p><pre>Search results for: &lt;user input&gt;</pre><p>If the application places the input into the HTML without appropriate context-sensitive encoding, an attacker may construct a malicious URL and attempt to convince another user to visit it.</p><p>Unlike stored XSS, the malicious input generally isn’t permanently stored by the application.</p><h3>3. DOM-Based XSS</h3><p>DOM-based XSS occurs primarily in client-side JavaScript.</p><p>Instead of the server generating the vulnerable response, JavaScript running in the browser reads attacker-controlled data and inserts it into a dangerous DOM context.</p><p>For example, code that places untrusted input into an HTML interpretation sink without appropriate protection can create a vulnerability.</p><p>Common sources of attacker-controlled data can include:</p><ul><li>URL parameters</li><li>URL fragments</li><li>Browser storage</li><li>Referrer information</li><li>PostMessage data</li></ul><p>DOM-based XSS demonstrates why securing only server-side code is not enough. Client-side JavaScript must also handle untrusted data safely.</p><h3>Why XSS Is Dangerous</h3><p>The impact of an XSS vulnerability depends heavily on the application’s functionality and the privileges of the affected user.</p><p>Potential consequences can include:</p><ul><li>Manipulation of page content</li><li>Phishing interfaces embedded within legitimate pages</li><li>Unauthorized actions performed through the victim’s authenticated session</li><li>Exposure of sensitive information accessible to client-side scripts</li><li>Account compromise in applications with additional weaknesses</li><li>Defacement or disruption of application functionality</li></ul><p>However, XSS does not automatically mean that an attacker can steal every cookie or completely take over an account. Modern browser security controls, cookie attributes, Content Security Policy, authentication mechanisms, and application architecture can significantly affect the impact.</p><h3>XSS and Cookies</h3><p>One commonly discussed consequence of XSS is cookie theft.</p><p>However, cookies marked with the HttpOnly attribute cannot normally be read through JavaScript. This makes HttpOnly an important defense against certain forms of client-side cookie exposure.</p><p>For example:</p><pre>Set-Cookie: sessionid=...; HttpOnly; Secure</pre><p>The Secure attribute additionally instructs the browser to send the cookie only over HTTPS.</p><p>These protections reduce the consequences of XSS but do not prevent XSS itself. An attacker may still be able to perform actions through a vulnerable page even when sensitive cookies cannot be directly read.</p><h3>How to Prevent XSS</h3><h3>1. Use Context-Aware Output Encoding</h3><p>One of the most important defenses is to encode untrusted data according to the context in which it is being inserted.</p><p>HTML, HTML attributes, JavaScript, CSS, and URLs have different parsing rules. Therefore, encoding appropriate for one context may be unsafe in another.</p><p>Developers should prefer framework-provided escaping mechanisms rather than implementing their own encoding functions.</p><h3>2. Avoid Dangerous DOM APIs</h3><p>Client-side JavaScript should be particularly careful with APIs that interpret strings as HTML or code.</p><p>Prefer APIs that treat content as text when HTML interpretation is not required.</p><p>For example:</p><pre>element.textContent = userInput;</pre><p>is generally safer for displaying text than directly assigning untrusted input to an HTML interpretation context.</p><h3>3. Validate Input</h3><p>Input validation can reduce unexpected data entering an application.</p><p>For example, if a field is supposed to contain a username, the application can enforce appropriate length and character restrictions.</p><p>However, input validation alone is not a complete XSS defense. Applications should still safely encode output because legitimate-looking data can be dangerous in different rendering contexts.</p><h3>4. Sanitize HTML When HTML Is Required</h3><p>Some applications intentionally allow users to submit formatted HTML, such as rich-text editors.</p><p>In these situations, simply escaping everything may not be appropriate. Instead, applications should use a well-maintained HTML sanitization library configured according to the application’s requirements.</p><p>The goal is to allow safe markup while removing dangerous constructs.</p><h3>5. Use Content Security Policy</h3><p>Content Security Policy (CSP) is a browser security mechanism that can restrict which scripts and other resources a page is allowed to execute or load.</p><p>A carefully designed CSP can significantly reduce the impact of some XSS vulnerabilities.</p><p>For example, a policy might restrict scripts to trusted sources rather than allowing arbitrary inline script execution.</p><p>CSP should be considered an additional security layer rather than a replacement for secure coding practices.</p><h3>6. Configure Security Headers and Cookies</h3><p>Security-related browser controls can provide additional protection.</p><p>Useful measures include:</p><ul><li>HttpOnly for sensitive cookies</li><li>Secure for cookies transmitted over HTTPS</li><li>Appropriate SameSite cookie settings</li><li>Content Security Policy</li><li>Other relevant security headers</li></ul><p>These controls help reduce the potential impact of client-side attacks.</p><h3>A Simple Secure Coding Example</h3><p>Consider a page that needs to display user-provided text.</p><p>A risky pattern is conceptually:</p><pre>element.innerHTML = userInput;</pre><p>If userInput is untrusted, the browser may interpret it as HTML.</p><p>When the application only needs to display text, a safer approach is:</p><pre>element.textContent = userInput;</pre><p>The second approach tells the browser to treat the value as text rather than HTML.</p><p>This small difference illustrates a major security principle:</p><blockquote><em>Choose APIs based on whether you need data to be interpreted as code or displayed as data.</em></blockquote><h3>Testing for XSS</h3><p>Security teams can test applications for XSS by examining every location where user-controlled data enters and leaves the application.</p><p>A responsible testing process includes:</p><ol><li>Identify input sources.</li><li>Determine where the input is stored or reflected.</li><li>Trace how the data reaches the browser.</li><li>Identify the rendering context.</li><li>Check whether appropriate encoding or sanitization is applied.</li><li>Test the application’s defenses in an authorized environment.</li><li>Remediate and retest the vulnerability.</li></ol><p>Testing should only be performed on applications and systems where you have explicit authorization.</p><p>Security testing tools can assist with identifying potential injection points, but manual code review and understanding the application’s data flow remain important.</p><h3>XSS vs. Other Web Vulnerabilities</h3><p>XSS is often confused with other injection vulnerabilities.</p><p>XSS primarily targets the browser and occurs when untrusted data is interpreted as executable client-side content.</p><p>SQL Injection, on the other hand, occurs when untrusted input is improperly incorporated into database queries.</p><p>Command Injection involves unintended execution of operating-system commands.</p><p>Although these vulnerabilities are different, they share an important underlying problem:</p><blockquote><em>Untrusted input reaches an interpreter without sufficient separation between data and executable instructions.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75981923515f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comprehensive Guide to Setting Up and Managing a DHCP Server]]></title>
            <link>https://medium.com/@7024569052mayu/comprehensive-guide-to-setting-up-and-managing-a-dhcp-server-cc05fc77287d?source=rss-d6256edbea8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc05fc77287d</guid>
            <dc:creator><![CDATA[Mayuresh patil]]></dc:creator>
            <pubDate>Mon, 30 Dec 2024 08:31:27 GMT</pubDate>
            <atom:updated>2024-12-30T08:31:27.129Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*rHXc_TTxihfS0OCpAcifPg.jpeg" /></figure><h3>What is DHCP?</h3><p>DHCP (Dynamic Host Configuration Protocol) is a network management protocol used to dynamically assign an IP address to any device, or <a href="https://www.techtarget.com/searchnetworking/definition/node">node</a>, on a network so it can communicate using IP. DHCP automates and centrally manages these configurations rather than requiring network administrators to manually assign IP addresses to all network devices. DHCP can be implemented on small local networks, as well as large enterprise networks.</p><h3>How DHCP works</h3><ol><li><strong>DHCP Discover</strong> (Client to Server):</li></ol><ul><li>When a device (client) joins the network, it sends a <strong>DHCP Discover</strong> message to indicate that it needs an IP address.</li><li>This message is broadcasted across the network because the device doesn’t yet have an IP address to communicate directly with the server.</li></ul><p><strong>2. DHCP Offer</strong> (Server to Client):</p><ul><li>A DHCP server responds to the client’s request with a <strong>DHCP Offer</strong> message.</li><li>This message contains an available IP address and additional configuration details (like subnet mask, default gateway, and DNS servers).</li></ul><p><strong>3. DHCP Request</strong> (Client to Server):</p><ul><li>The client selects one of the offered IP addresses (if multiple servers respond) and sends a <strong>DHCP Request</strong> message to the server to accept the offer.</li></ul><p><strong>4. DHCP Acknowledgment (ACK)</strong> (Server to Client):</p><ul><li>The DHCP server confirms the allocation by sending a <strong>DHCP ACK</strong> message, finalizing the lease of the IP address and providing the network settings.</li><li>The client can now use the IP address to communicate on the network</li></ul><p><strong>Lease Renewal</strong>:</p><ul><li>The IP address assigned by the DHCP server is leased for a specific period.</li><li>Before the lease expires, the client can send a renewal request to extend it.</li></ul><h3>Advantages of DHCP</h3><ul><li><strong>Automation</strong>: Reduces manual effort in assigning IP addresses.</li><li><strong>Consistency</strong>: Prevents IP address conflicts.</li><li><strong>Flexibility</strong>: Allows devices to easily join and leave the network.</li><li><strong>Centralized Management</strong>: All IP-related configurations are managed from a single server.</li></ul><h4>Requirements or conditions that must be fulfilled before start Configuring the DHCP server configuration</h4><ul><li><strong>Static IP address </strong>to make sure the connection effictively.</li><li><strong>Firewall configured</strong> to allow DHCP traffic</li></ul><h3>Step 1. Install the DHCP Server</h3><pre>yum install dhcp-server</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B8s8YPb5y2_oN53p2SDWXA.png" /></figure><h4>Verify Installed Package Version</h4><pre>rpm -qi dhcp-server</pre><p>Displays information about the installed DHCP server package, including its version.</p><h4>View Package Documentation</h4><pre>rpm -qd dhcp-server</pre><p>Lists the documentation files for the DHCP server.</p><h4>Locate Configuration Files</h4><pre>rpm -qc dhcp-server</pre><p>Displays the configuration files associated with the DHCP server package.</p><h4>List All Files in the Package</h4><pre>rpm -ql dhcp-server</pre><p>Shows all files included in the DHCP server package</p><h4>Configuration Files</h4><h4>Main Configuration File</h4><p>The primary file for DHCP server configuration:</p><pre>vim /etc/dhcp/dhcpd.conf</pre><h3>step 2. Establishing a DHCP Server</h3><h4>basic configuration to define IP ranges, routers, lease times, and more:</h4><pre>authoritative;<br>subnet 192.168.1.0 netmask 255.255.255.0 {<br>    range 192.168.1.10 192.168.1.250;<br>    option routers 192.168.1.1;<br>    option domain-name-servers 8.8.8.8, 8.8.4.4;<br>    option broadcast-address 192.168.1.255;<br>    default-lease-time 600;<br>    max-lease-time 7200;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*27752HsSj9FoZbWR6VW7Yg.png" /></figure><h3>DHCP Service Management</h3><ul><li><strong>Check Service Status:</strong></li></ul><pre>systemctl status dhcpd</pre><ul><li><strong>Start the Service:</strong></li></ul><pre>systemctl start dhcpd</pre><ul><li><strong>Enable the Service to Start on Boot:</strong></li></ul><pre>systemctl enable dhcpd</pre><ul><li><strong>restart the Service:</strong></li></ul><pre>systemctl restart dhcpd</pre><p><strong>This server is now configured to assign the IP address to clients</strong></p><p>test DHCP server with a client</p><h3>Advanced Configurations</h3><h4>Excluding IP Ranges</h4><p>To exclude certain IP ranges, specify multiple ranges in the configuration:</p><pre>authoritative;<br>subnet 192.168.1.0 netmask 255.255.255.0 {<br>    range 192.168.1.100 192.168.1.110;<br>    range 192.168.1.120 192.168.1.150;<br>    option routers 192.168.1.1;<br>    option domain-name-servers 8.8.8.8, 8.8.4.4;<br>    option broadcast-address 192.168.1.255;<br>    default-lease-time 600;<br>    max-lease-time 7200;<br>}</pre><h3>Reserving IP Addresses</h3><p>Reserve a specific IP address for a device based on its MAC address:</p><pre>host debian-server {<br>    hardware ethernet 08:00:24:14:42:ec;<br>    fixed-address 192.168.1.104;<br>}</pre><h3>Blacklisting Devices (Deny List)</h3><p>Prevent specific devices from receiving an IP address:</p><pre>host win10 {<br>    hardware ethernet 08:00:17:5c:22:40;<br>    deny booting;<br>}</pre><h3>Whitelisting Devices (Allow List)</h3><p>Permit only known devices to access the network:</p><pre>subnet 192.168.1.0 netmask 255.255.255.0 {<br>    range 192.168.1.100 192.168.1.200;<br>    option routers 192.168.1.1;<br>    option domain-name-servers 8.8.8.8, 8.8.4.4;<br>    option broadcast-address 192.168.1.255;<br>    default-lease-time 600;<br>    max-lease-time 7200;<br>    deny unknown-clients;<br>}<br><br>host win10 {<br>    hardware ethernet 08:00:27:6c:22:80;<br>}</pre><h3>Creating IP Pools</h3><p>Define separate pools for allowed and denied devices:</p><pre>subnet 192.168.1.0 netmask 255.255.255.0 {<br>    range 192.168.1.100 192.168.1.200;<br>    option routers 192.168.1.1;<br>    option domain-name-servers 8.8.8.8, 8.8.4.4;<br>    option broadcast-address 192.168.1.255;<br>    default-lease-time 600;<br>    max-lease-time 7200;<br><br>    pool {<br>        range 192.168.1.100 192.168.1.150;<br>        deny unknown-clients;<br>    }<br><br>    pool {<br>        range 192.168.1.200 192.168.1.250;<br>        allow unknown-clients;<br>    }<br>}<br><br>host win10 {<br>    hardware ethernet 08:00:27:6c:22:80;<br>}</pre><h3>Conclusion:</h3><p>you can easly set up and manage a DHCP server to your network . Whether you need basic functionality or advanced configurations, this document provides all the essentials for smooth operation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc05fc77287d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[step-by-step guide covers the complete setup of a WordPress installation and LAMP (Linux, Apache…]]></title>
            <link>https://medium.com/@7024569052mayu/step-by-step-guide-covers-the-complete-setup-of-a-wordpress-installation-and-lamp-linux-apache-e61c5d8c9312?source=rss-d6256edbea8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e61c5d8c9312</guid>
            <dc:creator><![CDATA[Mayuresh patil]]></dc:creator>
            <pubDate>Tue, 12 Nov 2024 08:33:10 GMT</pubDate>
            <atom:updated>2024-11-12T08:33:10.393Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*izenJ5U-AA3xoHkJGsqwkQ.png" /></figure><h3>step-by-step guide covers the complete setup of a WordPress installation and LAMP (Linux, Apache, MySQL, PHP) stack, configuration for SSL, with some additional tools and utilities. Below is a summary and a few tips for some of the major tasks</h3><p>I’ll show you how to set up a LAMP (Linux, Apache, MySQL, PHP) stack on an Debian server and deploy WordPress securely. Whether you are a developer or a system administrator, this step-by-step tutorial will help you get your server up and running efficiently.</p><h3>Prerequisites</h3><ul><li>A fresh installation of Debian</li><li>Basic knowledge of the Linux command line</li><li>SSH access to the server</li></ul><p>let’s begin</p><h3>Updating Repositories and System Packages</h3><p>Ensure your repositories are updated and upgrade the system:</p><pre>apt update &amp;&amp; apt upgrade -y</pre><h3>Enabling SSH</h3><pre>systemctl start ssh<br>systemctl enable ssh</pre><p>ensure SSH is enabled</p><h3>Configuring a Static IP Address</h3><pre>nano /etc/network/interfaces</pre><pre>iface enp0s3 inet static<br>        address 192.169.1.50<br>        netmask 255.255.255.0<br>        broadcast 192.169.1.255<br>        gateway 192.169.1.1<br>        dns-nameservers 8.8.8.8</pre><h3>Installing Useful Packages and Bash Tools</h3><pre>apt install vim fonts-lato fonts-open-sans fonts-roboto fonts-mononoki fonts-indic grc gcc-multilib g++-multilib libtesseract-dev jq testssl.sh zsh libpcap-dev build-essential libssl-dev libffi-dev python-dev-is-python3 net-tools curl wget unzip -y</pre><h4>you can change shell for <strong>good interface in command line</strong></h4><h4>Changing the Default Shell to Zsh</h4><pre>apt install zsh zsh-autosuggestions zsh-syntax-highlighting -y<br>chsh -s $(which zsh)</pre><h4>Verify the change:</h4><pre>echo $SHELL<br>cat /etc/shells</pre><ul><li>place the .zshrc file at /root/.zshrc location</li><li>after placing exit the terminal and relogin</li></ul><h3>Install and start Apache:</h3><pre>apt install apache2 -y<br>systemctl restart apache2<br>systemctl enable apache2</pre><h4>check the port enable through netstat, here you will get :80 enabled</h4><h4>Disable directory listing:</h4><pre>sed -i &quot;s/Options Indexes FollowSymLinks/Options FollowSymLinks/&quot; /etc/apache2/apache2.conf<br>systemctl restart apache2</pre><h3>Installing PHP</h3><pre>apt install php php8.2 php8.2-common php8.2-mbstring php8.2-xmlrpc php8.2-soap php8.2-gd php8.2-xml php8.2-intl php8.2-mysql php8.2-cli php8.2-ldap php8.2-zip php8.2-curl php-xml composer -y<br>php -v</pre><h4>Modify php.ini:</h4><pre>nano /etc/php/8.2/apache2/php.ini</pre><h4>do this changes</h4><pre>memory_limit = 512m<br><br>max_execution_time = 500<br><br>max_input_vars = 10000<br><br>upload_max_filesize = 2048m<br><br>allow_url_fopen = Onsystemctl restart apache2.service</pre><h4>restart the apache service</h4><pre>systemctl restart apache2.service</pre><h4>Adding phpinfo.php file to the web folder ( /var/www/html/ )</h4><pre>nano /var/www/html/phpinfo.php<br><br>paste this in the file <br><br>&lt;?php<br>    phpinfo();<br>?&gt;</pre><h4>change the ownership of the files and folder to www-data (apache service user)</h4><pre>chown -Rv www-data:www-data /var/www/html/phpinfo.php</pre><h3>Installing MySQL Server</h3><pre>apt install wget<br>wget https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb<br>apt install ./mysql-apt-config_0.8.32-1_all.deb<br>apt update<br>apt install mysql-community-server -y</pre><p>Check MySQL status:</p><pre>systemctl restart mysql<br>systemctl enable mysql</pre><p>Login to MySQL:</p><pre>mysql -u root -p</pre><h3>Setting Up phpMyAdmin</h3><h4>Download and configure phpMyAdmin:</h4><pre>wget https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.zip<br>unzip phpMyAdmin-5.2.1-all-languages.zip<br>mv phpMyAdmin-5.2.1-all-languages /var/www/html/phpmyadmin<br>chown -R www-data:www-data /var/www/html/phpmyadmin<br>cp /var/www/html/phpmyadmin/config.sample.inc.php /var/www/html/phpmyadmin/config.inc.php</pre><h4>now provide the 32 bit key in config.inc.php file . you can generate the key using</h4><pre>pwgen 32 -1</pre><pre>nano config.inc.php<br><br>* paste the key and save the file<br>$cfg[&#39;blowfish_secret&#39;] = &#39;Ielotho7wohyaethais6ohSh5ohNgahw&#39;;</pre><h3>Configuring SSL for Apache</h3><h4>Create a directory and self-signed SSL certificate:</h4><pre>mkdir /etc/apache2/ssl<br>openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/domain-name.key -out /etc/apache2/ssl/domain-name.crt</pre><h4>Configure Apache for HTTPS:</h4><pre>nano /etc/apache2/sites-available/domain-name-ssl.conf</pre><h4>Paste and change the content</h4><pre><br>&lt;VirtualHost *:443&gt;<br>      ServerAdmin webmaster@example.com<br>      ServerName example.com<br>      ServerAlias www.example.com<br><br><br>      DocumentRoot /var/www/html/example.com<br><br>      SSLEngine on<br>      SSLCertificateFile /etc/apache2/ssl/example.crt<br>      SSLCertificateKeyFile /etc/apache2/ssl/example.key<br>      <br>      &lt;Directory /var/www/html/example.com&gt;<br>       Options Indexes FollowSymLinks<br>       AllowOverride All<br>       Require all granted<br>      &lt;/Directory&gt;<br>      <br>      ErrorLog ${APACHE_LOG_DIR}/example.com-error.log<br>      CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined<br>&lt;/VirtualHost&gt;</pre><h4>enable the SSL</h4><pre>a2ensite domain-name-ssl.conf</pre><pre>systemctl reload apache2 </pre><h3>Downloading and Installing WordPress</h3><pre>wget https://wordpress.org/latest.zip<br>unzip latest.zip<br>mv wordpress/* /var/www/html/folder-name<br>chown -R www-data:www-data /var/www/html/folder-name</pre><h4>make an entry of the IP and site name in the host file if you don’t use the DNS Server</h4><h4>Example:- 192.169.1.50 domain.local</h4><h3>Conclusion</h3><h4>You now have a fully functioning LAMP stack with WordPress running on your server, complete with SSL for secure connections. Test your setup and explore further customizations for added functionality.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e61c5d8c9312" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>