netsec / translate-transforms

Maltego transforms for translating Simplified Chinese text into English or Pinyin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maltego Chinese Language Transforms

A set of three maltego local transforms useful for handling and translating Chinese character strings. The three transforms can offer the following options when assigned as local transforms to various entities in Maltego:

  • Translate Simplified Chinese characters to English
  • Translate English to Simplified Chinese characters
  • Translate Simplified Chinese characters to Pinyin.

Getting Started

I frequently use Chinese language data sources within Maltego charts. For example, data sourced from Weibo, web scrapes, forums, bbs and even Chinese language entries in WHOIS records. I thought it useful to have a simple set of machine translation transforms at my fingertips within Maltego as i'm building my charts.

Prerequisites

The transforms are written in Python 2.7.

Baidu's Fanyi translation API is used to translate between Simplified Chinese and English and vice versa.

A fantastic Python module pinyin is used to translate Simplified characters to Pinyin. Read more here

You'll need the following Python modules installed too if you don't already have them:

import requests
import json
import md5
import urllib

and

import MaltegoTransform

This last module import is the Maltego python transform library. You can grab a copy from the Maltego developer site.

Installing

You'll need to sign up to Baidu's services in order to set up an APP and obtain credentials for use with the translation API. Unless translating large volumes of text, the free tier offering is usually generous enough.

Place your Baidu APP ID and API Key in the baiduApiKey.py file.

The pinyin module is available from PyPI and can easily be installed as follows:

pip install pinyin

Configure the local transforms in Maltego, see the Configuration Guide. In short, you'll need to link the transforms to specific entity types and point Maltego to both your local Python installation and your local copy of these transform scripts.

Running the Transforms

These transforms can be run like any other local transforms. I find it useful to add all three into a Maltego Transform Set named "Translation", making it easier to group and locate them all in one place on Maltego menus.

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Maltego transforms for translating Simplified Chinese text into English or Pinyin


Languages

Language:Python 100.0%