EMO Style ForumPro - Hos Geldiniz
Giriş yap

Şifremi unuttum

Istatistikler
Toplam 203 kayıtlı kullanıcımız var
Son kaydolan kullanıcımız: posta59

Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Tarıyıcı
 Kapı
 Indeks
 Üye Listesi
 Profil
 SSS
 Arama
Arama
 
 

Sonuç :
 


Rechercher çıkıntı araştırma

RSS akısı


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Anahtar-kelime

pointer  

Kimler hatta?
Toplam 2 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 2 Misafir

Yok

[ Bütün listeye bak ]


Sitede bugüne kadar en çok 217 kişi C.tesi Tem. 29, 2017 1:46 am tarihinde online oldu.
En son konular
» İnternetten Para Kazandıran Oyun ! Ödeme Alt Limiti Yok ! DEV KONU
Cuma Ağus. 29, 2014 8:33 am tarafından Hello EMO

» goldenchase.net maden yaparak para kazanma
Cuma Ağus. 29, 2014 8:18 am tarafından Hello EMO

» etichal hacker görsel egitim seti
Çarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO

» KO TBL Source C#
Ptsi Ara. 09, 2013 6:36 am tarafından Hello EMO

» x86 Registers
C.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de WYD
Çarş. Tem. 10, 2013 7:25 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de CS Metodo²
Çarş. Tem. 10, 2013 7:23 am tarafından Hello EMO

» [Tutorial] Aprendendo basico deASM OLLYDBG
Çarş. Tem. 10, 2013 7:22 am tarafından Hello EMO

» Basic C# DLL injector
Ptsi Tem. 08, 2013 7:48 am tarafından Hello EMO

Reklam

[Tutorial]Botting using Webrequest C#

Önceki başlık Sonraki başlık Aşağa gitmek

[Tutorial]Botting using Webrequest C#

Mesaj tarafından Hello EMO Bir Ptsi Haz. 25, 2012 9:12 pm

I'm going to teach you how to open a connection, post the data, and loop it using WebRequest in C#.

Note: I'm not gonna do a actually site, just gonna do an example.

Ok say if the site is http://rasputin.com/contest/register.php/

We have 3 text boxes, and a submit button.

First Name
Last Name
Email

OK we are going to need something called Http Headers for firefox: Makes things alot easier. We are looking for the POST data in it.

Say if we already found it:

Kod:
/POST http://rasputin.com/contest/submit.php

firstname=Rasputin&lastname=Tj&email=mydickishard%40gmail.com&submit=1

Ok see how the link changed? submit.php actually submits the data instead of the main link. And the data, firstname=Rasputin this is similar using a webbrowser in C#. submit=1, most of the time for radio buttons and buttons it will equal 1 or something else. And we have to do http url encoding, which is %40 and all that

Remember to http url encode

Ok make a new form project in Visual Studio C#.

Drag:

3 Text Boxes
1 Button
1 label (This is gonna tell how much times you entered)

Arrange the shit

Name them:

txtFirst
txtLast
txtGmail
btnGo

Double click your form or button (whatever)

First off, we need to make 3 new using statement.

Kod:
using System.Net;
using System.IO;
using System.Threading;

This is so we can start coding in WebRequest and use threading

And lets do a global varible

Kod:
 public partial class Form1 : Form
    {
      [COLOR="red"]  private Thread thread;[/COLOR]
        public Form1()
        {
            InitializeComponent();
        }

so thread = Thread (theres a difference)

We are now going to make a new void.

It should look like this:

Kod:
private void code()
  {

  }

ok this is where we are going to code in, we need this for threading.

Ok, to start off lets do this:

Kod:
string url = "http://rasputin.com/contest/submitentry.php/";

now "url" equals that link.

now lets:

Kod:
int count = 0;

this is dimming the phrase count equal 0.

now we are gonna "try" to post the data and catch the error so:

Kod:
try
    {

    }
  catch (Exception)
    {

    }

so everything in "try" will try post this data and "catch" the exception (a.k.a error)

so we are gonna open a request in try so:

Kod:
WebRequest request = WebRequest.Create(url);

So we are traveling to "url" that we dimmed.

Now lets call the Method, which is POST

Kod:
request.Method = "POST";

I prefer this way but you can do whatever

Kod:
 string firstname = "firstname=" + txtFirst.Text;
                    string lastname = "&lastname=" + txtLast.Text;
                    string gmail = "&email=" + txtGmail.Text + "%2B" + count + "%40gmail.com";
                    string submit = "1";
                    string postdata = firstname + lastname + gmail + submit;

We need to "Post" this data by sending postdata to bytes and calling the form type

Kod:
byte[] byteArray = Encoding.UTF8.GetBytes(postdata);
                    request.ContentType = "application/x-www-form-urlencoded";
                    request.ContentLength = byteArray.Length;

We need to open a stream which posts the data but closes it too.

Kod:
Stream datastream = request.GetRequestStream();
                    datastream.Write(byteArray, 0, byteArray.Length);
                    datastream.Close();

See how datastream equal the stream of the request? That's what we need to get the response from server

So we need to get the response from the server:

Kod:
 WebResponse response = request.GetResponse();
                    datastream = response.GetResponseStream();
                    StreamReader reader = new StreamReader(datastream);
                    string responseFromSever = reader.ReadToEnd();

Ok responseFromServer, this is the url page, so its like saying webBrowser1.DocumentText

Now this is where that label come into play.

Kod:
 if (responseFromSever.Contains("Thank you for your submission."))
                    {
                        label1.text = count.ToString();
                    }
                    count++;
                    reader.Close();
                    datastream.Close();
                    response.Close();

this just insures for each time entered, label1.text goes up and we close the stream

Ok we just made a sucessful connection

but what if you want to bot?

we will add something like this to the code:

Kod:
 while (true)
            {
                try
                {
                //your bot code
                }
                catch
                {

                }
            }
          }

Now to start threading to prevent crashing

Double click your button on your form and write:

Kod:
 if (btnGo.Text == "Start")
            {
                btnGo.Test = "Stop";
                thread = new Thread(code);
                thread.Start();
            }
            else
            {
                btnGo.Text = "Start";
                thread.Abort();
            }

So we are doing for everything in code() basically telling the bot to not crash k?

It switches to "Stop" when "Start" is activated (clicked) then goes back to "Start" when "Stop" is true.

Here is a example code, copy and you gay :fuckyea:

Kod:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Threading;

namespace First_WebRequest_Bot
{
    public partial class Form1 : Form
    {
        private Thread thread;
        public Form1()
        {
            InitializeComponent();
        }

        private void code()
        {
            int count = 0;
            Random random = new Random();
            string url = "http://www.tjandcurtporn.com/php/submitEntry.php";
            string phone = "";
            tP.Text = "3" + "0" + "1" + random.Next(0, 8) + random.Next(0, 8) + random.Next(0, 8) + random.Next(0, 8) + random.Next(0, 8) + random.Next(0, 8) + random.Next(0, 8);
            phone = tP.Text;
            while (true)
            {
                try
                {
                    WebRequest request = WebRequest.Create(url);
                    request.Method = "POST";
                    string firstname = "first_name=" + tF.Text;
                    string lastname = "&last_name=" + tL.Text;
                    string gmail = "&email=" + tG.Text;
                    string confirmgmail = "&c_email=" + tG.Text + "%2B" + count + "%40gmail.com";
                    string phonenumber = "&phone=" + phone;
                    string agree = "&agree=" + "1";
                    string submit = "&entry_form_submit=Submit";
                    string postdata = firstname + lastname + gmail + confirmgmail + phonenumber + agree + submit;
                    byte[] byteArray = Encoding.UTF8.GetBytes(postdata);
                    request.ContentType = "application/x-www-form-urlencoded";
                    request.ContentLength = byteArray.Length;
                    Stream datastream = request.GetRequestStream();
                    datastream.Write(byteArray, 0, byteArray.Length);
                    datastream.Close();
                    WebResponse response = request.GetResponse();
                    datastream = response.GetResponseStream();
                    StreamReader reader = new StreamReader(datastream);
                    string responseFromSever = reader.ReadToEnd();
                    if (responseFromSever.Contains("Thank you for your submission."))
                    {
                        toolEntries.Text = count.ToString();
                    }
                    count++;
                    reader.Close();
                    datastream.Close();
                    response.Close();
                }
                catch (Exception)
                { 
                }
            }
        }



        private void btnGo_Click(object sender, EventArgs e)
        {
            if (btnGo.Text == "Start")
            {
                thread = new Thread(code);
                thread.Start();
            }
            else
            {
                thread.Abort();
            }
        }
    }
}

:coolface: .


Hello Kitty
vs
eMoStyLe



avatar
Hello EMO
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
Mesaj Sayısı : 935
Puan : 256593
Rep Puanı : 18
Doğum tarihi : 28/11/89
Kayıt tarihi : 21/07/09
Yaş : 27
Nerden : EMO WorlD
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO

Kullanıcı profilini gör http://emostyle.myforumpro.com

Sayfa başına dön Aşağa gitmek

Önceki başlık Sonraki başlık Sayfa başına dön


 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz