Perils Of Phone Collection

Share

Why Do We Care?

Sigray catchers, commonly/legally sold in the US, can catch IMEI numbers and conversations. This is scary, as a bad actor could hinder on US persons, businesses, or agencies. In the spring of 2017, OSINT claimed that the Chinese were able to break INMARSAT in 90 seconds. Yes, 90 seconds to break encrypted communications almost a decade ago. Using real movies like Die Hard Or Live Free (John McClean) or Red Dawn (Jed Eckert), we have adversaries willing to leverage signals interception against us. Defeating these potential threats in the future requires Americans to be knowledgeable on how it works. So please, work through this source to have a greater appreciation of how to defend America's freedoms!

Who Benefits The Most?

Every American citizen should know how to do all of signals intelligence. The price of liberty is eternal vigilance. Having the knowledge and ability to defend the day we as a society are tested is critical! It's time we have the right to bear cyber arms :P

Fake Narrative Of John McClean Against Woodlawn Terrorists

As I stared down the barrel of yet another perilous mission, little did I know that the villains I was up against had employed a cunning strategy that would expose my location in the dark and treacherous tunnel. It was a high-stakes game of cat and mouse, and the key to unraveling my whereabouts lay in the unsuspecting world of phone interception. This is the tale of how phone interception became their lethal weapon, leading them straight to my tunnel hideout.

It all began when I stumbled upon a trail that led me to Woodlawn, a seemingly innocuous facility for record collection. Little did I know that this unassuming building was a hub of malicious activity, and the bad guys were using it as a base for their nefarious operations. With every step I took, the shadows grew deeper, and the danger intensified.

Unbeknownst to me, the villains had tapped into the intricate network of phone interception, utilizing advanced technology to eavesdrop on private conversations and track the movements of unsuspecting individuals. It was a sophisticated system that allowed them to pry into the lives of ordinary citizens, turning their personal devices into silent informants. And unfortunately, I was just another unsuspecting victim caught in their web.

As I navigated the labyrinthine tunnels, relying on my instincts and survival skills, the bad guys were utilizing their vast resources to trace my every move. They had intercepted my communication with my trusted allies and deduced that I was headed toward Woodlawn, their fortress of darkness. The moment my voice resonated through the airwaves, it became a breadcrumb leading them straight to my location.

With their knowledge of my intentions and my last known position, the bad guys deployed their agents strategically to cut off my escape routes. The tunnel, once my refuge from danger, quickly transformed into a trap, closing in on me like the jaws of a predator. The sense of claustrophobia intensified as I realized that my every step, every breath, was being monitored by an unseen enemy.

Their mastery of phone interception gave them the upper hand, allowing them to anticipate my movements and counter my every move. Each attempt to evade their clutches only seemed to tighten the net around me. It was as if they had an omniscient presence, always one step ahead, always ready to strike.

To make matters worse, the bad guys skillfully exploited the intercepted phone conversations to disseminate false information about my whereabouts. They sowed confusion among law enforcement agencies, misleading them into pursuing decoy targets, diverting their attention from the real battlefield—the dark heart of the tunnel.

As I fought my way through a seemingly insurmountable obstacle course of adversaries, I realized that my reliance on communication had become a fatal flaw. The very device that had connected me to my allies had also become a beacon illuminating my path for those I sought to destroy. In this technological battlefield, silence and isolation were my only allies.

With grit and determination, I pressed on, shedding my reliance on conventional means of communication. I embraced the shadows, moving swiftly and silently, using my wits and resourcefulness to outmaneuver the enemy that lurked in the darkness. It was a game of survival, a dance on the precipice of danger, where a single misstep could spell disaster.

In the end, it was my ability to adapt, to think outside the box, that allowed me to outsmart the villains. By embracing unconventional methods of communication and relying on my own instincts, I managed to evade their grasp and expose their true intentions to the world.

Phone interception had become their trump card, a powerful weapon that almost led to my downfall.

Real Life Examples

Intuition

We have a SIGINT op looking at selector attributes (ex. IMEI) that are being monitored by a stingray (aka Def Con). So how do we keep track of this in a clean, systematic interface that a client can understand??? How about writing a Hit class that maintains state data associated with this problem. That way you only have to track the self.hits instance variable (a list). If you implement the third extension it's easy for new cyber professionals... Or should I say newbie NSAers.

Extensions

  1. Since we created a Hit class that maintains state data, we could easily create a Pythonic Iterator.
  2. This problem is biased... in the real world you wouldn't hit data retention banks in a strictly increasing fashion. For instance, a cyber attack is usually detected 6 months after compromise (FBI)... You would be parsing logs in haphazard fashions.
  3. Due to the constraints of this problem, use the previous two extensions, I included a last_five_mins variable in the hit dataclass. As you add more hit instances to the instance self.hits variable, you could maintain a temporal sliding window associated with previous hits. SOO... instead of beating 99.5% of Python users you would beat 100%. But that's hardly realistic unless your maintaining the back in time website.

from dataclasses import dataclass

@dataclass
class Hit:
    timestamp: int
    past_five_mins: int = 1
    count: int = 1

    def update(self):
        self.count += 1

    def hits(self):
        return self.count

    def get(self):
        return self.timestamp

    # Option to change the time zone here
    def __repr__(self):
        return self.get()

    # Option to change the format for logging purposes
    def __str__(self):
        return str(self.__repr__)

class HitCounter:
    def __init__(self):
        self.hits = []
        self.length = 0

    def hit(self, timestamp: int) -> None:
        if self.length and self.hits[-1].get() == timestamp:
            self.hits[-1].update()
        else:
            self.hits.append(Hit(timestamp))
            self.length += 1

    def getHits(self, timestamp: int) -> int:
        hits = 0

        for idx in range(self.length - 1, -1, -1):
            diff = timestamp - (item := self.hits[idx]).get()
            if diff < 300 and diff >= 0:
                hits += item.hits()
            else:
                break

        return hits

# Your HitCounter object will be instantiated and called as such:
# obj = HitCounter()
# obj.hit(timestamp)
# param_2 = obj.getHits(timestamp)

import random
import doctest

class PhoneCounter:
    def __init__(self):
        self.phones = {}
        
    def hit(self, number, timestamp):
        """
        Add a hit to the PhoneCounter for the given number and timestamp.

        >>> counter = PhoneCounter()
        >>> counter.hit(1234567890, 100)
        >>> counter.phones
        {1234567890: [100]}
        >>> counter.hit(1234567890, 200)
        >>> counter.phones
        {1234567890: [100, 200]}
        """
        if number not in self.phones.keys():
            self.phones[number] = [timestamp]
        else:
            self.phones[number].append(timestamp)
            
    def getHits(self, timestamp, selector=None, duration=300):
        """
        Get the number of hits within the given timestamp and optional selector.

        If no selector is provided, it returns the total hits for all numbers within the duration.

        >>> counter = PhoneCounter()
        >>> counter.hit(1234567890, 100)
        >>> counter.hit(1234567890, 200)
        >>> counter.hit(9876543210, 300)
        >>> counter.getHits(150)
        2
        >>> counter.getHits(250, selector=1234567890)
        1
        >>> counter.getHits(350, selector=9876543210)
        1
        >>> counter.getHits(450, selector=1234567890)
        0
        """
        if len(self.phones.keys()) == 0:
            return 0
        
        if selector is None:
            hits = 0
            for key, val in self.phones.items():
                ptr = len(val) - 1
                while ptr >= 0 and abs(timestamp - val[ptr]) <= duration:
                    hits += 1
                    ptr -= 1
            return hits
        elif selector in self.phones.keys():
            hits = 0
            for val in self.phones[selector]:
                if abs(timestamp - val) <= duration:
                    hits += 1
            return hits
    
    def getSelector(self, number, timestamp=None, duration=300):
        """
        Get the selector (list of timestamps) for the given number and optional timestamp.

        If timestamp is provided, it returns the timestamps within the duration of the given timestamp.
        Otherwise, it returns all timestamps for the given number.

        >>> counter = PhoneCounter()
        >>> counter.hit(1234567890, 100)
        >>> counter.hit(1234567890, 200)
        >>> counter.hit(9876543210, 300)
        >>> counter.getSelector(1234567890)
        [100, 200]
        >>> counter.getSelector(9876543210)
        [300]
        >>> counter.getSelector(1234567890, 250)
        [200]
        >>> counter.getSelector(5555555555)
        'Number not found!'
        """
        number = str(number)
        if number in self.phones.keys():
            try:
                if abs(timestamp - self.phones[number][-1]) <= duration:
                    return [x for x in self.phones[number] if abs(timestamp - x) <= duration]
                else:
                    return self.phones[number]
            except:
                return "Error"
        return "Number not found!"
    
    def database(self, number=None):
        """
        Get the database of numbers and their respective hit timestamps.

        If no number is provided, it returns the entire database.
        If a number is provided, it returns the hit timestamps for that number.

        >>> counter = PhoneCounter()
        >>> counter.hit(1234567890, 100)
        >>> counter.hit(1234567890, 200)
        >>> counter.hit(9876543210, 300)
        >>> counter.database()
        dict_items([(1234567890, [100, 200]), (9876543210, [300])])
        >>> counter.database(1234567890)
        [100, 200]
        >>> counter.database(9876543210)
        [300]
        >>> counter.database(5555555555)
        'Number not found!'
        """
        if number is None:
            return self.phones.items()
        elif number in self.phones.keys():
            return self.phones[number]
        else:
            return "Number not found!"

if __name__ == '__main__':
    doctest.testmod()