<commit_before># cymru-asnmap.py

cymru-asnmap.py is a python script to perform bulk IP submissions to the Team Cymru
whois service.

More on the Team Cymru Whois service: http://www.team-cymru.org/IP-ASN-mapping.html

## Dependencies
The netaddr module: https://pypi.python.org/pypi/netaddr

```
pip install netaddr
```

## Usage

```
usage: cymru-asnmap.py [-h] [-f] [-o FILENAME] target

positional arguments:
  target                Target to be queried.

optional arguments:
  -h, --help            show this help message and exit
  -f, --file            Load IPs from a file.
  -o FILENAME, --output FILENAME
                        Output CSV file.
```

### Examples

#### CIDR
```
$ python cymru-asnmap.py 192.168.3.11/29
Bulk mode; whois.cymru.com [2016-05-02 04:40:56 +0000]
23028   | 192.168.3.11      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 172.16.17.32      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 172.16.17.32      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 192.168.127.12      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 192.168.3.11      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 192.168.127.12      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 172.16.17.32      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 172.16.17.32      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
```


#### List of IPs from a file
```
$ python cymru-asnmap.py -f input.txt
Bulk mode; whois.cymru.com [2016-05-02 04:34:05 +0000]
23028   | 192.168.127.12      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
6079    | 192.168.3.11   | 192.168.3.11/18    | US | arin     |            | RCN-AS - RCN, US
701     | 172.16.58.3       | 192.168.127.12/16        | US | arin     |            | UUNET - MCI Communications Services, Inc. d/b/a Verizon Business, US
```

# License
* Copyright (c) 2016, <NAME> - Check the LICENSE file for license.
* Team Cymru WHOIS Copyright (c) 2015 Team Cymru. All Rights Reserved.
<commit_msg>Update to README.md<commit_after># cymru-asnmap.py

cymru-asnmap.py is a python script to perform bulk IP submissions to the Team Cymru
whois service.

More on the Team Cymru Whois service: http://www.team-cymru.org/IP-ASN-mapping.html

## Dependencies
The netaddr module: https://pypi.python.org/pypi/netaddr

```
pip install netaddr
```

## Usage

```
usage: cymru-asnmap.py [-h] [-f] [-o FILENAME] target

positional arguments:
  target                Target to be queried (CIDR or filename).

optional arguments:
  -h, --help            show this help message and exit
  -f, --file            Loads the IPs from a file.
  -o FILENAME, --output FILENAME
                        Output CSV file.
```

### Examples

#### CIDR
```
$ python cymru-asnmap.py 192.168.3.11/29
Bulk mode; whois.cymru.com [2016-05-02 04:40:56 +0000]
23028   | 192.168.3.11      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 172.16.17.32      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 172.16.17.32      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 192.168.127.12      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 192.168.3.11      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 192.168.127.12      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 172.16.17.32      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
23028   | 172.16.17.32      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
```


#### List of IPs from a file
```
$ python cymru-asnmap.py -f input.txt
Bulk mode; whois.cymru.com [2016-05-02 04:34:05 +0000]
23028   | 192.168.127.12      | 192.168.3.11/24      | US | arin     | 2002-03-15 | TEAM-CYMRU - Team Cymru Inc., US
6079    | 192.168.3.11   | 192.168.3.11/18    | US | arin     |            | RCN-AS - RCN, US
701     | 172.16.58.3       | 192.168.127.12/16        | US | arin     |            | UUNET - MCI Communications Services, Inc. d/b/a Verizon Business, US
```

# License
* Copyright (c) 2016, <NAME> - Check the LICENSE file for license.
* Team Cymru WHOIS Copyright (c) 2015 Team Cymru. All Rights Reserved.

{'fraction_non_alphanumeric': 0.14641809803100125, 'fraction_numerical': 0.17008797653958943, 'mean_word_length': 1.9438964241676941, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 46, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4363720', 'n_tokens_mistral': 2486, 'n_tokens_neox': 1885, 'n_words': 492}