Answer:How do I find vulnerabilities in software?

Target

First you need to choose a platform and a piece of software to attack. To begin I would choose something that is open source. There are several advantages to this; the main one being that you can look at the source code. You then need to pick an aspect that you would like to attack. For example, maybe you want to attack the UDP implementation of the Linux networking stack.

Performing an analysis on a closed source piece of software means you’re disassembling the binary, rooting through instructions, and debugging the process. This is long and tedious. Better to get a grasp as to what breaks code with source code before you go looking for it in disassembly.

By being specific in your target allows you to systematically analyze a piece of software.

Analyze

With your target in mind begin your analysis of the portion of the software you want to find vulnerabilities.

  • Determine which source code files affect your target.
  • With open source you can insert debug messages to ensure you understand the code flow. This can be extremely important. Knowing what sections of code are called, and the variables that lead to that outcome is key in understanding what is going on.
  • Run code analysis tools over the project. Depending on the project this might be a moot point, but they can be handy and catch common programming errors.
  • Enable all of the compiler build flags. Your goal is to find programming errors. What better way than to have the compiler tell you where it thinks the code is bad.

These are just a few of the things you can do to analyze the software. Build a list of possible coding errors.

Triggering

Now with a list of possible coding flaws you need to determine if you can trigger them. Again, debug messages will help you. Go back to the source code and determine what exactly needs to happen for each coding flaw to break the software. You’re not looking for full exploitation, you just want the code to crash, or do something unexpected. You need to determine what could trigger a coding flaw. This could be anything from affecting a length variable, tricking a function to take a path to process data incorrectly, etc. Some coding flaws just aren’t triggerable, but that’s the nature of vulnerability analysis.

At this point you have a list of flaws, and a list of ideas for each flaw on what might trigger it to do something unexpected.

Fuzzing

Now you write code. Using pretty much whatever programming language is convenient for the software you’re attacking. You could write Python code to throw specific packets at network devices to attempt to take down the UDP implementation of a Linux based device.

The goal is to implement your triggers, and hope that the code works the way you think. Your debug messages will be helpful here.

  • They can tell you if the code path taken is abnormal.
  • They can show you variables that you’re attempting to manipulate
  • They ensure that your trigger is doing what you expect, and you can adjust it accordingly.

With any luck you’re able to cause something different to happen. Maybe that can lead to code execution, maybe not. That’s a horse of a different color.

Reality

Vulnerability analysis takes time. A lot of time. You’re not going to spend a day analyzing software and find 10 vulnerabilities. The unofficial average for vulnerability analysis is 1 vulnerability per 3 months of analysis. You can double that time if you’re analyzing a non-open source project.

via @RoraΖ : http://security.stackexchange.com/a/92003?stw=2

Malware Analysis

Cheat Sheet for Analyzing Malicious Software
https://zeltser.com/reverse-malware-cheat-sheet/

5 Steps to Building a Malware Analysis Toolkit Using Free Tools
https://zeltser.com/build-malware-analysis-toolkit/

Several Posts on Malware Analysis Tools
https://zeltser.com/several-posts-on-malware-analysis-tools/

Tips on Malware Analysis from Jake Williams
https://zeltser.com/tips-on-malware-analysis-from-jake-williams/

How Malicious Code Can Run in Microsoft Office Documents
https://zeltser.com/malicious-code-inside-office-documents/

Free Automated Malware Analysis Sandboxes and Services
https://zeltser.com/automated-malware-analysis/

Malware Sample Sources for Researchers
https://zeltser.com/malware-sample-sources/

How Security Companies Assign Names to Malware Specimens
https://zeltser.com/malware-naming-approaches/

Extracting Malicious Flash Objects from PDFs Using SWF Mastah
https://zeltser.com/extracting-swf-from-pdf-using-swf-mastah/

How Antivirus Software Works: 4 Detection Techniques
https://zeltser.com/how-antivirus-software-works/

NetworkMiner for Analyzing Network Streams and Pcap Files
https://zeltser.com/networkminer-for-analyzing-network-traffic/

3 Free NirSoft Tools for Malware Analysis
https://zeltser.com/processactivitymonitor-and-regfromapp/

Process Monitor Filters for Malware Analysis and Forensics
https://zeltser.com/process-monitor-filters-for-malware-analysis/

How to Get into Digital Forensics or Security Incident Response
https://zeltser.com/how-do-get-into-forensics-or-incident-response/

Analyzing Suspicious PDF Files With PDF Stream Dumper
https://zeltser.com/pdf-stream-dumper-malicious-file-analysis/

Learning Malware Analysis Through Practice
https://zeltser.com/learning-malware-analysis-through-practice/

One-Click Windows Memory Acquisition with DumpIt
https://zeltser.com/memory-acquisition-with-dumpit-for-dfir-2/

Analyzing Suspicious PDF Files With Peepdf
https://zeltser.com/peepdf-malicious-pdf-analysis/

6 Free Local Tools for Analyzing Malicious PDF Files
https://zeltser.com/tools-for-malicious-pdf-analysis/

3 Tools to Scan the File System With Custom Malware Signatures
https://zeltser.com/custom-signatures-for-malware-scan/

Protect Files From Malware With Windows Integrity Levels
https://zeltser.com/windows-integrity-levels-malware-protection-files/

Protect Processes from Spyware With Windows Integrity Levels
https://zeltser.com/windows-integrity-levels-for-spyware-protection-processe/

Researching Malicious Websites: A Few Tips
https://zeltser.com/tips-for-researching-malicious-websites/

Introduction to Malware Analysis – Free Recorded Webcast
https://zeltser.com/malware-analysis-webcast/

Tips for Converting Shellcode to x86 Assembly
https://zeltser.com/convert-shellcode-to-assembly/

Analyzing Malicious Documents Cheat Sheet
https://zeltser.com/analyzing-malicious-documents/

Getting Started With Malware Analysis
https://zeltser.com/get-started-with-malware-analysis/

Mastering 4 Stages of Malware Analysis
https://zeltser.com/mastering-4-stages-of-malware-analysis/