Ejemplo n.º 1
0
def main_track():
    query = ''
    if len(sys.argv) > 1:
        query = sys.argv[1]
    x = (json.dumps(cybercrimeTrackerAPI().search(query), indent=2))
    NAME_PATH = 'result/track_result.txt'
    with open(f'{NAME_PATH}', 'w') as f:
        f.write(x)
    print(f'{PULS} Success check /{NAME_PATH}')
Ejemplo n.º 2
0
    def run(self):
        observable = self.get_data()
        limit = 40
        offset = 0

        results = []

        try:
            while True:
                new_results = cybercrimeTrackerAPI().search(query=observable,
                                                            offset=offset,
                                                            limit=limit)
                results.extend(new_results)

                current_hit_count = len(new_results)
                no_more_results = current_hit_count < limit
                if no_more_results:
                    break
                offset += limit

            self.report({'results': results})
        except Exception:
            self.error('An error occured while scraping cybercrime-tracker.')
Ejemplo n.º 3
0
    def run(self):
        observable = self.get_data()
        limit = 40
        offset = 0

        results = []

        try:
            while True:
                new_results = cybercrimeTrackerAPI().search(query=observable, offset=offset, limit=limit)
                results.extend(new_results)

                current_hit_count = len(new_results)
                no_more_results = current_hit_count < limit
                if no_more_results:
                    break
                offset += limit

            self.report({
                'results': results
            })
        except Exception:
            self.error('An error occured while scraping cybercrime-tracker.')
Ejemplo n.º 4
0
print '\t*                               *'
print '\t* \tAuther @ShilpeshTrivedi *'
print '\t*********************************'
print '\n\n'

try:
    file_open = raw_input(' Enter File Name: - ')
    take = open(file_open, 'r')
    print '\n'
    file = open('cybercrime-tracker.net.csv', 'a')
    file.write('URL,Signature')
    file.write('\n')
    for lists in take:
        try:
            query = ''.join(lists.splitlines())
            temp = json.dumps(cybercrimeTrackerAPI().search(query))

            try:
                time.sleep(1)
                print ' [+] ' + query + " Found As -> " + json.dumps(
                    cybercrimeTrackerAPI().search(query)[0]['type'])
                file.write(query + ',' + json.dumps(
                    cybercrimeTrackerAPI().search(query)[0]['type']))
                file.write('\n')
            except:
                print ' [-] ' + query + " is not found on cybercrime-tracker.net :("
                file.write(query + ',No Result Found')
                file.write('\n')
        except KeyboardInterrupt:
            print "\n Program hasbeen halted Ctrl + C Pressed"
            print '\n\n Open cybercrime-tracker.net.csv file for result'
#!/usr/bin/python

from cybercrimetracker.cybercrimeTrackerAPI import cybercrimeTrackerAPI
import sys
import json

query = ''
if len(sys.argv) > 1:
    query = sys.argv[1]
print(json.dumps(cybercrimeTrackerAPI().search(query), indent=2))
Ejemplo n.º 6
0
def test_answer():
    query = 'Pony'
    results = cybercrimeTrackerAPI().search(query)
    assert len(results) > 0
Ejemplo n.º 7
0
def test_empty_query():
    query = ''
    results = cybercrimeTrackerAPI().search(query)
    assert len(results) > 0