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

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  [C#] Adf.ly Killer 0.5
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [C#] Adf.ly Killer 0.5  (Leído 2,508 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[C#] Adf.ly Killer 0.5
« en: 22 Julio 2016, 18:53 pm »

Un programa en C# para decodificar una URL de Adf.ly , este programa esta basado en la funcion publicada en VB.Net por fudmario para lograr esta tarea.

Tiene dos opciones , la primera es para decodificar una unica URL y la otra es para decodificar varias URLS en un archivo de texto.

Una imagen :



El codigo :

Código
  1. // Adf.ly Killer 0.5
  2. // (C) Doddy Hackman 2016
  3. // Credits : Thanks to fudmario
  4.  
  5. using System;
  6. using System.Collections.Generic;
  7. using System.ComponentModel;
  8. using System.Data;
  9. using System.Drawing;
  10. using System.Text;
  11. using System.Windows.Forms;
  12. using System.Text.RegularExpressions;
  13. using Microsoft.VisualBasic;
  14. using System.IO;
  15.  
  16. namespace Adf.ly_Killer
  17. {
  18.    public partial class FormHome : Form
  19.    {
  20.        public FormHome()
  21.        {
  22.            InitializeComponent();
  23.        }
  24.  
  25.        private void btnExit_Click(object sender, EventArgs e)
  26.        {
  27.            Application.Exit();
  28.        }
  29.  
  30.        public string base64_encode(string texto)
  31.        {
  32.            return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(texto));
  33.        }
  34.  
  35.        public string base64_decode(string texto)
  36.        {
  37.            return System.Text.Encoding.UTF8.GetString(System.Convert.FromBase64String(texto));
  38.        }
  39.  
  40.        private Boolean check_link(string link)
  41.        {
  42.            Match regex = Regex.Match(link, "adf.ly", RegexOptions.IgnoreCase);
  43.            if (regex.Success)
  44.            {
  45.                return true;
  46.            }
  47.            else
  48.            {
  49.                return false;
  50.            }
  51.        }
  52.  
  53.        private string adfly_decode(string link_to_decode)
  54.        {
  55.            string link_decoded = "";
  56.            DH_Tools tools = new DH_Tools();
  57.            string code = tools.toma(link_to_decode);
  58.            Match regex = Regex.Match(code, "var ysmm = '(.*?)';", RegexOptions.IgnoreCase);
  59.            if (regex.Success)
  60.            {
  61.                string link = regex.Groups[1].Value;
  62.                string left = "";
  63.                string right = "";
  64.                for (int i = 0; i < link.Length; i++)
  65.                {
  66.                    if (i % 2 == 0)
  67.                    {
  68.                        left = left + Convert.ToString(link[i]);
  69.                    }
  70.                    else
  71.                    {
  72.                        right = Convert.ToString(link[i]) + right;
  73.                    }
  74.                }
  75.                string link_encoded = base64_decode(left + right);
  76.                string link_ready = link_encoded.Substring(2);
  77.                link_decoded = link_ready;
  78.  
  79.            }
  80.            if (link_decoded == "")
  81.            {
  82.                link_decoded = "???";
  83.            }
  84.            return link_decoded;
  85.        }
  86.  
  87.        private void btnKill_Click(object sender, EventArgs e)
  88.        {
  89.            txtResult.Text = "";
  90.            if (txtEnterLink.Text != "")
  91.            {
  92.                if (check_link(txtEnterLink.Text))
  93.                {
  94.                    status.Text = "[+] Decoding ...";
  95.                    this.Refresh();
  96.                    string result = adfly_decode(txtEnterLink.Text);
  97.                    if (result != "???")
  98.                    {
  99.                        txtResult.Text = result;
  100.                        status.Text = "[+] Link Decoded";
  101.                        this.Refresh();
  102.                    }
  103.                    else
  104.                    {
  105.                        txtResult.Text = "Not Found";
  106.                        status.Text = "[-] Not Found";
  107.                        this.Refresh();
  108.                    }
  109.                }
  110.                else
  111.                {
  112.                    status.Text = "[-] Link Invalid";
  113.                    this.Refresh();
  114.                }
  115.            }
  116.            else
  117.            {
  118.                status.Text = "[-] Enter Link to decode";
  119.                this.Refresh();
  120.            }
  121.        }
  122.  
  123.        private void btnCopy_Click(object sender, EventArgs e)
  124.        {
  125.            try
  126.            {
  127.                Clipboard.Clear();
  128.                Clipboard.SetText(txtResult.Text);
  129.                status.Text = "[+] Link copied to clipboard";
  130.                this.Refresh();
  131.            }
  132.            catch
  133.            {
  134.                //
  135.            }
  136.        }
  137.  
  138.        private void miAddLink_Click(object sender, EventArgs e)
  139.        {
  140.            string link = Interaction.InputBox("Enter Link : ", "Adf.ly Killer 0.5", "");
  141.            if (link != "")
  142.            {
  143.                if (check_link(link))
  144.                {
  145.                    ListViewItem item = new ListViewItem();
  146.                    item.Text = link;
  147.                    item.SubItems.Add("...");
  148.                    lvLinks.Items.Add(item);
  149.                    status.Text = "[+] Link Added";
  150.                    this.Refresh();
  151.                }
  152.                else
  153.                {
  154.                    status.Text = "[-] Link Invalid";
  155.                    this.Refresh();
  156.                }
  157.            }
  158.            else
  159.            {
  160.                status.Text = "[-] Enter Link";
  161.                this.Refresh();
  162.            }
  163.        }
  164.  
  165.        private void miAddWordlist_Click(object sender, EventArgs e)
  166.        {
  167.            odOpenFile.InitialDirectory = System.IO.Path.GetDirectoryName(Application.ExecutablePath); ;
  168.            DialogResult resultado = odOpenFile.ShowDialog();
  169.            if (resultado == DialogResult.OK)
  170.            {
  171.                string filename = odOpenFile.FileName;
  172.                int counter = 0;
  173.                if (File.Exists(filename))
  174.                {
  175.                    var lines = File.ReadAllLines(filename);
  176.                    foreach (var line in lines)
  177.                    {
  178.                        if (check_link(line))
  179.                        {
  180.                            ListViewItem item = new ListViewItem();
  181.                            item.Text = line;
  182.                            item.SubItems.Add("...");
  183.                            lvLinks.Items.Add(item);
  184.                            counter = counter + 1;
  185.                        }
  186.                    }
  187.                    if (counter > 0)
  188.                    {
  189.                        status.Text = "[+] Links Added : " + counter.ToString();
  190.                        this.Refresh();
  191.                    }
  192.                    else
  193.                    {
  194.                        status.Text = "[-] Links not found";
  195.                        this.Refresh();
  196.                    }
  197.                }
  198.                else
  199.                {
  200.                    status.Text = "[-] Enter Valid Filename";
  201.                    this.Refresh();
  202.                }
  203.            }
  204.        }
  205.  
  206.        private void miClearList_Click(object sender, EventArgs e)
  207.        {
  208.            lvLinks.Items.Clear();
  209.        }
  210.  
  211.        private void miKill_Click(object sender, EventArgs e)
  212.        {
  213.            if (lvLinks.Items.Count > 0)
  214.            {
  215.                for (int i = 0; i < lvLinks.Items.Count; i++)
  216.                {
  217.                    ListViewItem item = lvLinks.Items[i];
  218.                    string link_to_decode = item.Text;
  219.                    status.Text = "[+] Checking : " + link_to_decode + " ...";
  220.                    this.Refresh();
  221.                    string result = adfly_decode(link_to_decode);
  222.                    if (result != "???")
  223.                    {
  224.                        lvLinks.Items[i].SubItems[1].Text = result;
  225.                        status.Text = "[+] " + link_to_decode+" : "+result;
  226.                        this.Refresh();
  227.                    }
  228.                    else
  229.                    {
  230.                        lvLinks.Items[i].SubItems[1].Text = "Not Found";
  231.                        status.Text = "[-] " + link_to_decode + " : " + "Not Found";
  232.                        this.Refresh();
  233.                    }
  234.                }
  235.                status.Text = "[+] Finished";
  236.                this.Refresh();
  237.            }
  238.            else
  239.            {
  240.                status.Text = "[-] Links not found";
  241.                this.Refresh();
  242.            }
  243.        }
  244.  
  245.        private void miCopy_Click(object sender, EventArgs e)
  246.        {
  247.  
  248.            if (lvLinks.SelectedIndices.Count > 0 && lvLinks.SelectedIndices[0] != -1)
  249.            {
  250.                string link = lvLinks.SelectedItems[0].SubItems[1].Text;
  251.                if (link != "..." || link!="Not Found")
  252.                {
  253.                    try
  254.                    {
  255.                        Clipboard.Clear();
  256.                        Clipboard.SetText(link);
  257.                        status.Text = "[+] Link copied to clipboard";
  258.                        this.Refresh();
  259.                    }
  260.                    catch
  261.                    {
  262.                        //
  263.                    }
  264.                }
  265.            }
  266.        }
  267.  
  268.    }
  269. }
  270.  
  271. // The End ?
  272.  

Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
Github.

Eso seria todo.


« Última modificación: 22 Julio 2016, 18:56 pm por Doddy » En línea

joanj94

Desconectado Desconectado

Mensajes: 64



Ver Perfil
Re: [C#] Adf.ly Killer 0.5
« Respuesta #1 en: 10 Agosto 2016, 18:27 pm »

Me parece interesante el proyecto. Como recomendación de estilo / diseño sugeriría  según mi experiencia en programación, cambiar cosas de este estilo
       
Código:
        private Boolean check_link(string link)
        {
            Match regex = Regex.Match(link, "adf.ly", RegexOptions.IgnoreCase);
            if (regex.Success)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

por uno de estos modos
Compacto:
Código:
        private Boolean check_link(string link)
        {
            Match regex = Regex.Match(link, "adf.ly", RegexOptions.IgnoreCase);
            return regex.Success;
           
        }

Retorno único 1:
       
Código:

        private Boolean check_link(string link)
        {
            bool ret = false;
            Match regex = Regex.Match(link, "adf.ly", RegexOptions.IgnoreCase);
            if (regex.Success)
            {
                ret = true;
            }

            return ret;
        }


Retorno único 2:
       
Código:

        private Boolean check_link(string link)
        {
            bool ret;
            Match regex = Regex.Match(link, "adf.ly", RegexOptions.IgnoreCase);
            ret = regex.Success;

            return ret;
        }


En línea


Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
DoS Killer en VB6
Programación Visual Basic
-sagitari- 1 4,048 Último mensaje 27 Septiembre 2005, 00:18 am
por Slasher-K
Killer « 1 2 »
Programación Visual Basic
rubeng 16 5,719 Último mensaje 29 Mayo 2006, 19:30 pm
por Krnl64
killer msn kst
Programación Visual Basic
crauss 7 6,667 Último mensaje 20 Enero 2008, 11:21 am
por crauss
av-killer
Programación Visual Basic
krackwar 0 1,116 Último mensaje 26 Febrero 2008, 16:57 pm
por krackwar
USB Killer
Bugs y Exploits
el-brujo 6 8,976 Último mensaje 13 Marzo 2015, 10:16 am
por Gh057
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines