Exemple #1
0
 def test_log(self):
     ''' validate that log behaves like print() '''
     rxpwn.log(b'abcd', 'abcd')
     print(b'abcd', 'abcd')
     l1 = strip_ansi(self.stdout.readline())
     l2 = '[+] ' + self.stdout.readline()
     self.assertEqual(l1, l2)
Exemple #2
0
 def test_log(self):
     ''' validate that log behaves like print() '''
     rxpwn.log(b'abcd', 'abcd')
     print(b'abcd', 'abcd')
     l1 = strip_ansi(self.stdout.readline())
     l2 = '[+] ' + self.stdout.readline()
     self.assertEqual(l1, l2)
Exemple #3
0
def _solve_challenge_worker(arg):
    from rxpwn import log
    from hashlib import sha1
    from itertools import product

    i, s1, x, n, charset = arg
    log("proof of work ...", i*(len(charset)**n))
    for s2 in product(charset, repeat=n):
        s = ''.join(s1 + s2)
        
        # changeme
        news = x + s
        if sha1(news).digest().endswith('\xff\xff\xff'):
            return news
Exemple #4
0
def _solve_challenge_worker(arg):
    from rxpwn import log
    from hashlib import sha1
    from itertools import product

    i, s1, x, n, charset = arg
    log("proof of work ...", i * (len(charset)**n))
    for s2 in product(charset, repeat=n):
        s = ''.join(s1 + s2)

        # changeme
        news = x + s
        if sha1(news).digest().endswith('\xff\xff\xff'):
            return news