2014년 3월 16일 일요일

Why Attackers use proxy servers?

[Why attackers use proxy servers?]
  1. To hide the source IP address so that an attacker can hack without any legal corollary.
  2. To mask the actual source of the attack by impersonating a fake source address of the proxy.
  3. To remotely access intranets and other website resources that are normally off limits.
  4. To interrupt all the requests sent by an attacker and transmit them to a third destination, hence victims will only be able to identify the proxy server address.
  5. Attackers chain multiple proxy server to avoid detection.

[Proxy chaining tools]
  • Proxy workbench : Proxy workbench is a proxy server that displays the data passing through it in real time, allows you to drill into particular TCP/IP connections, view their history, save the data to a file, and view the socket connection diagram. The socket connection diagram is an animated graphical history of all of the events that took place on the socket connection. It is able to handle HTTPS(secure sockets)and POP3 natively.
        URL : http://proxyworkbench.com

  • Proxifier : Proxifier allows network applications that do not support working through proxy server to operate through a SOCKS or HTTPS proxy and chains. It allows you to surf websites that are restricted or blocked by your government, organization, etc. by bypassing the firewalls rules.
        URL : http://www.proxifier.com

  • Proxy switcher : Proxy switcher allows you to surf anonymously on the Internet without disclosing your IP address. It also helps you yo access various sites that have been blocked in the organization. It avoids all sorts of limitations imposed by sites.
        URL : http://www.proxyswitcher.com

  • SocksChain : SocksChain is a program that allows you to work with any Internet service through a chin of SOCKS or HTTP proxies to hide the ral IP address. It can function as a usual SOCKS-server that transmits queries through a chain of proxies. It can be used with client programs that do not support the SOCKS protocol, but work with on TCP-connection, such as TELNET, HTTP, IRC, etc. It hides your IP from being displayed in the server's log or mail headers.
        URL : http://ufasoft.com

  • TOR(The Onion Routing) : TOR is software and an open network that helps you defend against a form of network surveillance that threatens personal freedom and privacy, confidential business activities and relationships, and state security known as traffic analysis. You can use TOR to prevent websites from tracking you on the Internet. You can also connect to news sites and instant messaging services when these sites are blocked by your network administrator. TOR makes it difficult to trace your Internet activity as it conceals a user's location or usage.
        URL : https://www.torproject.org

Vulnerability scanning tools

1. Nessus(http://tenable.com)
Data gathering, Host identification, Port scan, Plug-in selection, reporting of data.

2. GFI LanGuard(http://www.gfi.com)
Selectively creates custom vulnerability checks, Identifies security vulnerabilities and takes remedial action, Creates different types of scans and vulnerability tests, Helps ensurce third party security applications offer optimum protection, Performs network devices vulnerability checks.

3. SAINT(http://www.saintcorporation.com)
Detects and fixes possible weaknesses in your network's security, Anticipates and prevents common system vulnerabilities, Demonstrates compliance with current government and industry regulations such as PCI DSS, NERC, FISMA, SOX, GLBA, HIPAA, and COPPA, Performs compliance audits with policies defined by FDCC, USGCB, and DISA.

4. Etc
Retina CS : http://go.eeye.com
Core impact Professional : http://www.coresecurity.com
MBSA : http://www.microsoft.com
Shadow security scanner : http://www.safety-lab.com
Nsauditor Network security audito : http://www.nsauditor.com
OpenVAS : http://www.openvas.org
Security manager plus : http://www.manageengine.com
Nexpose : http://www.rapid7.com
QualysGuard : http://www.qualys.com
Security Auditor's Research Assistant(SARA) : http://www-arc.com

2014년 3월 11일 화요일

Banner grabbing tools

1. ID Serve(http://www.grc.com)
ID Serve is used to identify the make, model, and version of any website's server softwarel it is also used to identify non-HTTP(non-web) Internet servers such as FTP, SMTP, POP, etc.

2. Netcraft(http://toolbar.netcraft.com)
Netcraft reports a site's operation system, web server, and netblock owner together with, if available, a graphical view of the time since last reboot for each of the computers serving the Web site.

3. Netcat(http://netcat.sourceforge.net)
Netcat is a networking utility that reads and writes data across network connections, with the help of the TCP/IP protocol/ It is designed to be a reliable "back-end" tool that can be used directly or easily driven by other programs and scripts. It provides access to the following key features:

  • Outbound and inbound connections, TCP or UDP, or any ports.
  • Featured tunneling mode, which also allows special tunneling such as UDP to TCP, with the possibility of specifying all network parameters(source port/interface, listening port/interface), and the remote host allowed to connect to the tunnel.
  • Built-in port-scanning capabilities, with randomizer.
  • Advanced usage options, such as buffered send-mode(one line every N seconds) and hexdump(to stderr or to a specified file) of transmitted and received data.
command ex). nc -vv www.localhost.com 80
                      GET /HTTP/1.0

2014년 3월 9일 일요일

Port scanning(advanced)

1. Xmas scan
Xmas scan is a port scan technique with ACK, RST, SYN, URG, PSH and FIN flage set to send a TCP frame to a remote device. If the target port is closed, then you will receive a remote system reply with a RST. You can use this port scan technique to scan large networks and find which host is ip and what services it is offering. It is a technique to describe all TCP flag sets. When all flags are set, some systems hang; so the flags most often set are the nonsense pattern URG-PSH-FIN. This scan only works when system are compliant with TCP/IP(RFC793).

command ex). nmap -sX -v 192.168.0.2

Advantage : ① It avoids the IDS and TCP three-way handshake.
                   ② It works on the UNIX platform only.






2. FIN scan
FIN scan is a type of port scan. the client sends a FIN packet to the target port, and if the service is not running or if the port is closed it replies to you with the probe packet with an RST.

command ex). nmap -sF -v 192.168.0.2






3. NULL scan
NULL scan send TCP packets with all flags turned off. It is assumed that closed ports will return a TCP RST. Packets received by open ports are discarded as invalid.
It sets all flags of TCP headers, such as ACK, FIN, RST, SYN, URG and PSH, to NULL or unassigned. When any packets arrive at the server, BSD networking code informs the kernel to drop the incoming packet if a port is open, or returns an RST flag if a port is close. This scan uses flags in the reverse fashion as the Xmas scan, but gives the same output as FIN and Xmas tree scans.
Many network codes of major operating systems can behave differently in terms of responding to the packet. This method does not work for Microsoft operating system.

command ex). nmap -SN -v 192.168.0.2

Advantage : It avoids IDS and TCP three-way handshake.
Disadvantage : It works only for UNIX.






4. IDLE scan
The idle scan is a TCP port scan method that you can use to send a spoofed source address to a computer to find out what services are available and offers complete blind scanning of a remote host. This is accomplished by impersonating another computer. No packet is send from your own IP address; instead, another host is used(often called a "zombie") to scan the remote host and determine the open ports. This is done by expecting the sequence number of the zombie host and if the remote host checks the IP of the scanning party, the IP of the zombie machine will show up.








5. ICMP Echo scanning/List scan
ICMP echo scanning is used to discover live machines by pinging all the machines in the target network. Attackers send ICMP probes to the broadcast or network address which is relayed to all the host addresses in the subnet. The live systems will send ICMP echo reply message to the source of ICMP echo probe.
ICMP echo scanning is not referred to as port scanning since it does not have a port abstraction. ICMP echo scanning is useful to determine which host in a network are active by pinging them all.

command ex). nmap -P 192.168.0.0/24
                      nmap -sn 192.168.0.2
                      nmap -sL -v 192.168.2.5

Advantage : ① A list scan can perform a good sanity check.
                  ② The incorrectly defined IP addresses on the command line or in an potion file are detected b the list scan. Te detected                       errors should be repaired prior to running any  "active" scan.



6. UDP scanning
UDP port scanners use the UDP protocol instead of TCP, and can be more difficult than TCP scanning. You can send a packet, but you cannot determine that the host is alive or dead or filtered. However, there is one ICMP that you can use to determine whether ports are open or closed. If you send a UDP packet to a port without an application bound to it, the IP stack will return an ICMP port unreachable packet. If any port returns an ICMP error, then it's closed, while the ports that didn't answer are either open or filtered by the firewall.
This happens because open ports do not have to send an acknowledgement in response to a probe, and closed ports are not even required to send an error packet.

command ex). nmap -sU -v 192.168.0.2

Advantage : The UDP scan is less informal regarding an open port, since there's no overhead of a TCP handshake. However, if ICMP is responding to each unavailable port, the number of total frames can exceed a TCP scan. Microsoft-based operating systems do not usually implement any type of ICMP rate limiting, so this scan operates very efficiently on Windows-based devices.

Disadvantage : The UDP scan provides port information only. If additional version information is needed, the scan must be supplemented with a version detection scan optaion(-sV) or the oprtation system fingerprinting option(-O).







7. Inverse TCP Flag scanning
Attackers send the TCP probe packets by enabling various TCP flag(FIN, URG, PSH) or with no flags. When the port is open, the attacker doesn't get any response from the host, whereas when the port is closed, Attacker receive the RST/ACK from the target host.
The SYN packets that are sent to the sensitive ports of the targeted hosts are detected by using security mechanisms such as firewalls and IDS. Programs such as sys-logger and Courtney are available to log half-open SYN flag scan attempts. At times, the probe packets enabled with TCP flags can pass through filters undetected, depending on the security mechanisms installed.
Probing a target using a half-open SYN flag is known as an inverted technique. It is called this because the closed ports can only send the response back. According to RFC 793, An RST/ACK packet must be sent for connection reset, when the port is closed on host side. Attackers take advantage of this feature to send TCP probe packets to each port of the target host with various TCP flags set.
Common flag ocnfigurations used for probe packet include:
  • A FIN probe with the FIN TCP flag set.
  • An XMAS probe with the FIN, URG, and PUSH TCP flags set.
  • A NULL probe with no TCP flags set.
  • A SYN/ACK probe
All the closed ports on the targeted host will send an RST/ACK response. Since the TCP protocol(RFC 793) standard is completely ignored in the operation system such as Windows, you cannot see the RST/ACK response when connected to the closed port on the target host. This technique is effective when used with UNIX-based operation system.

Advantages : Avoid many IDS and logging systems, highly stealthy.
Disadvantages : ① Needs raw access to network sockets, thus requiring superuser(root) privileges.
                        ② Mostly effective against hosts using a BSD-derived TCP/IP stack(Not effective against microsoft windows hosts in                               particular)






8. ACK Flag scanning
A stealthy technique is used for identifying open TCP ports. In this technique a TCP packet with ACK flag ON is sent to the remote host and then the header information of the RST packets sent by remote host are analyzed. Using this technique one can exploit the potential vulnerabilities of BSD derived TCP/IP stack. This technique gives good results when used with certain operation systems and platforms.

command ex). nmap -sA -v 192.168.0.2




9. Firewalls
Some firewalls may have rule sets that block IP fragmentation queues in the kernel(like the CONFIG_IP_ALWAYS_DEFRAG option in the Linux kernel), although this is not widely implemented due to the adverse effect on performance. Since several intrusions detection systems employ signature-based methods to indicate scanning attempts based on IP and/or the TCP headers, fragmentation is often able to evade this type of packet filtering and detection. There is a probability of network problems on the target network.

command ex). nmap -sS -T4(time delay) -A -f -v 192.168.0.2

2014년 3월 7일 금요일

[Scanning] Hping commands

[ICMP Ping]
using -l option
example) hping3 -l 8.8.8.8

[ACK scan on port]
using -A and -p(port) option
example) hping3 -A 8.8.8.8 -p 80

[UDP scan on port]
using -2 option
example) hping3 -2 -p 53

[Collecting initial sequence number]
using -O and -s option
example) hping3 8.8.8.8 -O -p 139 -s

[Firewalls and Time stamps]
using --tcp-timestamp option
example) hping3 -s 8.8.8.8 -p 80 --tcp-timestamp

[SYN scan on port 50~80(range)]
using -8 option and -v option
example) hping3 -8 50-80 -s 8.8.8.8 -v

[FIN, PUSH and URG scan on port 80]
using -F, -P option
example) hping3 -F -P -u 8.8.8.8 -p 80

[scan entire subnet for live host]
using -1, --rand-dest and -I(NIC interface) option
example) hping3 -1 8.8.8.x --rand-dest -I eth0

[Intercept all traffic containing HTTP signature]
using -9, -I option
example) hping3 -9 HTTP -I eth0

[SYN flooding a victim]
using -S, --flood option
example) hping3 -S 8.8.8.1 -a 8.8.8.254 -p 80 --flood
 *I warn you it is dangerous!
  Do not try this at real server.


2014년 3월 6일 목요일

Tools to search Internal URLs

[Netcraft]
URL : http://news.netcraft.com
Netcraft deals with web server, web hosting market-share analysis, and operating system detection. It provides free anti-phishing toolbar(Net craft toolbar) for Firefox as well as Internet Explorer browsers. The netcraft toolbar avoids phishing attacks and protects the Internet users from fraudsters. It checks the risk rate as well as the hosting location of the websites we visit.

[Link Extractor]
URL : http://www.webmaster-a.com/link-extractor-internal.php
Link Extractor is a link extraction utility that allows you to choose between external and internal URLs, and will return a plain list of URLs linked to or an html list. You can use this utility to competitor sites.

What is penetration testing? and Why penetration testing?

[What is penetration testing?]
Penetration testing is a method of evaluating security levels of a particular system or network. This helps you determine the flaws related to hardware and software. The early identification helps protect the network. If the vulnerabilities aren't identified early, then they become an easy source for the attacker for the intrusion.

During penetration testing, a pen tester analyzes all the security measures employed by the organization for design weaknesses, technical flaws, and vulnerabilities. There are two types of testing.

There are black box testing and white box testing.
Black box testing simulates an attack from someone who is unfamiliar with the system, and white box testing simulates an attacker that has knowledge about the system.
Once all the tests are conducted, the pen tester prepares a report and includes all the test results and the tests conducted along with the vulnerabilities found and the respective countermeasures that can be applied.
Finally, the pen tester delivers the report to executive, management, and technical audiences.

[Why penetration testing?]
Penetration testing is required because it helps you to:

  • identify the threats facing an organization's information assets.
  • Reduce an organization's IT security costs and provide a better Return on Security.
  • Investment(ROSI) by identifying and resolving vulnerabilities and weaknesses.
  • Provide an organization with assurance: a thorough and comprehensive assessment of organizational security covering policy, procedure, design, and implementation.
  • Gain and maintain certification to an industry regulation(BS7799, HIPAA, etc).
  • Adopt best practices by conforming to legal and industry regulations.
  • Test and validate the efficiency of security protections and controls.
  • Change or upgrade existing infrastructure of software, hardware, or network design.
  • Focus on high-severity vulnerabilities and emphasize application-level security issues to development teams and management.
  • Provide a comprehensive approach of preparation steps that can be taken to prevent upcoming exploitation.
  • Evaluate the efficiency of network security devices such as firewalls, routers and web servers.