• Home
  • Become a Hacker
    • Get Started
    • Hacker Mindset
    • Roadmap
    • Simple Setup – Hacker 101
    • Types of Hackers
    • Recommended Courses
  • Boot People Offline
  • Courses
    • All Hacking Courses
    • Cyber Security School
  • CTF
    • Beginners to Advanced Guide
    • Create your own CTF box
    • Field and Resources Guide
    • Platforms & Wargames
    • Tools Used for Solving CTF
    • Writeups
  • Dark Web
    • Beginners Guide
    • Darknet Markets
    • Darkweb 101 (Anonymity Guide)
    • Dark Web OSINT Tools
    • Hacking Forums
    • Latest News
    • Onion Links
  • Hacker Gadgets
  • Hacking Books
  • Tools Directory
Menu
  • Home
  • Become a Hacker
    • Get Started
    • Hacker Mindset
    • Roadmap
    • Simple Setup – Hacker 101
    • Types of Hackers
    • Recommended Courses
  • Boot People Offline
  • Courses
    • All Hacking Courses
    • Cyber Security School
  • CTF
    • Beginners to Advanced Guide
    • Create your own CTF box
    • Field and Resources Guide
    • Platforms & Wargames
    • Tools Used for Solving CTF
    • Writeups
  • Dark Web
    • Beginners Guide
    • Darknet Markets
    • Darkweb 101 (Anonymity Guide)
    • Dark Web OSINT Tools
    • Hacking Forums
    • Latest News
    • Onion Links
  • Hacker Gadgets
  • Hacking Books
  • Tools Directory
Search
Close
  • Home
  • 2021
  • December
  • 23
  • TrojanSourceFinder – Help Find Trojan Source Vulnerability In Code

TrojanSourceFinder – Help Find Trojan Source Vulnerability In Code

December 23, 2021 Comments Off on TrojanSourceFinder – Help Find Trojan Source Vulnerability In Code
TrojanSourceFinder - Help Find Trojan Source Vulnerability In Code cybersecurity ethical hacking hack android hack app hack wordpress hacker news hacking hacking tools for windows keylogger kit kitploit password brute force penetration testing pentest pentest android pentest linux pentest toolkit pentest tools spy tool kit spyware tools

TrojanSourceFinder helps developers detect “Trojan Source” vulnerability in source code.

Trojan Source vulnerability allows an attacker to make malicious code appear innocent. In general, the attacker tries to lure by passing his code off as a comment (visually). It is a serious threat because it concerns many languages. Projects with multiple “untrusted” sources could be concerned

Install

With go

> Via go install

go install github.com/ariary/TrojanSourceFinder/cmd/[email protected]

Make sure $GOPATH is in your $PATH

> From source

git clone https://github.com/ariary/TrojanSourceFinder
cd TrojanSourceFinder
make before.build
make build.tsfinder

If the command make build.tsfinder failed, try:

env GOOS=target-OS GOARCH=target-architecture
go build -o tsfinder cmd/main.go

With curl

> From release

curl -lO -L https://github.com/ariary/TrojanSourceFinder/releases/latest/download/tsfinder && chmod +x tsfinder

Detect Trojan Source

> Help the detection of Trojan source for manual code review or with CI/CD pipelines (Unicode bidirectional characaters)

To detect Trojan source in file or directory <path>:

tsfinder [path]

Detect only in text file

> Source code files are likely text files. Withdraw them for scan could help to rule out false positives

tsfinder -t [path]

Add -v help to see which file has been skipped by scan.

Go further (Homoglyph)

Trojan Source is not new and isn’t the only hazard. Another one is “Homoglyph”.(Kezako?)

tsfinder help detecting them with homoglyph command:

homoglyph [filename] [flags] “>

tsfinder homoglyph [filename] [flags]

You could see if there is a sibling (ie word with same “skeleton”) for the homographs found in path using the flag --sibling:

tsfinder homoglyph [filename] --sibling [path] 

Functionality under development, mainly depending on other project

Visualize Trojan Source

> Visualize how the code is really interpreted by machines/compiler

tsfinder is deliberately not very verbose. By default, it will only output if Trojan Source code has been detected. To have more verbosity and visualize the dangerous line add the flag -v.

To better see where Trojan Sources were, you could enable colored output with -c flag (also useful with directory scan):

tsfinder -c -v <directory>

Demo

 

Homoglyph

 

Alternative

As mentioned by @ioah86 here, trojan source could also been detected w/ a one liner using grep.

The big difference is the output format and the exitstatus code (tsfinder exit with status code 0 if no Trojan source has been found, 1 otherwise; the opposite for grep)

Also, this one-liner does not resolve the homoglyph issue

Goal tsfinder grep one-liner
Scan all files + show lines tsfinder -v . grep -arE $'(u2066|u2067|u2068|u202A|u202B|u202D|u202E|u202C|u2069|u200E|u200F|u061C|u2066|u2067|u2068)'
Scan only on human-readable files tsfinder -t . grep -IrE $'(u2066|u2067|u2068|u202A|u202B|u202D|u202E|u202C|u2069|u200E|u200F|u061C|u2066|u2067|u2068)'
Exit with status code 1 if found default [one-liner] && exit 1 || exit 0
Download TrojanSourceFinder

Post navigation

Apache HTTP Server CVE-2021-44224, CVE-2021-44790 Vulnerabilities Alert
turdshovel: dump objects from .NET memory dumps

Related Articles

CVE-2022-2586/CVE-2022-2585/CVE-2022-2588: Linux kernel LPE flaw

CVE-2022-2586/CVE-2022-2585/CVE-2022-2588: Linux kernel LPE flaw

- Hack Tools
August 10, 2022
OSRipper: AV evading OSX Backdoor and Crypter Framework

OSRipper: AV evading OSX Backdoor and Crypter Framework

- Hack Tools
August 10, 2022
CVE-2022-36267: Airspan AirSpot unauthenticated remote command injection flaw

CVE-2022-36267: Airspan AirSpot unauthenticated remote command injection flaw

- Hack Tools
August 9, 2022
hacker gadgets
hacker phone covers

Recent Posts

BitMEX Employee Admits Violating Bank Secrecy Act

BitMEX Employee Admits Violating Bank Secrecy Act

August 10, 2022
CVE-2022-2586/CVE-2022-2585/CVE-2022-2588: Linux kernel LPE flaw

CVE-2022-2586/CVE-2022-2585/CVE-2022-2588: Linux kernel LPE flaw

August 10, 2022
OSRipper: AV evading OSX Backdoor and Crypter Framework

OSRipper: AV evading OSX Backdoor and Crypter Framework

August 10, 2022
Two Sentenced for Selling Fake Oxy Pills on the Darkweb

Two Sentenced for Selling Fake Oxy Pills on the Darkweb

August 10, 2022
CVE-2022-36267: Airspan AirSpot unauthenticated remote command injection flaw

CVE-2022-36267: Airspan AirSpot unauthenticated remote command injection flaw

August 9, 2022
MrKaplan - Tool Aimed To Help Red Teamers To Stay Hidden By Clearing Evidence Of Execution

MrKaplan – Tool Aimed To Help Red Teamers To Stay Hidden By Clearing Evidence Of Execution

August 9, 2022

Social Media Hacking

SocialPath – Track users across Social Media Platforms

SocialPath – Track users across Social Media Platforms

- Social Media Hacking
October 16, 2019October 16, 2019

SocialPath is a django application for gathering social media intelligence on specific username. It checks for Twitter, Instagram, Facebook, Reddit...

SocialScan – Check Email Address and Username Availability on Online Platforms

SocialScan – Check Email Address and Username Availability on Online Platforms

June 17, 2019
Shellphish – Phishing Tool For 18 Social Media Apps

Shellphish – Phishing Tool For 18 Social Media Apps

June 10, 2019July 27, 2019
WhatsApp Hacking using QRLJacking

WhatsApp Hacking using QRLJacking

May 2, 2019May 19, 2019
How to Hack any Facebook Account with Z-Shadow

How to Hack any Facebook Account with Z-Shadow

April 26, 2019June 29, 2020
hacker buffs

About Us

Haxf4rall is a collective, a good starting point and provides a variety of quality material for cyber security professionals.

Join Our Community!

Please wait...
Get the latest News and Hacking Tools delivered to your inbox.
Don't Worry ! You will not be spammed

Active Members

Submit a Tool

Hackers Handbook 2018


Grab your copy here

ABOUT US

Haxf4rall is a collective, a good starting point and provides a variety of quality material for cyber security professionals.

Our primary focus revolves around the latest tools released in the Infosec community and provide a platform for developers to showcase their skillset and current projects.

COMPANY
  • Contact Us
  • Disclaimer
  • Hacker Gadgets
  • LANC Remastered
  • PCPS IP Puller
  • Privacy Policy
  • Sitemap
  • Submit your Tool
Menu
  • Contact Us
  • Disclaimer
  • Hacker Gadgets
  • LANC Remastered
  • PCPS IP Puller
  • Privacy Policy
  • Sitemap
  • Submit your Tool
Live Chat
RESOURCES
  • Attack Process
  • Become a Hacker
  • Career Pathways
  • Dark Web
  • Hacking Books
  • Practice Your Skills
  • Recommended Courses
  • Simple Setup – Hacker 101
Menu
  • Attack Process
  • Become a Hacker
  • Career Pathways
  • Dark Web
  • Hacking Books
  • Practice Your Skills
  • Recommended Courses
  • Simple Setup – Hacker 101
Get Started
TOOLBOX
  • Anonymity
  • Bruteforce
  • DoS – Denial of Service
  • Information Gathering
  • Phishing
  • SQL Injection
  • Vulnerability Scanners
  • Wifi Hacking
Menu
  • Anonymity
  • Bruteforce
  • DoS – Denial of Service
  • Information Gathering
  • Phishing
  • SQL Injection
  • Vulnerability Scanners
  • Wifi Hacking
Tools Directory

2014 – 2020 | Haxf4rall.com               Stay Connected:

Facebook Twitter Google-plus Wordpress
Please wait...

Join Our Community

Subscribe now and get your free HACKERS HANDBOOK

Don't Worry ! You will not be spammed
SIGN UP FOR NEWSLETTER NOW