elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


  Mostrar Mensajes
Páginas: 1 ... 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [20] 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 ... 313
191  Programación / Desarrollo Web / [Resuelto] Duda JQUERY JSON en: 23 Noviembre 2015, 00:38 am
Hola a todos tengo el siguiente código en un template:

Código
  1. Morris.Area({
  2. element: 'morris-area-chart',
  3. data: [{
  4. period: '2010-09-08',
  5. iphone: 2666,
  6. ipad: null,
  7. itouch: 2647
  8. }, {
  9. period: '2010-08-08',
  10. iphone: 2778,
  11. ipad: 2294,
  12. itouch: 2441
  13. }, {
  14. period: '2010-09-07',
  15. iphone: 4912,
  16. ipad: 1969,
  17. itouch: 2501
  18. }, {
  19. period: '2010-09-05',
  20. iphone: 3767,
  21. ipad: 3597,
  22. itouch: 5689
  23. }, {
  24. period: '2010-09-03',
  25. iphone: 6810,
  26. ipad: 1914,
  27. itouch: 2293
  28. }, {
  29. period: '2010-09-01',
  30. iphone: 5670,
  31. ipad: 4293,
  32. itouch: 1881
  33. }, {
  34. period: '2009-09-08',
  35. iphone: 4820,
  36. ipad: 3795,
  37. itouch: 1588
  38. }, {
  39. period: '2009-09-02',
  40. iphone: 15073,
  41. ipad: 5967,
  42. itouch: 5175
  43. }, {
  44. period: '2009-09-01',
  45. iphone: 10687,
  46. ipad: 4460,
  47. itouch: 2028
  48. }, {
  49. period: '2009-03-08',
  50. iphone: 8432,
  51. ipad: 5713,
  52. itouch: 1791
  53. }],
  54. xkey: 'period',
  55. ykeys: ['iphone', 'ipad', 'itouch'],
  56. labels: ['iPhone', 'iPad', 'iPod Touch'],
  57. pointSize: 2,
  58. hideHover: 'auto',
  59. resize: true
  60. });

Como podría agregar nuevos valores:
Código
  1. {
  2. period: '2019-09-01',
  3. iphone: 10687,
  4. ipad: 4430,
  5. itouch: 2238
  6. }

saludos
192  Programación / .NET (C#, VB.NET, ASP) / Re: [C#] Problema override WndProc en: 19 Noviembre 2015, 22:26 pm
Solucionado:
Copié este código completamente y luego lo adapté a mis necesidades:

Código
  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4.  
  5. namespace csTempWindowsApplication1
  6. {
  7.    public class Form1 : System.Windows.Forms.Form
  8.    {
  9.        // Constant value was found in the "windows.h" header file.
  10.        private const int WM_ACTIVATEAPP = 0x001C;
  11.        private bool appActive = true;
  12.  
  13.        [STAThread]
  14.        static void Main()
  15.        {
  16.            Application.Run(new Form1());
  17.        }
  18.  
  19.        public Form1()
  20.        {
  21.            this.Size = new System.Drawing.Size(300,300);
  22.            this.Text = "Form1";
  23.            this.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  24.        }
  25.  
  26.        protected override void OnPaint(PaintEventArgs e)
  27.        {
  28.            // Paint a string in different styles depending on whether the
  29.            // application is active.
  30.            if (appActive)
  31.            {
  32.                e.Graphics.FillRectangle(SystemBrushes.ActiveCaption,20,20,260,50);
  33.                e.Graphics.DrawString("Application is active", this.Font, SystemBrushes.ActiveCaptionText, 20,20);
  34.            }
  35.            else
  36.            {
  37.                e.Graphics.FillRectangle(SystemBrushes.InactiveCaption,20,20,260,50);
  38.                e.Graphics.DrawString("Application is Inactive", this.Font, SystemBrushes.ActiveCaptionText, 20,20);
  39.            }
  40.        }
  41.  
  42. [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
  43.        protected override void WndProc(ref Message m)
  44.        {
  45.            // Listen for operating system messages.
  46.            switch (m.Msg)
  47.            {
  48.                // The WM_ACTIVATEAPP message occurs when the application
  49.                // becomes the active application or becomes inactive.
  50.                case WM_ACTIVATEAPP:
  51.  
  52.                    // The WParam value identifies what is occurring.
  53.                    appActive = (((int)m.WParam != 0));
  54.  
  55.                    // Invalidate to get new text painted.
  56.                    this.Invalidate();
  57.  
  58.                    break;                
  59.            }
  60.            base.WndProc(ref m);
  61.        }
  62.    }
  63. }

Supongo que se debe a la forma en que se crea el Form, saludos.
193  Programación / .NET (C#, VB.NET, ASP) / [C#] Problema override WndProc en: 19 Noviembre 2015, 03:25 am
Hola a todos, estoy teniendo problemas al intentar hacer un override en WndProc, el problema consiste en que no se generan los mensajes de Windows que quiero capturar. Cabe mencionar que la aplicación es "Console Application" y para ocultar la consola, modifiqué la opción del proyecto de output: "Windows Application". Adicionar que www.asd.com lo uso como ejemplo, pues de acorde a cada evento, se realiza una notificación distinta a una Web, si me pudieran ayudar quedaría completamente agradecido, saludos y gracias por su tiempo, aquí el código:

Código
  1. using System;
  2. using System.Net;
  3. using System.Runtime.InteropServices;
  4. using System.Security.Permissions;
  5. using System.Text;
  6. using System.Threading;
  7. using System.Windows.Forms;
  8.  
  9. namespace iWatch
  10. {
  11.    class Program : System.Windows.Forms.Form
  12.    {
  13.        private const int WM_QUERYENDSESSION = 0x0011;
  14.        private const int WM_POWERBROADCAST = 0x0218;
  15.        private const int PBT_APMSUSPEND = 0x04;
  16.        private const int PBT_APMRESUMESUSPEND = 0x07;
  17.        WebRequest request;
  18.  
  19.        [DllImport("user32.dll")]
  20.        private static extern IntPtr GetForegroundWindow();
  21.  
  22.        [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
  23.        private static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
  24.  
  25.        [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.InheritanceDemand, Name = "FullTrust")]
  26.        protected override void WndProc(ref Message m)
  27.        {
  28.            // Listen for operating system messages.
  29.            switch (m.Msg)
  30.            {
  31.                // The WM_ACTIVATEAPP message occurs when the application
  32.                // becomes the active application or becomes inactive.
  33.                case WM_QUERYENDSESSION:
  34.  
  35.                    request = WebRequest.Create("http://www.asd.com");
  36.                    request.GetResponse();
  37.                    break;
  38.  
  39.                case WM_POWERBROADCAST:
  40.  
  41.                    if((int)m.WParam == PBT_APMSUSPEND)
  42.                    {
  43.                        request = WebRequest.Create("http://www.asd.com");
  44.                        request.GetResponse();
  45.  
  46.                    }else if((int)m.WParam == PBT_APMRESUMESUSPEND)
  47.                    {
  48.                        request = WebRequest.Create("http://www.asd.com");
  49.                        request.GetResponse();
  50.  
  51.                    }
  52.                    break;
  53.            }
  54.            base.WndProc(ref m);
  55.        }
  56.  
  57.        static void Main(string[] args)
  58.        {
  59.            Thread.Sleep(20000);
  60.  
  61.            WebRequest request = WebRequest.Create("http://www.asd.com");
  62.            request.GetResponse();
  63.  
  64.            while (true)
  65.            {
  66.                String[] phraselist = new String[] { "hola", "adios" };
  67.  
  68.                // get handle
  69.                IntPtr handle = GetForegroundWindow();
  70.  
  71.                // get title
  72.                const int count = 512;
  73.                var text = new StringBuilder(count);
  74.  
  75.                if (GetWindowText(handle, text, count) > 0)
  76.                {
  77.                    foreach(String phrase in phraselist){
  78.                        if(text.ToString().ToUpper().IndexOf(phrase.ToUpper()) != -1)
  79.                        {
  80.                            System.Console.WriteLine(text.ToString());
  81.                            request = WebRequest.Create("http://www.asd.com");
  82.                            request.GetResponse();
  83.                            Thread.Sleep(1200000);
  84.                        }
  85.                    }
  86.                }
  87.            }
  88.        }
  89.    }
  90. }
194  Seguridad Informática / Bugs y Exploits / Re: Metasploit (windows) en: 15 Noviembre 2015, 19:59 pm
Es compatible pero es un asco, te recomiendo usar metasploit para Linux, usando una suite de pentesting en Windows 8  :xD ?
195  Programación / PHP / Re: Expresión regular - Detectar un patrón en: 12 Noviembre 2015, 21:35 pm
Funcionó a la perfección, muchas gracias por la info  ;-)
196  Programación / PHP / Expresión regular - Detectar un patrón en: 11 Noviembre 2015, 19:51 pm
Hola a todos, tengo un grupo de valores que en algún caso terminan con:
Letra + guión + dos nueves. Ejemplo:

123123-123123-123123-123123-23A-99
343434-3434-23123-4242-123-50B-99
6767-6456-23423-1231-123-123-1H-99
1231-123123-2323-23123-12313-99
1231-12312-123-23-123123-50H

en base a lo mencionado anteriormente, que expresión regular podría devolverme True en caso de encontrar este patrón, cabe mencionar que este patrón se encuentra solo al final, saludos.
197  Programación / Scripting / Re: [Python] En que falla mi script? en: 7 Noviembre 2015, 01:47 am
Cuentanos como te va, pero en teoría debe funcionar. Eso sí, ten en cuenta que la lista de letras va hasta la z así que lo más seguro (si itertools hace las permutaciones en orden) es que te llegue hasta zz9999 y no hasta ww9999

Saludos!

toda la razón, me equivoqué en escribir el hasta, pero funciona de maravilla, gracias por la ayuda  ;-)
198  Programación / Scripting / Re: [Python] En que falla mi script? en: 7 Noviembre 2015, 01:04 am
Parece que no se entendió bien jaja, lo que quiero hacer en realidad es una especie de diccionario, tal como comenta 11Sep, la estructura puntual del diccionario es el siguiente

2 letras y 4 dígitos, quedando de esta forma:

Citar
AZ0123
BA1999
etc.

Por eso mi idea era crear iteraciones para tener todas las combinaciones posibles:
Citar
AA0000

hasta:

Citar
WW9999



Und3r: perdón pero no entiendo, como querés imprimir
así sale:

¿a qué te referís con imprimir separados?

Edito: me olvidé soy rejeropa!

11sep: tu script no tendría el mismo resultado, ya que la salida sería:
aa0000
aa1111
aa2222

arroja eso perfectamente, pero llega hasta aa9999 pero después debería comenzar con ab0000, pero no ocurre, ha de ser lo que dice 11Sep


Gracias por demostrar interés en querer ayudarme, me emociona mucho  ;-)

EDIT:

Creo que 11Sep me dio una pista, estoy corriendo esto a ver que arroja pero creo que funcionará:
Código
  1. import itertools
  2. res = itertools.product('abcdefghijklmnopqrstuvwxyz', repeat=2) # 2 is the length of your result.
  3.  
  4. #for i in res:
  5. # print ''.join(i)
  6.  
  7. for i in res:
  8. varA = ''.join(i)
  9. res2 = itertools.product('0123456789', repeat=4) # 4 is the length of your result.
  10. for x in res2:
  11. varB = ''.join(x)
  12. print varA + varB
199  Programación / Scripting / [Python] En que falla mi script? en: 6 Noviembre 2015, 23:48 pm
Código
  1. import itertools
  2. res = itertools.product('abcdefghijklmnopqrstuvwxyz', repeat=2) # 2 is the length of your result.
  3. res2 = itertools.product('0123456789', repeat=4) # 4 is the length of your result.
  4.  
  5. for i in res:
  6. varA = ''.join(i)
  7. for x in res2:
  8. varB = ''.join(x)
  9. print varA + varB
  10.  

Mi intención es que imprima
Citar
aa0000
aa0001
....
..
ww9999

pero no logro que funcione, sospecho que el problema es el for o algo así, pues al momento de imprimir ambos separados, me muestran:
Citar
aa
...
ww

y el otro
Citar
0000
...
9999

ayuda y gracias :D
200  Seguridad Informática / Hacking / Re: sql inyection en URL sin parametros en: 1 Noviembre 2015, 15:06 pm
Si las herramientas de terceros no cuentan con el "típico escenario" tendrás que usar tu cerebro y hacer el trabajo a mano, algo un poco lento pero fácil si suponemos que entiendes que hay detrás de todas estas tools  ;D
Páginas: 1 ... 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [20] 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 ... 313
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines