Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - grep

#61
Dudas y pedidos generales / Re:Control remoto PC
Octubre 18, 2016, 03:00:26 PM
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
No voy a generar un post por una duda, y enviar un privado seria restringir la informacion libre.
Es mi opinion al respecto del "desvirtue" .. Ademas de que tecnicamente estamos hablando de control-remoto de archivos al menos.

El tema de conversación es la forma de acceder remotamente al ordenador, pero no sobre el registro de logs en el ordenador remoto.

Yo generaría un post por la duda. No lo tomes a mal por favor, es solo una sugerencia.


You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Y sobre lo que quiero saber, si es que me podes dar una mano, es si desde el navegador de archivos del Kali, entro a los archivos compartidos de una pc en la misma red... queda un log en algun lado?

Tengo entendido que el file manager de Kali es Nautilus, y te encuentras en una workgroup (se comparte archivos, impresoras y conexión a internet por el protocolo SMB o NBT+SMB, You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

En Windows el sinónimo de "log" es "evento" y el sinónimo de "logging" es "monitoring" o "audit". Por defecto Windows no monitorea actividades de login y acceso a archivos. Pero se puede activar a través de "Local Policies\Audit Policy" (Directivas Locales\Directiva de auditoría):

Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

File access
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Si el administrador del Windows que comparte el archivo ha habilitado la audoría, entonces tiene registrado el evento de tu acceso.

Saludos
#62
Dudas y pedidos generales / Re:Control remoto PC
Octubre 18, 2016, 01:04:08 PM
@You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login estamos desvirtuando el hilo de la conversación.

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Pero eso quiero saber, si esa intrusion "simple" que hice, queda registrada en algun lado.

Si seguimos hablando de ssh la respuesta es "si". Por defecto ssh registra las cualquier actividad de autenticación y autorización.

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Porque en el caso de ser un honeypot estaria en problemas?

No tengo cómo responder a esta pregunta :P

Saludos
#63
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Hace poco que he instalado Comodo Firewall y le tengo configurado el ARP, como puedo saber de donde viene ese aviso de (Intrusiones en la red). Y cómo se interpreta o se busca.

No comprendo bien la pregunta, pero si lo que quieres es ver más detalles de los logs te comparto la guía del Comodo Internet Security (CIS):

View CIS Logs
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Firewall Logs
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login


You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Me dado cuenta que son equipos que tengo en red que tengo, los puedo poner como abiertos?. o se puede poner que tengan acceso pero no a todo, si no lo acepto yo. Para que esten señalzados cuando me salga toda una lista y pueda diferencia lo que conozco de lo que no.

Puedes ver las diferentes opciones de configuración del Firewall:
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

específicamente te puede interesar las 'Network Zones' y 'Global Rules'.

Saludos
#64
Dudas y pedidos generales / Re:Control remoto PC
Octubre 18, 2016, 11:47:15 AM
Normalmente el comienzo, la autenticación, y la terminación de cada conexión al sshd se envía al system log (conocido como syslog o syslogd), que para linux se distribuye bajo el paquete Sysklogd. Por defecto estos logs son identificados con el facility AUTH y el priority INFO, entonces el syslog envía estos mensajes al destino configurado en /etc/syslog.conf o /etc/syslog.

Comunmente los logs de autenticaciones al sshd se registran en /var/log/secure (o /var/log/auth.log para sistemas basados en debian comunmente). Puedes ejecutar, por ejemplo, el siguiente comando para obtener los últimos trescientos registros relacionados con el ssh:

Código: text
tail -300 /var/log/auth.log | grep 'sshd'


El facility y el priority de los logs de sshd se pueden modificar en el archivo de configuración sshd_config (/etc/ssh/sshd_config), específicamente con las opciones LogLevel y SyslogFacility.

Fuente:
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Saludos
#65
Suponinedo que tu PC cuenta con un adaptador para conectarse con otros dispositivos por bluetooth,

cuando Windows se sincroniza con el dispositivo, el sistema operativo designa un puerto llamado COMX (siendo X algún número) a este para permitir la comunicación. Entonces lo que buscas es la manera de enviar comandos a un puerto COM.

A continuación comparto enlaces que muestran como hacer esto con diferentes programas:

PuTTy (además del enlace compartido por @You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login)
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

PowerShell
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Tera Term
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Saludos
#66
Cada línea es una forma de describir un RR (Resource Record).

El formato es el mismo al especificado en el apartado "5.1. Format" del "RFC1035 - DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION" (este apartado especifica la forma de representar un RR en un archivo comunmente conocido como zone file o master file) que es:

<domain-name> <rr>

<rr> tiene el siguiente formato:

[<TTL>] [<class>] <type> <RDATA>

El formato de <RDATA> depende de <type> y <class>. Si <class> es IN (Internet) y <type> es A (Host Address), entonces el formato de <RDATA> es <internet-address> (como lo especifica el A RDATA format).


Resumiendo, la salida que obtienes es:

<domain-name> <TTL> <class> <type> <internet-address>



You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Pero no entiendo los número que salen en la imagen, el que significan.

NUMEROS +IN + A(adreess) + IP

¿Que son esos números?

<TTL> es el tiempo (en segundos) que puede ser mantenido en caché un RR, después de ese tiempo la fuente del RR debe ser consultada nuevamente. Un TTL=0 implica que el RR no debe ser mantenido en caché, osea que sólo debe utilizarse para la transacción en progreso. Un TTL=0 algunas veces puede implicar la presencia de datos muy volátiles.

Para los valores posibles de <type> y <class> puedes ver los apartados "3.2.2. TYPE values" y "3.2.4. CLASS values" del FRC1035 respectivamente.


Fuente:
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Saludos
#67
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Pero yo quiero aprender todos estos temas(especialmente a partir del Cap. 6) en C++ que es el lenguaje que estoy aprendiendo (mi primer lenguaje) y ademas no tengo el nivel de ingles suficiente para leer y aprender de un libro en ingles. Les dejare el indice del libro que les mencione para que me recomienden, algun libro como este pero en C++. Obiamente me refiero a algun libro en español por lo ya dicho. Calculo que si hay de Delphi tendria que haber de C++?

Este es el indice del libro resumido a los titulos de las unidades:

Capítulo 1: Delphi y el API de Windows
Capítulo 2: Los requisitos del logotipo Windows y Delphi
Capítulo 3: Funciones de creación de ventanas
Capítulo 4: Funciones de gestión de mensajes
Capítulo 5: Funciones de información sobre ventanas
Capítulo 6: Funciones de procesos e hilos
Capítulo 7: Funciones de librerías de enlace dinámico
Capítulo 8: Funciones del registro y de ficheros de inicialización
Capítulo 9: Funciones de gestión de memoria
Capítulo 10: Funciones de manejo del portapapeles
Capítulo 11: Funciones de entrada
Capítulo 12: Funciones de entrada/salida a disco
Capítulo 13: Funciones de cadenas y átomos
Capítulo 14: Funciones de información del sistema
Capítulo 15: Funciones de temporización

Lo dudo, salvo algún que otro tutorial de introducción, lo que encontrarás en español fácilmente es sobre la "Windows UI API" (la interfaz de usuario de la WinAPI).


You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Hola, me podrias pasar el PDF.. me intereso.

Los Tomos de Delphi: El núcleo del API Win32
Autor: Ayres, John y otros
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

El libro es una traducción de "The Tomes of Delphi 3: Win32 Core Api" o "Tomes of Delphi: WIN 32 CORE API Windows 2000 Edition".

Saludos
#68
Hacking / Re:Nuestro primer BufferOverflow.
Octubre 13, 2016, 12:38:34 PM
Básicamente la respuesta es que las direcciones del stack no son las mismas durante la ejecución, es por esto que puedes obtener el resultado inesperado de retornar a direcciones que no son las correctas. Esto puede suceder por diversos motivos:

- ASLR habilitado en el sistema que ejecuta al programa
- Variables de entorno al momento de ejecutar el programa
- Argumentos que se pasan al programa que se ejecuta

El problema de las Variables de entorno y Argumentos del programa sucede porque el loader de Linux coloca estos valores en el espacio de memoria del proceso justo antes del comienzo del stack (variables de entorno en lo más alto del espacio de memoria, después los argumentos de programa, después el stack).


ASLR
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Y si lo corro directamente desde la terminal tampoco ejecuta el shellcode.

Aquí te enfrentas con una protección del SO. Linux por defecto tiene habilitada su implementación de la técnica denominada ASLR (Address Space Layout Randomization).

GDB por defecto deshabilita ASLR para el proceso mediante la opción set disable-randomization on, pero también se puede habilitar ejecutando set disable-randomization off. Puedes ver si esta opción se encuentra habilitada ejecutando show disable-randomization.

Para deshabilitar ASLR en Linux, sin GDB, puedes:

(1) Setear personality options (-R o --addr-no-randomize para habilitar ADDR_NO_RANDOMIZE, osea, deshabilitar ASLR) en el proceso a ejecutar:

Código: text
setarch $(uname -m) -R <tu_programa>


o, para bash y sus procesos hijos:

Código: text
setarch $(uname -m) -R /bin/bash


(2) Deshabilitar ASLR para los procesos ejecutando:
Código: text
sysctl -w kernel.randomize_va_space=0


Citar
randomize_va_space:

This option can be used to select the type of process address
space randomization that is used in the system, for architectures
that support this feature.

0 - Turn the process address space randomization off.  This is the
    default for architectures that do not support this feature anyways,
    and kernels that are booted with the "norandmaps" parameter.

1 - Make the addresses of mmap base, stack and VDSO page randomized.
    This, among other things, implies that shared libraries will be
    loaded to random addresses.  Also for PIE-linked binaries, the
    location of code start is randomized.  This is the default if the
    CONFIG_COMPAT_BRK option is enabled.

2 - Additionally enable heap randomization.  This is the default if
    CONFIG_COMPAT_BRK is disabled.

    There are a few legacy applications out there (such as some ancient
    versions of libc.so.5 from 1996) that assume that brk area starts
    just after the end of the code+bss.  These applications break when
    start of the brk area is randomized.  There are however no known
    non-legacy applications that would be broken this way, so for most
    systems it is safe to choose full randomization.

    Systems with ancient and/or broken binaries should be configured
    with CONFIG_COMPAT_BRK enabled, which excludes the heap from process
    address space randomization.
Fuente:
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

(3) Bootear el kernel con el parámetro norandmaps


Variables de entorno
Para el problema de las variables de entorno, puedes ejecutar tu programa de esta forma:

Código: text
env - /path/to/<tu_programa>


o, tu programa dentro del GDB con:

Código: text
env - gdb /path/to/<tu_programa>


env - es igual a env -i. De esta forma se ejecuta un programa con un entorno limpio (osea, sin variables de entorno).

GDB, además, crea sus propias variables de entorno. Esto lo puedes ver ejecutando show env, y puedes borrar dichas variables con unset env <VARIABLE>.


Argumentos del programa
Es recomendable que ejecutes tu programa de la forma /path/to/tu_programa ya que argv[0] almacena el nombre del programa de la forma en que se ejecuta (si ejecutas tu programa como ./stack, entonces argv[0]="./stack", y si ejecutas /path/to/tu_programa, entonces argv[0]="/path/to/tu_programa").

Entonces, es mejor que ejecutas tu programa como /path/to/tu_programa y ejecutes gdb como gdb /path/to/tu_programa


NOTA:
Todo esto que te explico lo puedes encontrar en esta fuente:
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Además se comparte un bash script que sirve como wrapper para ejecutar un programa permitiendo que el stack mantenga las mismas direcciones:

Citar
When learning to exploit with memory safety vulnerabilities, I recommend to use the wrapper program below, which does the heavy lifting and ensures equal stack offsets:

Código: text
$ invoke stack         # just call the executable
$ invoke -d stack      # run the executable in GDB


Here is the script:

Código: bash
#!/bin/sh

while getopts "dte:h?" opt ; do
  case "$opt" in
    h|\?)
      printf "usage: %s -e KEY=VALUE prog [args...]\n" $(basename $0)
      exit 0
      ;;
    t)
      tty=1
      gdb=1
      ;;
    d)
      gdb=1
      ;;
    e)
      env=$OPTARG
      ;;
  esac
done

shift $(expr $OPTIND - 1)
prog=$(readlink -f $1)
shift
if [ -n "$gdb" ] ; then
  if [ -n "$tty" ]; then
    touch /tmp/gdb-debug-pty
    exec env - $env TERM=screen PWD=$PWD gdb -tty /tmp/gdb-debug-pty --args $prog "$@"
  else
    exec env - $env TERM=screen PWD=$PWD gdb --args $prog "$@"
  fi
else
  exec env - $env TERM=screen PWD=$PWD $prog "$@"
fi


O se puede utilizar el script del siguiente repositorio:

Citarfixenv
A script to make stack addresses the same when running a program under gdb,ltrace,strace or without debugging (without ASLR of course). Env variables order is saved too.

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Saludos
#69
Según las fuentes del archivo de solución (.sln) de Hidden-Tear, se ha utilizado la versión 12.0 (Visual Studio 2013), aunque no debería haber problema de abrir el proyecto con VS2015.

Visual Studio Code (You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login) es solo un editor. Para compilar puedes utilizar Visual Studio (You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login) o las mismas herramientas que brinda el Framework .NET a través de la línea de comandos.

Saludos
#70
Hacking / Re:Nuestro primer BufferOverflow.
Octubre 09, 2016, 12:53:25 PM
Por defecto el linker ld protege el segmento del stack configurando su correspondiente program header como de solo lectura y escritura "RW" (este mecanismo de protección se conoce como  Data Execution Prevention o DEP). Para ejecutar código en el stack se necesita el flag "E" (permiso de ejecución). Esto se hace con la opción -z execstack en gcc.

También se puede habilitar el flag "E" del stack de un programa o librería ya compilada ejecutando execstack -s <PROGRAMA>.

Además debes utilizar la opción -fno-stack-protector porque, de estar habilitada, el compilador agrega más código al programa para comprobar que no se ha sobreescrito la dirección de retorno en el stack.

CitarThe basic idea behind stack protection is to push a "canary" (a randomly chosen integer) on the stack just after the function return pointer has been pushed. The canary value is then checked before the function returns; if it has changed, the program will abort. Generally, stack buffer overflow (aka "stack smashing") attacks will have to change the value of the canary as they write beyond the end of the buffer before they can get to the return pointer. Since the value of the canary is unknown to the attacker, it cannot be replaced by the attack. Thus, the stack protection allows the program to abort when that happens rather than return to wherever the attacker wanted it to go.

fuente:
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Saludos
#71
Dudas y pedidos generales / Re:Sin acentos Debian 8
Octubre 04, 2016, 03:10:50 AM
¿Tiene instalado scim (You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login)?. Los problemas con lo acentos y otros "dead keys" suelen estar relacionados con esta IM tool.

Puedes ver los problemas planteados en estos enlaces:
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Saludos
#72
Program Name: gcc
apt name if different: build-essential
Functionality rating (0-5): 4
Notes: more testing needed

En el siguiente enlace la comunidad (no Microsoft de manera oficial) brinda una lista de programas que funcionan (y los que no también):

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login


Como se señala en las publicaciones acerca del tema "Windows Subsystem for Linux (WSL)", es de esperar que algunas cosas funcionen y muchas otras no ya que existen "issues" y características que no están completas. Es por esto que se aclara que se encuentra en fase "beta".

Saludos
#73
Puedes utilizar la opción --quiet, por ejemplo, ejecutando "sudo bundle install --quiet".

Pero antes debes tener en cuenta que si ejecutas bunble como root puedes causar problemas en el system gems:

* La mayoría de los programas que crean archivos, como bundler, por defecto los crean con el mismo usuario bajo el cual están corriendo.
* Los archivos creados como root comúnmente no brindan a ningún otro usuario los permisos read/write/execute.
* Al instalar un bundle como root no se permite el acceso a la aplicación por el resto de los usuarios no-root.
* Si corres la aplicación instalada por "sudo bundle", al ejecutarla como root expones al sistema completo si existiera algún problema de seguridad.


fuentes:
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Saludos
#74
En la línea 50 falta un ')':

Código: ruby
resultado =  0,5**((cateto1 ** 2)+(cateto2 ** 2)



Saludos
#75
Dudas y pedidos generales / Re:[Gnu AS] BruteForce
Octubre 01, 2016, 08:49:05 PM
Hola,

no he tenido mucho tiempo para revisar el código entero, pero he encontrado algo a primera vista:

En la 1ra version:
Código: asm
subq %rcx,%rdx  # rdx = rdx - rcx
                        # es decir: lS = lS - ls


En la 2da version:
Código: asm
subq %rdx,%rcx  # rdx = rdx - rcx
                        # lS = lS - ls



En la segunda versión obtienes rcx = rcx - rdx, osea, ls = ls - lS

Saludos
#76
Dudas y pedidos generales / Re:[C#] DLLs y Excepciones
Septiembre 23, 2016, 11:34:59 AM
Veo dos cosas que me llaman la atención:

(1)
¿Estás seguro de que la DLL que quieres utilizar es una "Unmanaged DLL"?. [DllImport()] es para consumir funciones exportadas que no utilizan el framework .NET, y por el nombre HARDkey_CSHARP.dll sospecho que esa librería es del tipo "Managed DLL".

Si ese es el caso, entonces para agregar referencias en tiempo de ejecución debes utilizar "Reflection":

Código: csharp
Assembly SampleAssembly = Assembly.LoadFrom(filename);
Type myType = SampleAssembly.GetTypes()[0];
MethodInfo Method = myType.GetMethod("myVoid");
object myInstance = Activator.CreateInstance(myType);
Method.Invoke(myInstance, null);


Fuente:
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Para referenciar a la librería en tiempo de compilación, puedes utilizar el Reference Manager de Visual Studio para agregar referencias:
How to: Add or Remove References By Using the Reference Manager
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

O el parametro /r (o /reference) en el compilador:
/reference (C# Compiler Options)
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Command-line Building With csc.exe
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Working with the C# 2.0 Command Line Compiler
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

y no olvides de copiar el .dll del assembly en el mismo directorio donde tienes el ejecutable que lo utiliza. Visual Studio hace esto por defecto.

(2)
Basándome en el System.DllNotFoundException, quizás debas especificar la ruta del .dll con AddDllDirectory o SetDllDirectory, o agregar la ruta al PATH:

Dynamic-Link Library (DLL) Search Order
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Specify the search path for DllImport in .NET
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Saludos
#77
En Linux, para descubrir los dispositivos cercanos se suele hacer:

Código: text
hcitool scan


o

Código: text
hcitool inq



hcitool es un comando que forma parte del "BlueZ Package", el cual brinda soporte desde el user space al BlueZ kernel subsystem.  El repositorio lo puedes navegar en el siguiente enlace:

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Al código fuente de hcitool, y la función de scan, lo encuentras en el mismo repositorio:

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Las funciones importantes son:

Citar
Local Bluetooth adapters are assigned identifying numbers starting with 0, and a program must specify which adapter to use when allocating system resources. Usually, there is only one adapter or it doesn't matter which one is used, so passing NULL to hci_get_route will retrieve the resource number of the first available Bluetooth adapter.

Código: c
int hci_get_route( bdaddr_t *bdaddr );


* It is not a good idea to hard-code the device number 0, because that is not always the id of the first adapter. For example, if there were two adapters on the system and the first adapter (id 0) is disabled, then the first available adapter is the one with id 1.

If there are multiple Bluetooth adapters present, then to choose the adapter with address ``01:23:45:67:89:AB", pass the char * representation of the address to hci_devid and use that in place of hci_get_route.

Citar
Código: c
int hci_open_dev( int dev_id );


Most Bluetooth operations require the use of an open socket. hci_open_dev is a convenience function that opens a Bluetooth socket with the specified resource number [2]. To be clear, the socket opened by hci_open_dev represents a connection to the microcontroller on the specified local Bluetooth adapter, and not a connection to a remote Bluetooth device. Performing low level Bluetooth operations involves sending commands directly to the microcontroller with this socket.

Citar
hci_inquiry performs a Bluetooth device discovery and returns a list of detected devices and some basic information about them in the variable ii. On error, it returns -1 and sets errno accordingly.

Código: c
int hci_inquiry(int dev_id, int len, int max_rsp, const uint8_t *lap, inquiry_info **ii, long flags);


hci_inquiry is one of the few functions that requires the use of a resource number instead of an open socket, so we use the dev_id returned by hci_get_route. The inquiry lasts for at most 1.28 * len seconds, and at most max_rsp devices will be returned in the output parameter ii, which must be large enough to accommodate max_rsp results. We suggest using a max_rsp of 255 for a standard 10.24 second inquiry.

Citar
Once a list of nearby Bluetooth devices and their addresses has been found, the program determines the user-friendly names associated with those addresses and presents them to the user. The hci_read_remote_name function is used for this purpose.

Código: c
int hci_read_remote_name(int sock, const bdaddr_t *ba, int len, char *name, int timeout)


hci_read_remote_name tries for at most timeout milliseconds to use the socket sock to query the user-friendly name of the device with Bluetooth address ba. On success, hci_read_remote_name returns 0 and copies at most the first len bytes of the device's user-friendly name into name. On failure, it returns -1 and sets errno accordingly.

declaradas en hci_lib.h, y:

Citar
The basic data structure used to specify a Bluetooth device address is the bdaddr_t. All Bluetooth addresses in BlueZ will be stored and manipulated as bdaddr_t structures.

Código: c
int ba2str( const bdaddr_t *ba, char *str );


str2ba takes an string of the form ``XX:XX:XX:XX:XX:XX", where each XX is a hexadecimal number specifying an octet of the 48-bit address, and packs it into a 6-byte bdaddr_t. ba2str does exactly the opposite.

declarada en bluetooth.h.

Además necesitas del tipo de dato "inquiry_info" definido en hci.h:

Citar
The inquiry_info structure is defined as

Código: c
typedef struct {
    bdaddr_t    bdaddr;
    uint8_t     pscan_rep_mode;
    uint8_t     pscan_period_mode;
    uint8_t     pscan_mode;
    uint8_t     dev_class[3];
    uint16_t    clock_offset;
} __attribute__ ((packed)) inquiry_info;


For the most part, only the first entry - the bdaddr field, which gives the address of the detected device - is of any use. Occasionally, there may be a use for the dev_class field, which gives information about the type of device detected (i.e. if it's a printer, phone, desktop computer, etc.) and is described in the Bluetooth Assigned Numbers [3]. The rest of the fields are used for low level communication, and are not useful for most purposes. The interested reader can see the Bluetooth Core Specification [4] for more details.


Para poder usar estos headers quizás debas instalar el paquete libbluetooth-dev:

Código: text
apt-get install libbluetooth-dev


Y para poder compilar necesitas ejecutar el siguiente comando:

Código: text
gcc -o simplescan simplescan.c -lbluetooth


Puedes ver los ejemplos en las siguientes fuentes:
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Saludos
#78
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Me pueden corrigen este código que yo edite. Se que esta muy mal hecho y que ni siquiera va a lo que quiero sino que solo da el nombre del archivo.
Lo que yo quería hacer es enviar un archivo .exe

Hasta donde tengo entendido, no puedes enviar un archivo por el chat de Ares. Además, por lo que puedo ver en el código que pasaste, no comprendes la idea de un protocolo y el funcionamiento de un server. Es por esto que no puedo ayudarte con tu código.

El server es un programa, y como tal es estructurado e impone sus reglas. No puedes inventar un protocolo (aunque a veces te puedes valer de su diseño y/o forzar o quebrantar la implementación de algunos) y esperar a que el server procese satisfactoriamente tu mensaje.

Saludos
#79
Dudas y pedidos generales / Re:Duda sobre API de Windows
Septiembre 22, 2016, 12:50:30 PM
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Solo encontre cursos y cosas por el estilo de la parte de Interface User pero de lo demas, como por ejemplo; Los servicios del sistema, no encontre nada explicado de forma gradual como los cursos de Como crear un ventanas y eso.
Debo aprenderlo de la forma dificil no? Es decir, leyendo la pagina de Microsoft e ir sacando conclusiones por mi mismo. Ya que solo en esa pagina eh visto que nombre y de ejemplos de TODAS las funciones de winapi. O hay algo que se me esta escapando?
Siempre que pregundo donde aprender el manejo de winapi, me mandan a la pagina de cconclase, pero ahi solo explica como crear una interface de usuario.


La mejor documentanción la encuentras en inglés. En internet se encuentran muchos artículos esparcidos, pero puedes encontrar mucho en páginas como en CodeProject, CodeGuru, CPlusPlus, Tenouk's y la MSDN de Microsoft por supuesto:

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

También tienes algunos títulos de libros, los cuales algunos se pueden encontrar en internet:

Windows via C/C++ 5th Edition
Windows System Programming (4th Edition) (Addison-Wesley Microsoft Technology) 4th Edition
Windows Internals
Programming Windows®, Fifth Edition (Developer Reference) 5th Edition
Win32 Programming (Addison-Wesley Advanced Windows Series)

Finalmente, aprendiendo de la forma dificil, como dices, es un buen complemento para afianzar tus conocimientos.

Saludos
#80
Como @You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login dijo, en las nuevas versiones de Windows autorun.inf se ha desactivado por defecto.

En el script batch, especificas el comando a ejecutar. Vas a necesitar un software de terceros, puedes probar ODIN el cual tiene su versión CLI:
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Saludos