Skip to main content

Exploiting Software Haking_ATTACK PATTERN - Part 4

Network Pen Testing
Breaking the Corporate Network through Hackers Perspective

We will discuss about performing network penetration testing on the corporate network using grey box approach and exploiting the vulnerabilities from hackers perspective. This article concentrates
majorly on usage of NMap, Nessus, Metasploit for network penetration testing.

There are 3 approaches for performing network penetration testing.

• White box is when the tester has access to the complete network structures and admin credentials.
• Grey box is when the tester has the basic network information but does not have admin credentials.
• Black box is when the tester has no access to any of the information for starting penetration testing.

Generally prefer to go for grey box approach. We are targeting the corporate network we have to
keep in mind the we are bound to follow regulatory compliance and using the black box approach
may result in wrong results, incomplete vulnerability detection, targeting wrong IP’s (non critical systems from business perspective) and may lead to lots of rework.
If you use white box then obviously you are not performing any magic for the client, since you already have the network diagram, you have the admin credentials and you have access through the
ACL and Firewalls. White box may not detect the hidden intrusion points and may not give real understanding of what an attacker can do, since all the information is already available with the tester
and there is very little possibility that the tester will try to exploit the vulnerabilities. White box testing is only good if you are targeting to achieve compliance report for audit committee review.

On the other hand Grey Box approach detects lots of hidden intrusion points such as older version
of antivirus, insecure database services and weak passwords. Grey Box can perform real magic
for the client since the client is giving the list of IP’s and sharing a little information about the network – such as make of servers, firewalls and If required ACL access and not sharing any Admin
Credentials. It is really interesting to penetrate using minimal information. It also gives clear idea to
the client that how a person with malicious intent breaks into the network just by using end user access.
Standard Grey Box penetration testing approach follows the following steps (Figure 1).













On the Job – Penetration Testing

During the projects it is quite interesting to penetrate the servers and network through some trusted
software’s such as antivirus, databases and others. There are some services, packages which
are widely used to almost types of network environments such as SNMP, Anti Virus, SQL and Oracle
Databases. Will be showing examples for exploiting the same.

Oracle and SQL Enumeration and Exploitation

Database services are the most important part of the penetration testing activity. Most of the organizations have oracle and SQL databases installed for HRMS and finance servers. By default
SQL database runs on port 1433 and oracle runs on 1502. Both the databases have default
username and passwords such as “sa” / “sa”, SCOTT / TIGER and sometimes even blank password.
The oracle listener service (before v.10) is vulnerable for Oracle Listner Service Blank Password
Attack. Since the service act on operating system level and perform the commands given from the
remote listener an attacker can connect to remote listener service, access the db and perform administrative activities if the password is missing for oracle listener service.




































SQL database has default “sa” accounts. If the password is missing or kept default for the “sa” account then an attacker can easily login to remote SQL server, access the database tables, perform
administrative activities, issue command to SQL Server and gain administrative control over remote
operating system. In the below example  have exploited the remote SQL database using the default
username and password (sa/sa) and later accessed the base operating system with admin rights (Figure 2-Figure 6).










Exploiting Anti Virus Services

During one of the project I had an opportunity to play with antivirus installation and exploit the “Symantec Common Base Agent CreateProcessA() Function Remote Command Execution Vulnerability” The client team had installed Symantec on all the servers and was 100% sure that it will protect the critical servers and data residing in it. It is always advisable that multiple tiers of security solutions should be used. We always need to make sure that from the operating system level to the network level everything should be configured securely. In this scenario the client team only relayed on the Symantec installation and forgot the rest. Even for antivirus and end point security products security config. And patch management is required which was missing in this case.
Metasploit has various exploits / auxiliary, used following auxiliary to exploit the remote server
 (Figure 7).





























































































Using the CMD Command  added backdoor admin user into remote servers administrator group.
Then Using DameWare NT Utilities  checked the user rights and performed enumeration activities
(Figure 8).
Enabled the RDP using Dameware on the remote machine and gained GUI Access (Figure 9).
Collected the admin password hashes using metasploit meterpreter (hashdump module) and
by using the psexec was able to login into the domain controller since the password was same for
all the servers (Figure 10-Figure 13).
Then copied the entire domain controller’s password database by using PwDump (Figure 14).
Passwords were cracked using l0phtcrack (Figure 15).
And now we control entire domain with all the users and services access.
We used grey box approach for the above exploitation and just by using the basic information
we were able to gain to access over the entire network.

Popular posts from this blog

Bypassing Web Application Firewall Part - 2

WAF Bypassing with SQL Injection HTTP Parameter Pollution & Encoding Techniques HTTP Parameter Pollution is an attack where we have the ability to override or add HTTP GET/POST parameters by injecting string delimiters. HPP can be distinguished in two categories, client-side and server-side, and the exploitation of HPP can result in the following outcomes:  •Override existing hardcoded HTTP parameters  •Modify the application behaviors   •Access and potentially exploit uncontrollable variables  • Bypass input validation checkpoints and WAF rules HTTP Parameter Pollution – HPP   WAFs, which is the topic of interest, many times perform query string parsing before applying the filters to this string. This may result in the execution of a payload that an HTTP request can carry. Some WAFs analyze only one parameter from the string of the request, most of the times the first or the last, which may result in a bypass of the WAF filters, and execution of the pa...

Bypassing Web Application Firewall Part - 4

Securing WAF and Conclusion DOM Based XSS DOM based XSS is another type of XSS that is also used widely, and we didn’t discuss it in module 3. The DOM, or Document Object Model, is the structural format used to represent documents in a browser. The DOM enables dynamic scripts such as JavaScript to reference components of the document such as a form field or a session cookie, and it is also a security feature that limits scripts on different domains from obtaining cookies for other domains. Now, the XSS attacks based on this is when the payload that we inject is executed as a result of modifying the DOM environment in the victim’s browser, so that the code runs in an unexpected way. By this we mean that in contrast with the other two attacks, here the page that the victim sees does not change, but the injected code is executed differently because of the modifications that have been done in the DOM environment, that we said earlier. In the other XSS attacks, we saw the injected code was ...

Hacking - Best OF Reverse Engineering - Part7

How to Disassemble and Debug Executable Programs on Linux, Windows and Mac OS X? The Interactive Disassembler Professional (IDA Pro) is an extremely powerful disassembler distributed by Hex-Rays. Although IDA Pro is not the only disassembler, it is the disassembler of choice for many malware analysts, reverse engineers, and vulnerability analysts. The program is published by Hex-Rays (http://www.hex-rays.com), which provides a free version for noncommercial uses that is one version less than the current paid version. It is now version 5.0. IDA Pro will disassemble an entire program and perform tasks such as function discovery, stack analysis, local variable identification, and much more. IDA Pro includes extensive code signatures within its Fast Library Identification and Recognition Technology (FLIRT), which allows it to recognize and label a disassembled function, especially library code added by a compiler. IDA Pro is meant to be interactive, and all aspects of its disasse...