1
2
3
4
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
#!/usr/bin/python
import struct
import sys
import thread
from twisted.words.protocols import oscar
from twisted.internet import reactor, protocol
from twisted.python import log
from omegle import OmegleChat
randoms = [['370496181', 'megahal123'], ['446323989','gagaga']]
i=0
uin = randoms[i][0]
password = randoms[i][1]
class OmegleICQChat(OmegleChat):
def __init__(self,icqconn,user):
self.user = user
self.icqconn = icqconn
OmegleChat.__init__(self,name="("+user.name+")")
def on_message(self,message):
print "%s: got message %s" % (self.user.name,message)
self.send_icqconn( message )
def send_icqconn(self,message):
print "%s: send %s" % (self.user.name,message)
reactor.callFromThread(self.icqconn.sendMessage, self.user.name, str(message) )
def on_connect(self):
print "%s: connected" % self.user.name
self.send_icqconn( "== Stranger CONNECTED (type disconnect to disconnect) ==" )
def on_disconnect(self):
print "%s: disconnecteed" % self.user.name
self.send_icqconn( "==Stranger Disconnected ==" )
class icqBot( oscar.BOSConnection ):
capabilities = [oscar.CAP_CHAT]
def initDone( self ):
self.requestSelfInfo()
self.requestSSI().addCallback(self.gotBuddyList)
self.omegleConns = {}
def shutdown( self ):
for conn in self.omegleConns:
if conn.is_connected:
conn.disconnect()
def updateBuddy(self, user):
print "Update buddy %s" % user
def gotBuddyList( self, buddylist ):
self.activateSSI()
self.setProfile("Forget ICQ, MSN, Yahoo and the other shitty protocols! Use Jabber!")
self.setIdleTime( 0 )
self.clientReady()
for user in buddylist[0][0].users:
print "Authorize %s" % user.name
self.sendAuthorizationResponse(user.name, True, '')
print 'ICQ-Autoresponder-Bot aktiviert ;-)'
def receiveMessage( self, user, multiparts, flags ):
print "receiveMessage(%s,%s,%s)" % (user,multiparts,flags)
if "auto" in flags:
print "'auto' message, abort"
return
self.sendAuthorizationResponse(user.name, True, '')
if not self.omegleConns.has_key(user.name):
self.omegleConns[user.name] = OmegleICQChat(self,user)
try:
message = str(multiparts[0][0])
if not self.omegleConns[user.name].is_connected:
if message == "connect":
self.omegleConns[user.name].start()
self.sendMessage(user.name, "Connecting you to omegle")
else:
self.sendMessage(user.name, "Not connected, type >connect<")
elif self.omegleConns[user.name].is_connected and message == "disconnect":
try:
self.omegleConns[user.name].disconnect()
except Exception,e:
self.sendMessage(user.name, str(e))
self.sendMessage(user.name, "Disconnecting")
elif self.omegleConns[user.name].is_connected and not self.omegleConns[user.name].is_confirmed:
self.sendMessage(user.name, "Wait for connection confirm from omegle")
else:
self.omegleConns[user.name].send(message)
except Exception,e:
print "error: %s %s\n%s" % (user,multiparts,e)
def chatReceiveMessage( self, chat, user, message ):
self.receiveMessage( self, user, message, 0 )
def sendAuthorizationResponse(self, uin, success, responsString):
packet = struct.pack("b", len(uin)) + uin
if success:
packet += struct.pack("b", 1)
else:
packet += struct.pack("b", 0)
packet += struct.pack(">H", len(responsString)) + responsString
self.sendSNACnr(0x13, 0x1a, packet)
def connectionLost(self,reason):
oscar.BOSConnection.connectionLost(self,reason)
print reason
self.connect()
class OscarCrap( oscar.OscarAuthenticator ):
BOSClass = icqBot
log.startLogging(sys.stdout)
protocol.ClientCreator( reactor, OscarCrap, uin, password, icq=1 ).connectTCP( 'login.icq.com', 5238 )
reactor.run()
|