Ammonite Scripts allow you to import Other Scripts, just like any Bash or Python scripts do. Furthermore, they let you cleanly depend on third party libraries: since Ammonite runs on the JVM, this means Ivy Dependencies. Ammonite will ensure that the relevant dependencies are always downloaded and used, and you never need to worry about remembering to "install" things before running your scripts!
download redsn0w 0.9.7 rc1 152
The Ammonite Scala REPL and Scripts are meant to be extended: you can load in arbitrary Java/Scala modules from the internet via import $ivy. Using this third-party code, you extend the REPL to do anything you wish to do. Simple install Java, download Ammonite onto any Linux/OSX machine, and try out one of these fun snippets! They work directly in the Ammonite-REPL, or you can save them to Scala Scripts if you want something more permanent.
In this example, we use the Requests-Scala library to download a URL, and we use uPickle and OS-Lib to parse the JSON and write it into files. uPickle and Ammonite-Ops are bundled with the Ammonite REPL and are used internally.
This is a small example, but it illustrates the potential: if you find yourself needing to scrape some website or bulk-download large quantities of data from some website's HTTP/JSON API, you can start doing so within a matter of seconds using Ammonite. The results are given to you in nicely structured data, and you can deal with them using any Java or Scala libraries or tools you are used to rather than being forced to munge around in Bash. Sometimes, you may find that you need to get data from somewhere without a nice JSON API, which means you'd need to fall back to Scraping HTML...
The page above contains the documentation for the latest stable version of Ammonite, 3.0.0-M0. Ammonite also publishes unstable versions, the latest of which is 3.0.0-M0-3-c2d1e706 and is available for direct download:
It's important to note that there are currently no controls over uploads; anything you share can be downloaded by any number of people at any given time. With this in mind, consider sharing a small number of files from the example.
This signature detects attempts by users to download attachments from MSN Hotmail. MSN Hotmail is a web-based email application that allows users to send and receive emails with attachments. This may be a violation of your organization's Acceptable Use Policy.
This signature detects attempts by users to download potentially compressed attachments from MSN Hotmail. Compressed files could contain hazardous executables (viruses often send their malicious payloads compressed in a .zip file). MSN Hotmail is a web-based email application that allows users to send and receive emails with attachments. This may be a violation of your organization's Acceptable Use Policy.
This signature detects attempts to download an executable binary file disguised as an image. Attackers can disguise a malicious program (executable binary file) as an image on a Web page. When a user downloads the image to the local Web cache using a Web browser, the image does not display (because it is not a valid image file). Attackers can then exploit additional vulnerabilities to trick the user into running the malicious file from the Web cache.
This signature detects attempts to download a compressed (ZIP) file when a media file was requested. Some video players attempt to load the compressed file as a media file, which can result in arbitrary code execution.
This signature detects the runtime behavior of spyware SearchitBar, an adware application. This spyware adds a toolbar to Internet Explorer, then records user Web activity. It also downloads and executes programs from its controlling server.
This signature detects the runtime behavior of spyware IST-Slotchbar. This spyware adds a toolbar to Internet Explorer and displays pop-up advertisements, some of which are porn related. When a user performs a search in the toolbar, it directs the search results to third party links. IST-Slotchbar also periodically connects to its controlling server to download self-updates, and to install other adware and spywares such as TargetSaver and InternetOptimizer.
This signature detects the runtime behavior of spyware WhenU-WeatherCast. This spyware downloads and displays targeted advertisements based on the user zip code. It also installs WhenU.WhenUSearch, another spyware application.
This signature detects the runtime behavior of spyware Codename Alvin, a keylogger. After infecting a host, this spyware enables attackers to capture screen images, monitor user Web activity, and log keystrokes made by the host user. It also downloads and installs code from its controlling server.
This signature detects the runtime behavior of spyware BargainBuddy, an adware application that runs at Windows startup. This spyware uses browser helper objects to tracks user Web activity. It also downloads and displays pop-up advertisements.
This signature detects the runtime behavior of the spyware DaoSearch, a browser hijacker. This spyware modifies browser settings and redirects search results to daosearch.com. It also downloads and installs updates from its controlling server.
This signature detects the runtime behavior of the spyware SpyWareNuker. This spyware downloads and displays pop-up advertisements, and can track Web user activity. It can also silently upgrade itself periodically by contacting its root server.
This signature detects the runtime behavior of the spyware CnsMin-3721, an Internet Explorer browser hijacker. This spyware replaces the IE search feature with a Chinese search site. It also downloads and installs code from its controlling server.
This signature detects the runtime behavior of spyware eZula-Toptext. This spyware modifies browser behavior to highlight and add hyperlinks to the most frequently searched keywords. These links redirect users to advertiser's sites. It also downloads and installs updates from its controlling server.
This signature detects the runtime behavior of the spyware Earthlink Toolbar. This spyware records user system information at Internet Explorer startup, then sends the data to its controlling server. It also downloads updated links to display on its toolbar.
This signature detects the runtime behavior of Twister, a free program for finding and downloading MP3 and other music files on the Internet. After installation, this spyware also downloads and installs other spyware applications.
This signature detects the runtime behavior of MediaSeek.pl Client, a P2P file-sharing application. This spyware contains a Web-based interface that enables users to search for and download MP3 files. It also displays advertisements and installs other spyware, such as Gator, on the host.
This signature detects the runtime behavior of spyware Sandesa, a Trojan downloader. This spyware downloads and executes files from a predefined Web site. It also sends an ICQ message to notify a remote attacker that the Trojan was executed.
This signature detects the runtime behavior of the spyware Pacimedia, an adware application. After installation, this spyware downloads and installs other adware and spyware, such as BookedSpace, BargainBuddy, Ebates Moneymaker, VirtualBouncer, ExactSearchBar, and EliteBar.
This signature detects the runtime behavior of spyware SimBar, an adware application. This spyware installs a toolbar in the Internet Explorer and redirects an address bar search result to its controlling server (www.simplenter.com). It also downloads and installs code from its controlling server.
This signature detects the runtime behavior of Golden Palace Casino, an adware application. This spyware displays pop-up advertisements. It also downloads additional executables from the Web and updates itself periodically.
This signature detects the runtime behavior of Trojan.Downloader.Agent.TL. Trojan.Downloader.Agent.TL drops and executes Trojans on a user's computer. When executed, it attempts to connect to its controlling server 213.21.215.* to download and install malicious code. It can also send some information back to its controlling server without the user's consent. A successful attack can cause a denial of service (DoS) or execution of remote arbitrary code.
This signature detects the runtime behavior of abcSearch; abcSearch is an Internet Explorer hijacker that is usually installed by ActiveX drive-by downloads. It redirects user requests to other web sites and also generates untargeted pop-up advertisements periodically.
This signature detects the runtime behavior of Abwiz.C. Abwiz.C is a Trojan program. It downloads code or self-updates from its controlling server and executes the code on a user's computer. Abwiz.C also sends information about the compromised computer to some IP addresses through HTTP.
This signature detects the runtime behavior of Super Fast MP3 Search. This spyware enables users to search and download music files without a P2P network. It also changes the Internet Explorer home page setting and downloads and installs other spyware, such as eZula.
This signature detects the runtime behavior of Spam-Maxy. Spam-Maxy has its own SMTP engine. It downloads e-mail addresses from its controlling server and sends out the e-mails to these addresses. It slows down the infected machine by increasing network traffic and CPU utilization.
This signature detects attempts to exploit a known remote file inclusion vulnerability in 4images. It is due to insufficient validation of user-supplied input in download.php, categories.php or global.php scripts. A remote attacker can exploit this by enticing a target to open a malicious URL link. A successful attack can result in arbitrary code execution and loss of sensitive information.
This signature detects attempts to exploit a known vulnerability in Microsoft's .NET Framework. It is due to an error in calculating a buffer length for percent-encoded URI components of a UTF-8 encoded URI. Remote attackers could exploit this vulnerability by enticing a target user to either download and execute a malicious XAML browser application, or download and execute a malicious .NET application. A successful exploitation attempt could result in the execution of arbitrary code in the security context in which the .NET application runs. 2ff7e9595c
Comments