<?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>DEV Community: Godwin Incrisz</title>
    <description>The latest articles on DEV Community by Godwin Incrisz (@incrisz).</description>
    <link>https://dev.to/incrisz</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%2F2351736%2F00848f83-049e-4a0c-8aed-1c460fb27be5.png</url>
      <title>DEV Community: Godwin Incrisz</title>
      <link>https://dev.to/incrisz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/incrisz"/>
    <language>en</language>
    <item>
      <title>Host Responded to 4 TCP SYN Probes on Port 24567 from Source Port 53(PCI DSS Cloudflare Resolved)</title>
      <dc:creator>Godwin Incrisz</dc:creator>
      <pubDate>Sun, 10 Nov 2024 03:53:18 +0000</pubDate>
      <link>https://dev.to/incrisz/pci-dss-alert-resolved-understanding-addressing-tcp-source-port-pass-firewall-false-positives-fg6</link>
      <guid>https://dev.to/incrisz/pci-dss-alert-resolved-understanding-addressing-tcp-source-port-pass-firewall-false-positives-fg6</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the world of PCI DSS compliance, businesses must frequently undergo security scans to identify vulnerabilities and ensure sensitive payment data remains safe. While these scans are critical, they can sometimes produce false positives—alerts that signal issues where there are none due to unique configurations or third-party services.&lt;/p&gt;

&lt;p&gt;One common alert businesses encounter is the "TCP Source Port Pass Firewall" warning, which may indicate that a host responded to probes on one source port (usually associated with DNS) but not on others. Let’s explore why this specific alert often results from legitimate traffic routing and how to resolve it confidently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the TCP Source Port Pass Firewall Alert
&lt;/h2&gt;

&lt;p&gt;The alert in question might look something like this:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“&lt;strong&gt;The host responded 4 times to 4 TCP SYN probes sent to destination port 24567 using source port 53. However, it did not respond at all to 4 TCP SYN probes sent to the same destination port using a random source port.&lt;/strong&gt;”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Proverbs 3:5-6&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In simpler terms, this alert suggests that the firewall is allowing TCP traffic on &lt;strong&gt;destination port 24567&lt;/strong&gt; when the &lt;strong&gt;source port&lt;/strong&gt; is set to 53 but is blocking the same destination port when accessed from other, random source ports. Automated PCI DSS scans may flag this as a potential vulnerability, suggesting inconsistent firewall behavior that could theoretically allow unauthorized access.&lt;/p&gt;

&lt;p&gt;However, this alert is likely a false positive for companies that use Cloudflare or similar CDN (Content Delivery Network) services. Because Cloudflare manages traffic through a secure network using dynamic IPs and customized routing, certain probes may be flagged even though they reflect normal, secure operations. These probes do not reach the internal network but instead reflect Cloudflare’s legitimate traffic handling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to Resolve This False Positive
&lt;/h2&gt;

&lt;p&gt;If you encounter this type of alert, follow these steps to assess and document it as a false positive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Check the IP Source&lt;/u&gt;&lt;/strong&gt;: Identify if the flagged IP is part of a CDN or proxy service like Cloudflare. In this case, any responses to probes on port 24567 are likely due to Cloudflare’s security and routing protocols, not a misconfiguration in your network.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Review Firewall and Network Policies&lt;/u&gt;&lt;/strong&gt;: Ensure your firewall settings securely control access to critical ports, like port 53. This will confirm that any unique responses are coming from your CDN rather than an internal vulnerability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Submit a False Positive Report&lt;/u&gt;&lt;/strong&gt;: Once you’ve documented the details, submit a report to your PCI DSS scanning provider. The report should explain that the alert stems from legitimate Cloudflare traffic and confirm that your network remains PCI-compliant and secure.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Maintaining PCI DSS compliance requires diligence, and that includes correctly identifying and resolving false positives. By understanding common alerts like the TCP Source Port Pass Firewall and documenting them accurately, you can ensure your compliance status remains correct without unnecessary remediation.&lt;/p&gt;

&lt;p&gt;For a sample report template that you can send directly to your PCI scanning provider, download the False Positive Report: TCP Source Port Pass Firewall (CVSS Base Score 5.0) document &lt;a href="https://github.com/Incrisz/Blog-post/tree/main/PCI-DSS" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>pci</category>
      <category>cloudflare</category>
      <category>dss</category>
      <category>port24567</category>
    </item>
    <item>
      <title>Lloyds Payment Card Integration Using PHP: Cardnet Hosted Payment Page (Connect Solution)</title>
      <dc:creator>Godwin Incrisz</dc:creator>
      <pubDate>Tue, 05 Nov 2024 13:05:31 +0000</pubDate>
      <link>https://dev.to/incrisz/lloyds-payment-card-integration-using-php-cardnet-hosted-payment-page-connect-solution-4c8d</link>
      <guid>https://dev.to/incrisz/lloyds-payment-card-integration-using-php-cardnet-hosted-payment-page-connect-solution-4c8d</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Integrating a secure and reliable payment gateway is essential for e-commerce businesses. Lloyds Bank's Cardnet® Hosted Payment Page solution, Connect, offers a secure way to process transactions. Customers are redirected to a Lloyds-hosted page to complete their transactions and then return to your website. Here’s how you can set it up, integrate it with PHP, and make it a seamless experience for your users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features of Lloyds Cardnet Hosted Payment Page
&lt;/h2&gt;

&lt;p&gt;The Hosted Payment Page provided by Lloyds Cardnet has several benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;u&gt;Customization&lt;/u&gt;: Personalize the payment page with your business logo and colors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;u&gt;PCI DSS Compliance&lt;/u&gt;: Cardnet handles PCI DSS and 3D Secure compliance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;u&gt;Real-time Reporting&lt;/u&gt;: Access customer analytics 24/7 through Cardnet’s reporting dashboard.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Proverbs 11:1&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Your Hosted Payment Page
&lt;/h2&gt;

&lt;p&gt;Before diving into the code, it's essential to set up your merchant account with Lloyds Cardnet. Here are the main points to remember:&lt;br&gt;
&lt;strong&gt;&lt;u&gt;Merchant Account Creation&lt;/u&gt;&lt;/strong&gt;: Businesses must set up a merchant acquiring an account with Cardnet. This process can take 7-10 working days.&lt;br&gt;
&lt;strong&gt;&lt;u&gt;Integration Timeline&lt;/u&gt;&lt;/strong&gt;: Connecting the hosted payment page to a website generally takes 2-4 weeks, depending on the site's complexity.&lt;br&gt;
&lt;strong&gt;&lt;u&gt;Funding Time&lt;/u&gt;&lt;/strong&gt;: Funds are typically transferred in 3-5 working days, with a faster 2-day option available for a fee.&lt;/p&gt;
&lt;h2&gt;
  
  
  Integration Code Walkthrough
&lt;/h2&gt;

&lt;p&gt;In this guide, we'll walk through the PHP code that integrates Lloyds' Hosted Payment Page with your website, ensuring a smooth and secure checkout experience for your customers.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1&lt;/strong&gt;: Setting Up Basic Configuration
&lt;/h2&gt;

&lt;p&gt;Begin by configuring the essential fields based on your account details and requirements. The following PHP code defines transaction properties such as Store ID, timezone, transaction type, and more.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$storeId = "store_id";            // Unique identifier for your store
$timezone = "Europe/London";        // Timezone setting
$txntype = "sale";                  // Transaction type (e.g., sale)
$chargetotal = "13.00";             // Amount to charge
$currency = "826";                  // ISO 4217 currency code (826 for GBP)
$txndatetime = gmdate("Y:m:d-H:i:s"); // Transaction datetime in UTC
$responseSuccessURL = "https://example.com/success.php"; // Success redirect URL
$responseFailURL = "https://example.com/failure.php";    // Failure redirect URL
$checkoutoption = "combinedpage";   // Checkout option
$hash_algorithm = "HMACSHA256";     // Hashing algorithm for secure transactions

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/u&gt;:This setup ensures that your transaction is configured according to Lloyds' requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 2:&lt;/strong&gt; Creating the Concatenated String
&lt;/h2&gt;

&lt;p&gt;Next, create a concatenated string from these values. This string will be hashed to maintain security. Here’s how it’s built:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Concatenate the required fields to create a single string for hashing
$stringToHash = $chargetotal . "|" . $checkoutoption . "|" . $currency . "|" .
    $hash_algorithm . "|" . $responseFailURL . "|" . $responseSuccessURL . "|" .
    $storeId . "|" . $timezone . "|" . $txndatetime . "|" . $txntype;

echo "Concatenated String: " . $stringToHash . "&amp;lt;br&amp;gt;";

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/u&gt;:The concatenated string is critical for creating a hash that will verify the transaction's integrity.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 3&lt;/strong&gt;: Generating the Hash
&lt;/h2&gt;

&lt;p&gt;To ensure the transaction’s security, use the hash_hmac() function with the SHA-256 algorithm. This generates a hashed version of the concatenated string using your shared secret, which is essential for secure transactions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Secret key for hashing (from your secure configuration)
$sharedSecret = "shared_secret"; 

// Generate the hash using SHA-256 algorithm and encode it in base64
$hash = hash_hmac('sha256', $stringToHash, $sharedSecret, true);
$hashOutput = base64_encode($hash);

echo "Generated Hash: " . $hashOutput . "&amp;lt;br&amp;gt;";

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/u&gt;:This hash will be sent along with your form data to verify that the transaction details haven't been tampered with.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 4&lt;/strong&gt;: Building the HTML Form
&lt;/h2&gt;

&lt;p&gt;Now, create the HTML form that will send this data to Lloyds' payment gateway. This form includes the hashed value (hashExtended) and other transaction details. When the user submits the form, they’ll be directed to the Lloyds-hosted payment page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;form method="post" action="https://test.ipg-online.com/connect/gateway/processing"&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label for="storename"&amp;gt;Store ID:&amp;lt;/label&amp;gt;
       &amp;lt;input type="text" name="storename" value="&amp;lt;?php echo $storeId; ?&amp;gt;" /&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label for="timezone"&amp;gt;Timezone:&amp;lt;/label&amp;gt;
       &amp;lt;input type="text" name="timezone" value="&amp;lt;?php echo $timezone; ?&amp;gt;" /&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label for="txntype"&amp;gt;Transaction Type:&amp;lt;/label&amp;gt;
       &amp;lt;input type="text" name="txntype" value="&amp;lt;?php echo $txntype; ?&amp;gt;" /&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label for="chargetotal"&amp;gt;Transaction Amount:&amp;lt;/label&amp;gt;
       &amp;lt;input type="text" name="chargetotal" value="&amp;lt;?php echo $chargetotal; ?&amp;gt;" /&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label for="currency"&amp;gt;Currency (ISO4217):&amp;lt;/label&amp;gt;
       &amp;lt;input type="text" name="currency" value="&amp;lt;?php echo $currency; ?&amp;gt;" /&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label for="txndatetime"&amp;gt;Transaction DateTime:&amp;lt;/label&amp;gt;
       &amp;lt;input type="text" name="txndatetime" value="&amp;lt;?php echo $txndatetime; ?&amp;gt;" /&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label for="responseSuccessURL"&amp;gt;Response Success URL:&amp;lt;/label&amp;gt;
       &amp;lt;input type="text" name="responseSuccessURL" value="&amp;lt;?php echo $responseSuccessURL; ?&amp;gt;" /&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label for="responseFailURL"&amp;gt;Response Fail URL:&amp;lt;/label&amp;gt;
       &amp;lt;input type="text" name="responseFailURL" value="&amp;lt;?php echo $responseFailURL; ?&amp;gt;" /&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label for="hashExtended"&amp;gt;Hash Extended:&amp;lt;/label&amp;gt;
       &amp;lt;input type="text" name="hashExtended" value="&amp;lt;?php echo $hashOutput; ?&amp;gt;" readonly="readonly" /&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label for="hash_algorithm"&amp;gt;Hash Algorithm:&amp;lt;/label&amp;gt;
       &amp;lt;input type="text" name="hash_algorithm" value="&amp;lt;?php echo $hash_algorithm; ?&amp;gt;" readonly="readonly" /&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;label for="checkoutoption"&amp;gt;Checkout Option:&amp;lt;/label&amp;gt;
       &amp;lt;input type="text" name="checkoutoption" value="&amp;lt;?php echo $checkoutoption; ?&amp;gt;" /&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;input type="submit" value="Submit"&amp;gt;
&amp;lt;/form&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/u&gt;:This form is automatically populated with PHP values, ensuring each transaction's details are securely embedded.&lt;/p&gt;

&lt;p&gt;Happy coding, and cheers to a successful integration!&lt;br&gt;
&lt;a href="https://github.com/Incrisz/Blog-post/tree/main/lloyds" rel="noopener noreferrer"&gt;Github Link for code &lt;/a&gt;&lt;/p&gt;

</description>
      <category>lloyds</category>
      <category>php</category>
      <category>cardnet</category>
    </item>
  </channel>
</rss>
