<?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: Abdul Ghani</title>
    <description>The latest articles on DEV Community by Abdul Ghani (@abdulghani200).</description>
    <link>https://dev.to/abdulghani200</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%2F51602%2F9b7a74b1-8d57-48ea-aa41-49d2db06d362.png</url>
      <title>DEV Community: Abdul Ghani</title>
      <link>https://dev.to/abdulghani200</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abdulghani200"/>
    <language>en</language>
    <item>
      <title>Real-time Phishing Attack Detection using ML 💻</title>
      <dc:creator>Abdul Ghani</dc:creator>
      <pubDate>Thu, 21 May 2020 18:21:06 +0000</pubDate>
      <link>https://dev.to/abdulghani200/real-time-phishing-attack-detection-using-ml-22d2</link>
      <guid>https://dev.to/abdulghani200/real-time-phishing-attack-detection-using-ml-22d2</guid>
      <description>&lt;h2&gt;
  
  
  My Final Project
&lt;/h2&gt;

&lt;p&gt;So, I've built this project called RPAD-ML in my final year. It is essentially an Android app coupled with a machine learning backend server which detects 🕵️ any link that is a possible phishing site in REALTIME ⚡. It can detect malicious/phishing links from any app. Open any app which has external links 🔗, RPAD-ML will detect it in no time and gives you a warning message⚠️ right away. &lt;/p&gt;

&lt;p&gt;&lt;iframe src="//www.slideshare.net/slideshow/embed_code/key/dVheHqxtxdaQEn" alt="dVheHqxtxdaQEn on slideshare.net" width="100%" height="450"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/l4k5RQF72TU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/abdulghanitech/rpad-ml/raw/master/app-release.apk"&gt;Download RPAD-ML Demo APK&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I know there are lots of things available like Google safe browsing. But those are limited to chrome web browser. So, What I've done is used a machine learning model of phishing sites combined with Google safe browsing which when given a URL predicts whether it is a phishing website or not. &lt;/p&gt;

&lt;h2&gt;
  
  
  Link to Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vWogaON8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-28d89282e0daa1e2496205e2f218a44c755b0dd6536bbadf5ed5a44a7ca54716.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/abdulghanitech"&gt;
        abdulghanitech
      &lt;/a&gt; / &lt;a href="https://github.com/abdulghanitech/rpad-ml"&gt;
        rpad-ml
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Real-time Phishing Attack Detection using ML 💻
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
rpad-ml&lt;/h1&gt;
&lt;p&gt;Real-time Phishing Attack Detection using ML 💻&lt;/p&gt;
&lt;p&gt;The repo contains code for both the ML server and the Android app which was used to detect phishing sites in real-time.
Below is a flow chart of it.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/abdulghanitech/rpad-ml/master/flowchart.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EGjA4-fB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/abdulghanitech/rpad-ml/master/flowchart.png" alt="Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/abdulghanitech/rpad-ml"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;h2&gt;
  
  
  How I built it
&lt;/h2&gt;

&lt;p&gt;I've got a machine learning model built using dataset of phishing sites.&lt;/p&gt;

&lt;h2&gt;
  
  
  DATA SELECTION
&lt;/h2&gt;

&lt;p&gt;The dataset is downloaded from UCI machine learning repository. The dataset contains 31 columns, with 30 features and 1 target. The dataset has 2456 observations.&lt;/p&gt;

&lt;h2&gt;
  
  
  MODELS
&lt;/h2&gt;

&lt;p&gt;To fit the models over the dataset the dataset is split into training and testing sets. The split ratio is 75-25.  Where in 75% accounts to training set. &lt;/p&gt;

&lt;p&gt;Now the training set is used to train the classifier. The classifiers chosen are:  &lt;/p&gt;

&lt;h4&gt;
  
  
  * Logistic Regression
&lt;/h4&gt;

&lt;h4&gt;
  
  
  * Random Forest Classification
&lt;/h4&gt;

&lt;h4&gt;
  
  
  * Support Vector Machine
&lt;/h4&gt;

&lt;p&gt;We will see which one fits best in our dataset.&lt;/p&gt;

&lt;h3&gt;
  
  
  1.Logistic Regression
&lt;/h3&gt;

&lt;p&gt;Fitting logistic regression and creating confusion matrix of predicted values and real values I was able to get 92.3 accuracy. Which was good for a logistic regression model.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.Support Vector Machine
&lt;/h3&gt;

&lt;p&gt;Support vector machine with a rbf kernel and using gridsearchcv to predict best parameters for svm was a really good choice, and fitting the model with predicted best parameters I was able to get 96.47 accuracy which is pretty good.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.Random Forest Classification
&lt;/h3&gt;

&lt;p&gt;Next model I wanted to try was random forest and I will also get features importances using it, again using gridsearchcv to get best parameters and fitting best parameters to it I got very good accuracy 97.26.&lt;/p&gt;

&lt;p&gt;Random forest was giving very good accuracy. We can also try artificial neural network to get a improved accuracy.&lt;/p&gt;

&lt;h2&gt;
  
  
  FEATURE IMPORTANCES
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dfZ4stnw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/abhishekdid/PHISHCOOP-phishing-website-detection/master/variable_Importances.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dfZ4stnw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/abhishekdid/PHISHCOOP-phishing-website-detection/master/variable_Importances.png" alt="FEATURE IMPORTANCE"&gt;&lt;/a&gt;&lt;br&gt;
ML Model: &lt;a href="https://github.com/abhishekdid/detecting-phishing-websites"&gt;Phishcoop&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hosting online as a server
&lt;/h2&gt;

&lt;p&gt;I've used the Heroku platform (Hobby plan provided by GitHub education) to host this machine learning model online. I used pickle to save and load the machine learning model and hosted it using Flask.&lt;/p&gt;

&lt;p&gt;The idea was to put this as a service and then call it from the android app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Android App
&lt;/h2&gt;

&lt;p&gt;Essentially, this is the front-end to call this service. I've used Android's accessibility API to access and intercept network. Hence, I got the URLs being opened in any app using this method. &lt;/p&gt;

&lt;p&gt;Now, after getting this url, firstly I call the Google safe browsing API to check whether it is a phishing site or not. If yes, I show a warning dialog else I call the machine learning backend server and using the result provided by it I again show warning dialog if the result comes as phishing site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Thoughts / Feelings / Stories
&lt;/h2&gt;

&lt;p&gt;This was more like a prototype. While it is not that perfect, but hey it works 🙌🏻. And the best thing is I've learnt so much by working on this project 🤓 &lt;/p&gt;

</description>
      <category>devgrad2020</category>
      <category>octograd2020</category>
      <category>showdev</category>
      <category>githubsdp</category>
    </item>
    <item>
      <title>How to build a PHP remote application update system with Authentication? </title>
      <dc:creator>Abdul Ghani</dc:creator>
      <pubDate>Mon, 15 Jan 2018 12:32:32 +0000</pubDate>
      <link>https://dev.to/abdulghani200/how-to-build-a-php-remote-application-update-system-with-authentication-49og</link>
      <guid>https://dev.to/abdulghani200/how-to-build-a-php-remote-application-update-system-with-authentication-49og</guid>
      <description>&lt;p&gt;Hey there! I have built an application in PHP. It is a paid application and contains a licensing system too. &lt;/p&gt;

&lt;p&gt;Now, I want to provide automatic updates to my clients. How should I do it? &lt;/p&gt;

&lt;p&gt;One important thing is the update URL should not be accessible by the normal public, only my registered application users can download the file. &lt;/p&gt;

&lt;p&gt;To be simple, I want authentication to be done while downloading the updates too so that others can't get updates without buying my application.&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>Any good PHP code obfuscators which are hard to deobfuscate?</title>
      <dc:creator>Abdul Ghani</dc:creator>
      <pubDate>Sun, 14 Jan 2018 13:36:34 +0000</pubDate>
      <link>https://dev.to/abdulghani200/any-good-php-code-obfuscators-which-are-hard-to-deobfuscate-312k</link>
      <guid>https://dev.to/abdulghani200/any-good-php-code-obfuscators-which-are-hard-to-deobfuscate-312k</guid>
      <description>&lt;p&gt;Any good code obfuscators? Tried phpprotect, etc. They just either scramble the identifiers or encode the code in base64. And it seems pretty easy to deobfuscate that. I want something really hard to deobfuscate i.e., get the original code.&lt;/p&gt;

&lt;p&gt;Also I tried FOPO.com.ar , actually it was working fine. But after a while my production server started giving error stating that the file in which I'm using FOPO's obfuscated code is Malicious. And the server is automatically deleting the file having FOPO'S obfuscated code.&lt;/p&gt;

&lt;p&gt;So guys, can you please suggest any good code obfuscator like FOPO (which uses a cipher key to deobfuscate the code)?&lt;/p&gt;

&lt;p&gt;P.S: Free ones first. :P&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
  </channel>
</rss>
