Sunday, April 30, 2017

Negatives of React and Angular

Both React JS and Angular JS are great frameworks; however, they both focus on the one page app, which works with phone specific devices but it doesn't work as well with web apps which want to have multiple pages. Additional packages needed to be downloaded to make the frameworks work with multiple pages.

In React JS, the lingo used to make multiple pages is called routing. The two main ones recommended in the Meteor guide are kadira: flow-reactor and react-router. The first router is a Meteor specific one; the second one is a react specific one. Other ones are IronRouter and BackboneJS. But, BackboneJS is considered by some to be outdated now.

Routing is where you dictate where React routes traffic to your app. It is mostly done by mapping files with words used to reference those files. For example if you want to make error pages such as 500 or 404 then you can map those files/pages to the word, 'error' then specify where it goes depending on which kind of error it is.

Hopefully this article helps you properly prepare for the limitations when making web apps in React or Angular, especially in React since that was mentioned the most.

Saturday, April 8, 2017

MongoDB

MongoDB is a NoSQL database. It is pretty easy to use on the command line interface.

So far my favorite aspect of NoSQL is making collections (tables in SQL) and entries on the fly. It doesn't require a schema, although a schema still helps organize and validate Mongo databases. If you don't have a collection then it makes the collection for you to put in your new data entry. SQL is a lot harder to modify without massively disrupting existing tables and code.

I recommend you try MongoDB the next time you need a database.

Friday, July 1, 2016

How to Make a Facebook Bot on a Windows Machine

Recently Facebook launched its Facebook Messenger bot API. Since then there has been a surge of developers and jobs opening up for chatbots. Being a bit curious about how easy it is to make a chatbot, what with companies and small time developers already having bots for services such as IRC, I decided to dip my toes into the bot developer world.

Since then I have been following this messenger bot guide, Develop your first Facebook messenger bot in PHP by Adnan Siddiqi,  with a couple of google searches added in.

Previously your app was default connected to the various Facebook products. But now, after making a new basic app, you have to "+Add Product." Then you have to find the messenger product and you'll then get the Messenger Platform "Getting Started" message button.

For example he already has cURL on his machine, either because it's UNIX based or because he'd previously downloaded it for his Windows machine. Here's the link to download the cURL binary (a.k.a. exe file) if you also need it: https://curl.haxx.se/dlwiz/ User the download wizard. Note: You're likely going to need the x86 version unless you have IA-64 (Intel Architecture 64) then you'd use that version.

Later on, I had to learn how to manipulate my files using the windows command prompt to make .htaccess files since Windows doesn't let you make those files naturally. It involved the "ren" command which I'm guessing is short for rename with the current file name location and the new name.

Right now everything works but cURL in my XAMPP setup. But without cURL my messenger app can't send messages back in the proper format to the messenger API and therefore it is only a silently receiving non talking bot. :(

Friday, February 26, 2016

Shell Script If Then Else logic

I was recently learning some shell scripting, so of course I only wanted some commands to trigger if a condition was met.
I wrote

if [condition] then
     echo "work please if"
else
  echo "work please else"
fi

but I kept getting an error on Terminal saying there was something wrong with my else, some unexpected else encountered.
So of course the problem was that if and then were on the same line, causing the if statement to be interpreted as a one-liner instead of a multi-liner.

Solution:
if [condition]
then
  echo "work please if"
else
  echo "work please else"
fi

I hope this helps some of you out there!

Thursday, February 18, 2016

Review of Introduction to Secure Computation Article

I recently read an article about secure computation by a undergrad. It was a great introduction in many ways. It clearly outlined and described the idea behind secure computation, how it is developed, and a brief idea of how to implement it. Each graphic included was useful and greatly illustrated the encryptions mentioned in the text.
But above all of those positive qualities, the most outstanding trait of the article is its slow introduction and but gradually more in-depth explanation of each cryptography term, leaving the reader more knowledgeable at the end of the article while leaving links for the reader to peruse if one wants to learn more about cryptography.

Thursday, December 17, 2015

Steps to Working as a Pentester

1. Read and follow public information and web security information and news.

2. Be a script kiddy and learn how those scripts run in a safe environment.

3. Write lots of code with validation and preventative measures. i.e. form validation to prevent SQL injections

  1. SQL injections - prepared statements, mysqli_real_escape_string()
  2. Cross site scripting(XSS) - preventing injected scripts from running on websites i.e. choose to interpret user content as stuff like &lt; instead of <
  3. Cross Site Request Forgery (CSRF) - prevent using one time tokens in forms


4. Submit reports to the Common Vulnerabilities and Exposures system.

5. Try them on existing companies with bug bounty systems like Reginaldo Silva did. Remote code executions provide nice payouts but remember to strike the proper balance between ethics, moral, and common sense behavior. Also, try to be upfront about the vulnerabilities presented.

6. If it's at an in house company then make sure they already have a risk assessment and security features and protocols in place for if security is breached. This article mentions steps to take before undergoing a pentest: https://www.cybersecdefense.com/information-security-testing-continuum/

Wednesday, September 16, 2015

Wifi Ethernet and Network Connections Stop Working After Laptop Battery Dies or Ubuntu Update

The other day I accidentally let my Ubuntu computer die. I didn't think much of it until I turned on my laptop a few days later and couldn't connect to a single wifi network, despite "Enable Networking" being checked.

In fact, it said No Network Devices Available.

The internet had a lot of solutions. After determining that I did have my drivers but they weren't detected, I kept thinking I'd have to reinstall the drivers to get my system to detect them.

But I finally found a solution on askubuntu.com which works on any Network or wireless card. What you do is boot/load an earlier version of the kernel, before the wifi stopped working.   So, during startup, right after pressing the power button on your laptop, hold down the shift key until GRUB comes up. It'll give you an option to view Advanced Additional Settings for Ubuntu (If you don't get that option then just move onto the next step). Then, a list of Ubuntu kernels will come up. The default one to load is the top one. Instead select the next highest, which should also be a smaller number. Then, your computer should load as normal and your wifi should be back up and working.

Don't choose the recovery mode ones.

Happy Internetting!