this code is HORRIBLE
This commit is contained in:
parent
4b4419b8d6
commit
e1032ddc4b
11
ircbot.go
11
ircbot.go
@ -267,19 +267,22 @@ func ircbot() {
|
|||||||
fmt.Println("[IRC][drinkin] New drinker! " + Sender)
|
fmt.Println("[IRC][drinkin] New drinker! " + Sender)
|
||||||
drinkin = append(drinkin, Sender)
|
drinkin = append(drinkin, Sender)
|
||||||
} else {
|
} else {
|
||||||
|
fmt.Println("[IRC][drinkin] Existing drinker " + Sender)
|
||||||
drinkyBoys = strings.Join(drinkin, " ")
|
drinkyBoys = strings.Join(drinkin, " ")
|
||||||
|
drinkyBoys = strings.Replace(drinkyBoys, "nil ", "", -1)
|
||||||
Phone(c, Sender + " takes another swig ;D")
|
Phone(c, Sender + " takes another swig ;D")
|
||||||
Phone(c, ".drinkin: " + drinkyBoys)
|
Phone(c, " ------> " + drinkyBoys)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ircDrinkin(c)
|
ircDrinkin(c)
|
||||||
Phone(c,drinkyBoys)
|
drinkyBoys = strings.Join(drinkin," ")
|
||||||
|
Phone(c," ------> "+drinkyBoys)
|
||||||
|
|
||||||
case ".sober":
|
case ".sober":
|
||||||
if contains(drinkin,Sender) {
|
if contains(drinkin,Sender) {
|
||||||
for i, v := range drinkin {
|
for i, v := range drinkin {
|
||||||
if v == Sender {
|
if v == Sender {
|
||||||
rmKey(drinkin, i)
|
drinkin[i] = "nil"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
from __future__ import absolute_import, division
|
|
||||||
|
|
||||||
import cowrie.core.cef
|
|
||||||
import cowrie.core.output
|
|
||||||
from cowrie.core.config import CowrieConfig
|
|
||||||
|
|
||||||
|
|
||||||
class Output(cowrie.core.output.Output):
|
|
||||||
"""
|
|
||||||
sh0rtbus fifo output
|
|
||||||
"""
|
|
||||||
|
|
||||||
def start(self):
|
|
||||||
self.format = CowrieConfig().get('output_sh0rtbus', 'format')
|
|
||||||
|
|
||||||
def stop(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def write(self, logentry):
|
|
||||||
if self.format == 'cef':
|
|
||||||
self.outfile.write('{0} '.format(logentry['timestamp']))
|
|
||||||
self.outfile.write('{0}\n'.format(cowrie.core.cef.formatCef(logentry)))
|
|
||||||
else:
|
|
||||||
self.outfile = open(CowrieConfig().get('output_sh0rtbus', 'fifo'), 'w')
|
|
||||||
self.outfile.write('{0}\n'.format(logentry['message']))
|
|
||||||
self.outfile.close()
|
|
3
util.go
3
util.go
@ -30,6 +30,3 @@ func printSlice(s []string) {
|
|||||||
fmt.Printf("len=%d cap=%d %v\n", len(s), cap(s), s)
|
fmt.Printf("len=%d cap=%d %v\n", len(s), cap(s), s)
|
||||||
}
|
}
|
||||||
|
|
||||||
func rmKey(s []string, index int) []string {
|
|
||||||
return append(s[:index], s[index+1:]...)
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user