CASL - Security language
Translation of the original in Catalan. Read it in: CatalàCastellano
CASL is a programming language for exploits and other similar security tests...
Roses Labs Exclusive for Channel #Networking IRC by Conde Vampiro -------------------------- ||Security Languages|| -------------------------- CASL ---- CASL (Common Attack Script Language) was designed with the purpose of providing a powerful tool to the US army. Logically this was a secret project, so practically there is no information about CASL on the Internet. I want to make it clear that neither I nor anyone at Roses Labs has been the creator of CASL, we have simply made a library to improve the language itself, adding more functions and we have made numerous examples in CASL. CASL came to light at the beginning of 1998, when the creators of CASL themselves released their masterpiece, a document that is a must read titled: "Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection" by Thomas H. Ptacek and Timothy N. Newsham. In this document CASL was used to run the tests against the different NIDS (Network Intrusion Detection System) evaluated. It is available at http://www.nai.com/services/support/whitepapers/security/IDSpaper.pdf CASL is a product that belongs to NAI (Network Associates, Inc. http://www.nai.com) which is part of its vulnerability scanner CyberCop. Possibly the best commercial tool I have known. And around the middle of 1999 NAI decided to create an independent CASL interpreter for Linux without the need to use CyberCop. The good thing about using this powerful language is that it lets us create programs in a few minutes to check the (in)security of a network or system. Since CASL is a low level language, in the sense that we only focus on what interests us without having to worry about opening/closing sockets, etc.. the CASL interpreter takes care of all that. We only go for what interests us :) This is a huge advantage since we can write powerful programs in very few lines of code, besides being a language that is very easy to learn if we have some notions of C and TCP/IP. CASL uses TCP/IP, UDP and ICMP. We can write programs to: - Test a NIDS. - Virtual firewall - Scanners - DoS (Denial of Service) - sniffers NASL ---- NASL (Nessus Attack Scripting Language) is a language that is part of the Nessus vulnerability scanner (http://www.nessus.org). Nessus is a scanner in client/server mode. It is THE tool par excellence in the free software world :) Although technically it is not a well designed tool, it serves its purposes well. Through the use of NASL we can create Security Tests ("Security Test codes") in little time. We could say that when a new flaw appears we can in less than an hour create a Security Test to detect the flaw. We have to bear in mind that we can only use NASL through Nessus, and the server only runs currently on *nix systems, but there are clients for both Linux and Windows. Among all the languages I am going to comment on, NASL is the only one that uses a template that we are obliged to follow if we want to write a Security Test for Nessus. This template is divided in two parts: 1- "(description)" Here we would put all the information about the flaw (Author, Problem, Solution, Platform, type of flaw, , family, Language, etc..) 2- In this part it would be the code to detect the flaw itself. Nessus divides its flaw detection into families, which would be the following: - Gain a shell remotely - CGI abuses - Backdoors - Remote file access - Denial of Service - Useless services - NIS - Finger abuses - Firewalls - Misc. - FTP - Gain root remotely - SMTP problems - Port scanners - RPC We can see that Nessus has many families. If we only use the Security Tests that Nessus includes, we can detect about 280 flaws approximately for *nix or Windows systems. ELZA ---- Elza is a script language designed to analyse web servers, which can be of great help to us. It is written in Perl and its language is therefore similar to Perl. We can use Elza both on *nix or Windows. We can find the Elza interpreter at http://phiphi.hypermart.net Through the use of Elza we can: - Examine the content of a website (Its HTML code). - Steal forms (Hijacking). - Use Elza under SSL. - Launch brute force attacks - Automate the filling of forms. - Detect CGIs. - Evaluate NIDS attacks under HTTP. - Use proxies - Rotate proxies or webs. Elza lets us use its script remotely as if they were CGI and/or from a web page. This is a great advantage since we can put our scripts on one machine and use them from another :) SuperCACLS ---------- SuperCACLS is an interesting tool for Windows NT systems, this language based on ".bat" script (the classic one :) can be very useful to us to check the security of an NT system or an NT network. This set of utilities is a commercial product of Trusted Systems Services, Inc. (http://www.trustedsystems.com). We will have total control over the ACLs (Access Control List). It is designed to integrate without problems in NT and requires little learning on the part of the security expert :) Through the use of SuperCACLS we can: - Search/Delete/Change permissions on files or users. - Search/Delete registry entries - Both locally and remotely. As I said before, SuperCACLS is made up of a set of programs, which are the following: - PRACL = Shows us the ACL in the same format as the NT ACL Manager. - REACL = To modify the ACLs. (directories, users, groups.)
- MODACL = Modifies, removes or adds individual ACLs. - TAKEOWN = To take control of an object, or take total control of ourselves :)
- RENAMEACL = Changes all the occurrences of a user or group from one ACL to another. As we can appreciate it is an interesting tool if we work on NT systems, since we can analyse the whole registry looking for "strange" entries, suspicious users, etc. AdvancedChecker --------------- AdvancedChecker is another commercial product of Trusted Systems Services, Inc. (http://www.trustedsystems.com). It is a powerful script language that lets us check the security of our NT network or even of our IDSs. It is a formidable tool both for security experts or administrators in NT environments. This tool does require some learning but it is easy :) Through AdvancedChecker we can: - Check/set the policies. - Review the ACLs. - Review the Logs. - Modify the Registry. - Sign the files. - Send mail if we detect anomalies. - Check the passwords. Using AdvancedChecker we will be able to check the security of our NT system, quickly and effectively. --------------------- ||General Discussion|| --------------------- When we are going to write code to test a theory or simply to detect a flaw, we must be careful with what we do. For example, a few months ago an adv came out from ADM about several flaws in Bind, possibly one of the most important flaws to make it to 2000. If we write code to detect this flaw, we cannot write a program that exploits it, because if we did our scanner could not continue with the analysis, that is why vulnerability scanners simply detect the version. We are not always interested in exploiting the flaw :) If we use CASL we must be careful, since we can inflict damage on the network we want to analyse and I don't think the administrators are going to like it, especially if it is a production system. When writing Security Tests for Nessus, we must do it in NASL logically. But we must pay a lot of attention to what we do since the NASL interpreter does not detect if we have made a mistake when writing the Security Test. This can be frustrating when looking for our flaw and it can also cause the Nessus server to crash!!! There are more languages focused on security, which can be of great interest to us, which are part of well known security tools. - Packet Shell, is a language similar to CASL for solaris environments, available at http://playground.sun.com/ - N-Code is a powerful language from the well known NIDS NFR (http://www.nfr.net). NFR is one of the commercial NIDS par excellence, for Linux environments. NFR is a powerful sniffer programmable through the use of N-Code. - POST Platform for Open Security Testing (POST) is a language similar to Perl for writing Security Tests for the vulnerability scanner from the WebTrends house, known as WebTrends Security Analyzer, available at http://www.webtrends.com/default.htm ------------------------ Conde Vampiro Roses Labs / w00w00 http://www.roses-labs.com Advanced Security Research.