Introduction
Woah, it has been a hell of a long time since I posted my last contribution (I feel like I always begin my blog post with these introductory words). However, today I want to show you how to forge random identites with a site called fakenamegenerator.com. I use Python 3 and a unoffical branch of socksipy, a nice module which enables you to tunnel TCP/IP streams through a remote server, commonly used to disguise your real IP address. There are three availabe modes, SOCKS4, SOCKS5 and HTTP. In this blog post, I use SOCKS5, since I install TOR and route my requests through a local proxy sitting on 127.0.0.1:9050.
Why and what
The team behind fakenamegenerator.com writes on their site:
Name: Names are generated by randomly pulling a first and a last name out of a database. The database was compiled from public domain sources. [...]
Street address: The house number is a randomly generated number. The street name is pulled from a database of plausible street names for the state/country being generated. Odds are that the generated street address is not valid.
City, state, and postal code: We have compiled a database containing hundreds of thousands of valid city, state, and postal code combinations. One of these combinations is randomly pulled from the database for each identity.
Telephone number: We have compiled a database of valid area codes and prefixes. One of these combinations is randomly pulled from the database, and then a random number of the appropriate length is added to the end to make the phone number the correct length.
Mother's maiden name: A random name is pulled from our database of last names, and listed as the "mother's maiden name".
Birthday: The birthday is a randomly generated date. [...]
Furthermore, and here we come to the reason of this blog post:
We do not condone, support, or encourage illegal activity of any kind. We will cooperate with law enforcement organizations to assist in the prosecution of anyone that misuses the information we provide or that asks us to provide illegal materials, such as forged documents or genuine credit card numbers.
I am convinced that they map every identity requested by a client to the corresponding IP address. Therefore, the generated identity is not anonymous, because your ip address can be mapped to your real identity over your internet service provider.
Solution
That's what I came up with to enforce the retrieval of anonymous
identites. This is actually the test_function()
which calls the function
scrape_identity()
which in turn extracts all the pieces constituting
the identity from fakenamegenerator.com. You can implement your own
application logic with scrape_identity()
. It just returns a list of
tuples, whereas each tuple contains the element name (such as 'name',
'birthdate', 'gender' ...) and the corresponding value.
def anon_identity():
"""This function is a example how to use scrape_identity() anonymously
through TOR. Used like that, you don't have to worry that your generated
identity is matched to your IP address and therefore to your real identity.
"""
# Set up a socks socket. You might want to fire up your local TOR PROXY, before
# using this function.
# Just download TOR here https://www.torproject.org/ and then start tor.
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5,'127.0.0.1', 9050)
socks.wrapmodule(urllib.request)
id = scrape_identity()
print('[+] Generated a random and anonymous identity:')
for e in id:
print('\t{0:.<20}{1}'.format(e[0], e[1]))
You can use my work like this:
$ git clone https://github.com/NikolaiT/anonymous_identity
$ cd anonymous_identity
$ python3
Python 3.2.3 (default, Oct 19 2012, 19:53:16)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from identity_generator import anon_identity
>>> anon_identity()
[+] Generated a random and anonymous identity:
full_name...........Kyle M. Cuevas
address.............1136 Ethels Lane
phone_number........863-703-6140
mother_maiden_name..Powell
birthdate...........August 2, 1994
blood_group.........A+
weight..............70.0 kilograms
height..............186 centimeters
>>>