-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DGA of Reconyc. Uses unpredictable seeding, but might still be intere…
…sting for testing DGA detection algorithms.
- Loading branch information
Showing
4 changed files
with
194 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
""" | ||
UNPREDICTABLE DGA OF RECONYC | ||
from sample: d7e3bbdc38aa18b214fed3518798b86b | ||
unpacks to: db0820a974dbea22d981bd39ddb19518 | ||
""" | ||
|
||
|
||
import random | ||
|
||
class Mersenne: | ||
|
||
def __init__(self, seed): | ||
self.n = 624 | ||
self.w = 32 | ||
self.wm = (2**32) - 1 | ||
self.r = 31 | ||
self.f = 1812433253 | ||
self.a = 0x9908B0DF | ||
self.u = 11 | ||
self.s = 7 | ||
self.t = 15 | ||
self.d = 0xFFFFFFFF | ||
self.b = 0x9D2C5680 | ||
self.c = 0xEFC60000 | ||
self.l = 18 | ||
self.m = 397 | ||
self.seed = seed | ||
self.seed_b = ~seed | ||
self.mt = self.n*[0] | ||
self.lower_mask = (1 << self.r) - 1 | ||
self.upper_mask = (1 << self.r) | ||
|
||
def seed_mt(self): | ||
self.mt[0] = self.seed | ||
for i in range(self.n-1): | ||
self.mt[i+1] = (self.f * ((self.mt[i] >> 30) ^ self.mt[i]) + i+1) & self.wm | ||
|
||
|
||
def extract_number(self): | ||
if self.seed != self.seed_b: | ||
self.index = self.n + 1 | ||
if self.index >= self.n: | ||
if self.index == self.n + 1: | ||
self.seed_mt() | ||
self.seed = ~self.seed | ||
self.seed_b = self.seed | ||
self.twist() | ||
self.index = 0 | ||
|
||
y = self.mt[self.index] | ||
y ^= (y >> self.u) & self.d | ||
y ^= (y << self.s) & self.b | ||
y ^= (y << self.t) & self.c | ||
y ^= (y >> self.l) | ||
self.index += 1 | ||
return y | ||
|
||
def twist(self): | ||
for i in range(self.n-1): | ||
a = (self.mt[i] & self.upper_mask) | ||
b = (self.mt[(i+1) % self.n]) & self.lower_mask | ||
x = a + b | ||
x = x & self.wm | ||
xA = (x >> 1) | ||
if x % 2: | ||
xA = (xA ^ self.a) | ||
self.mt[i] = self.mt[(i+self.m) % self.n] ^ xA | ||
|
||
self.index = 0 | ||
|
||
|
||
def randint(mersenne, nr): | ||
x = mersenne.extract_number() | ||
return (nr*x) >> 32 | ||
|
||
charset = "iHRYg79zJXaGw1CF5K0d3vZobhAlx6StUBnjOIMpe2yVuPr4sL8DqmQTkEcWNf" | ||
seed = random.randint(0, 1000*3600*24) | ||
|
||
if __name__ == "__main__": | ||
mersenne = Mersenne(seed) | ||
for nr in range(100): | ||
domain = "" | ||
for i in range(10): | ||
c = charset[randint(mersenne, len(charset))] | ||
domain += c | ||
domain += ".com" | ||
print(domain) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
E5zHail0Mw.com | ||
gabbvK2o6s.com | ||
CumpP2A4d7.com | ||
5eswmwNQyF.com | ||
lExfSzyuwP.com | ||
JZpESGsPFF.com | ||
UmIaRnijeT.com | ||
sHr0xE9Idm.com | ||
nYcEX7wlCF.com | ||
VCiZNQXwpO.com | ||
jrabA0uADi.com | ||
2CHRDMJCn8.com | ||
8Fy9HrI6L0.com | ||
4iJrMaTQGq.com | ||
MgejR2qk1Z.com | ||
5tLcnUK0Fl.com | ||
8mlV0fuiZe.com | ||
oDlxd5WMQ6.com | ||
jPehlf2DZ0.com | ||
cEo0IpTw3V.com | ||
dfyYXZFMOF.com | ||
F7VIjoWcBW.com | ||
gkS1SKBpsT.com | ||
OXX1YBqRS2.com | ||
QMWSaNkfjH.com | ||
AP6sVH4NjR.com | ||
TJ8HvEvIHe.com | ||
Txn7eurrUO.com | ||
qGBmOt66wl.com | ||
1n7Qt95D9P.com | ||
wBDnz3JrUi.com | ||
AjPVfofkEe.com | ||
EOCt4xKLAe.com | ||
cOmD4SwNhr.com | ||
Sffl6HYLwo.com | ||
Fd9SWliuje.com | ||
tV0IB0oumC.com | ||
it9ig4o1I5.com | ||
pcrPSf5foc.com | ||
XbyGBRLUvb.com | ||
dS5IDfsn3Y.com | ||
XHCDKw3v1c.com | ||
oZpxsSC3i9.com | ||
45VkkHTj80.com | ||
AVCSmyrWlV.com | ||
b5PXe4V1NU.com | ||
bnPuhN9bXi.com | ||
7emSZAWjNQ.com | ||
EqSIqS9Xsa.com | ||
p8MBqpYvkQ.com | ||
chh8HyJr2d.com | ||
TIn43nNqTT.com | ||
yqbR72lnZu.com | ||
3CR2klxkzV.com | ||
wNp1bcWoop.com | ||
gbXGpS0Cns.com | ||
7BPX12raoE.com | ||
b2lMenGDo5.com | ||
zMK6T9EmBs.com | ||
McLlG9MNQs.com | ||
DMmch7VFsY.com | ||
9dIgslL9HG.com | ||
H1jIWxLxea.com | ||
4ZrNPi04zF.com | ||
Gtm7OUmHCL.com | ||
1r4obCrAyF.com | ||
2W4LKG1PTZ.com | ||
xwQDxruNrC.com | ||
eq9RdwY3vB.com | ||
zXENFCujRp.com | ||
qPbLvqM4B1.com | ||
Zy1NHHGpmh.com | ||
rWFR5CMMgz.com | ||
u82VxEPDbw.com | ||
FbLWj8otmq.com | ||
GppI6jjFCx.com | ||
qagdIUTh85.com | ||
Mc7F9L6ba6.com | ||
wLIv2cJSDB.com | ||
4mSUff3NZu.com | ||
08aj1n4Q3p.com | ||
dhYUAtqo7S.com | ||
kbgKJEkMJ8.com | ||
YD40k2CYJr.com | ||
CNssgcTcye.com | ||
8p1do0X3QC.com | ||
QM7X1Jn1cz.com | ||
q5GJ8RcOkB.com | ||
hJ6RiyqdjU.com | ||
HWksG9v9B5.com | ||
XoQbJGsWA4.com | ||
Yje4DGRkxX.com | ||
2iIk00nDVX.com | ||
l9Fr9pEwQH.com | ||
JP7VCIc646.com | ||
4zjiKxEAkd.com | ||
KifUbqb7AB.com | ||
VqimhZ25be.com | ||
jzBQqH2cxl.com | ||
2eP8Mh320n.com |