April « 2011 « Security related discussions, articles, and tutorials

The Power of Information

Information within today’s society is a very interesting topic for discussion.  Add on security and we will have an all out debate.  Overall, information rules our society, everything runs off of some form of information in one way or another.  This is why information is power.  For example let’s say company xyz.com was breached and proprietary information was obtained by the attackers.  Well not so good for xyz.com but lets analyze the motivations of such attacks.  The majority of the time the motivation behind such attacks are to gain information which will lead to financial gain for the attackers.  There are many breaches every year, however the exact numbers are out of scope and not what this article is intended to be about.  Information is a priceless commodity which in the wrong hands can bring down an entire company, cost the company lots of money, ruin reputations, and feed the attackers to breach more companies.  Knowing this sheds light on how much power information has within our society.

What is information?  Information is just about everywhere to name a few, data, databases, webpages, intellectual property, credit card numbers, identities, social security numbers, drivers license numbers, addresses, etc.  I believe there is a need to protect sensitive and confidential information.  This boils down to how to classify information with categories such as Top Secret, Classified, and Public to name a few classifications.  If information is not classified by the nature of the information then how would we know what to secure and what information to make public?  Therefore, information classification should be one layer within a multi-layered information security program.

As a pentester I get a thrill out of trying to circumvent security layers and gain unauthorized access to a box who doesn’t.  However, the main reason behind a pentest is to identify vulnerabilities and use the vulnerabilities to successfully breach a organizations system and report the risk to the organization of the specific vulnerabilities and exploits discovered.  Well to truly report the risk of a vulnerability to an organization the tester needs to analyze what can be done once he has successfully exploited a system.  This is called post-exploitation.  Is it enough that I got a shell on a box during a pentest?  No, a full scale penetration test should include post-exploitation tasks too see what information can be gained from the attack.  Yes it is helpful to let the organization know if a server is vulnerable to a remote code execution vulnerability or a SQL injection attack.  However, it would be more valuable to the organization if the tester was able to identify and gain access to sensitive information within the institution.  There are numerous security researchers who actively research post exploitation and methods to achieve different types of information from a system or network.  Metasploit started to port post-exploitation scripts into actual modules.  As well as Carlos Perez, who has done some awesome research and crafted some excellent scripts for post-exploitation work.

To sum this all up, information is key to any profession within the security industry.  My opinion is not new, I just felt compelled to write a brief blog stating my opinion.  Overall, my motivation behind this article was seeing many client pentest reports that companies gave them automatically generated scan reports and nothing else.  This is not good for the simple fact that it does not indicate a proper penetration test was conducted for the client.  For a great description of what penetration testing should include for an organization I highly recommend heading over to PTES (Penetration Testing Execution Standard).

No Comments »

Mac OSX nmap nse script search

OK,

I was tired of listing the directory manually everytime I wanted to use a nmap nse scrip on my mac. Therefore, I wrote this simple script to either display all nmap nse script or search for a string and list the relevant scripts. Call me lazy but I am all about saving time and increasing efficiency. I also love the challenge =)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/python

""" Nmap Script search, this script displays all nmap scripts, or searches for a
string within the title of the nmap script"""


import sys,subprocess,os

# to see if nmap is installed and the script directory is in default directories

usage = """
nmap nse search script coded by bostonlink @ pentest-labs.org
example1: ./nse_search.py -l
example2: ./nse_search.py -s smb"""


help = """
Nmap nse search script options

-l = lists all nmap nse scripts within the /nmap/scripts directory

-s [search string] = searches all nse scripts and prints ones that matches the search string\n"""


if len(sys.argv) <= 1:
    print usage
    print help
    sys.exit(0)

cwd = os.getcwd()
script_path = '/usr/local/share/nmap/scripts/'

def chg_dir():
    if cwd != script_path:
        os.chdir('/usr/local/share/nmap/scripts/')
        print '\nChanged CWD to default nmap script directory\n'

def list_all():
    cmd1 = subprocess.Popen(["ls","-l"], stdout=subprocess.PIPE)
    lista = cmd1.stdout.read()
    cmd1.wait()
    print lista

def list_search():
    if len(sys.argv) <= 2:
        print usage
        print help
        sys.exit(0)
    else:
        search_string = sys.argv[2]
        cmd1 = subprocess.Popen(["ls"], stdout=subprocess.PIPE)
        lista = cmd1.stdout.read()
        cmd1.wait()
        lista1 = lista.strip().split()
        for i in lista1:
            if search_string in i:
                print i

if sys.argv[1] == '-l':
    chg_dir()
    list_all()

if sys.argv[1] == '-s':
    chg_dir()
    list_search()

Note: same path in a Ubuntu Linux environment

you can use wget to download the script http://pentest-labs.org/downloads/nse_search.py

No Comments »