SlideShare a Scribd company logo
1 of 18
Analyzing Shodan
Images with Optical
Character Recognition
Shmoocon XV, 2019/01/19
Michael Portera
Product names mentioned in this document are the trademarks or registered trademarks of their respective
owners and are mentioned for identification purposes only.
About me
• Primary domains include threat hunting and OSINT
• B.S. and M.S. from Auburn University
• Certs: OSCP, OSWP, CEH, CISSP, CRISC, Sec+, ITILv3
• Twitter: @mportatoes
Overview
• Previous Raspberry Pi projects used optimal character
recognition (OCR) – how can this be applied to
information security?
• Create a process cost-effectively and with a low level of
effort
• Started applying OCR to Shodan Images in September
2018 for establishing attribution and possible third-
party risk
• What are other applications of this within information
security?
Mistakes Were Made
query: "attention"+"encrypted"+port:3389, “Shared” query on 2019/01/01
Simple Process
Determine
Volume of
Screenshots on
Shodan
Run Shodan API
script or CLI to
collect images
Use AWS CLI to
invoke
Rekognition
service
Write output to
csv, databases,
json, etc.
Analyze the data
Shodan
• “Shodan is the world’s first search engine for Internet-
connected devices”1
• Free “Membership” with .edu account (one-time
payment of $50 otherwise, $5 during Black Friday)
• Allows image downloads (10k/month) and access to
images.shodan.io
• Free tier if no .edu or money
• No bulk downloads or access to images.shodan.io
• Can still obtain screenshots via API
• OCR for RDP images introduced in late December 2018
1 – According to shodan.io
Shodan
• Can use filters to determine the volume of screenshots
before running scripts
• has_screenshot:true org:"Amazon.com" port:3389
country:US
Shodan
• If using the Membership Tier
• Easier to use the Shodan CLI
• pip install shodan
• shodan init YOUR_API_KEY
• shodan download --limit -1 file.json.gz "has_screenshot:true
port:3389"
• shodan convert file.json.gz images
• If using the Free Tier
• Can’t download images from CLI
• Use API script: https://github.com/mportatoes/shodan_ocr
AWS Rekognition and the CLI
• Rekognition
• Machine learning API that performs OCR and other visual
analytics like object/scene/activity detection, facial
recognition, etc.
• Scan 5k images per month with the Free Tier for one year
• Can use local files directly with the API
• AWS CLI
• Setup Identity Access Management (IAM)
• pip install boto3
• Update local config file with secret keys for IAM user:
~/.aws/credentials
Automagic
• Rekognition script
• Available at https://github.com/mportatoes/shodan_ocr
• python rekognition.py –[t,o] –d image_directory/ -s IP
• t = send to text detection API
• o = send to object detection API
• d = directory of images to lookup in AWS
• s = lookup single IP in shodan and send to Rekognition
• Interpreting Line versus Word
• Lines can help us determine quickly if there are multiple
accounts, warning banners, etc.
• Foreign characters will appear as random English
characters in AWS
Sample Rekognition Output
Alternatives – Google Cloud Vision
English and Greek
JapanesePortuguese
Chinese
ICS and IoT via VNC – Text Detection
Search Query: shodan download --limit -1 vnc.json.gz "has_screenshot:true port:5900,5901"
• Download Date: 2019-01-02
• Query: VNC, has screenshot
• Images Analyzed: 2,375
• Identified ICS & IoT devices: 319 (~13%)
• Tagged by Shodan: 12
• Total New ICS and IoT: 307 (96%)
Motor Power
Liter/Litre On/Off
Calibration Solar
Plant kw, kg, mm, etc
Temp Control
Pump Rows of Numbers
Valve Frequency
Agri Thermo
Light Timer
Sample KeywordsScope
Discovered Devices
12
256
51
0
50
100
150
200
250
300
ICS IoT
Other Findings
= Tagged by Shodan
= New ICS and IoT Hacking Attempt - 92.63.197.[48,60]/malware.exe
1
4
6
12
0 5 10 15
Cyber Vigilante
Clear-Text Passwords
Email Address
Hacking Attempt
Sample Applications
• Offensive:
• Reconnaissance: Naming conventions of endpoints, usernames,
and domains with minimal effort
• Social engineering scenarios (e.g., knowing who was logged into
a cloud instance in near real time)
• Could be useful for other processes like analyzing massive
amounts of RDP/VNC screenshots from EyeWitness or
screenshots from meterpreter sessions
• Defensive:
• Identifying rogue/unmanaged cloud instances for the
organization
• Identifying third-party risk
• Threat Intelligence:
• Identifying ransomware victims or IPs/domains being used for
malware
• Other
Webcams – Object Detection
Search Query: shodan download --limit -1 obj_det.json.gz "has_screenshot:true !port:3389 !port:3388 !port:5901
!port:5900 country:US“
*Many of these were taken at night or completely blank and defaulted to these terms
• Download Date: 2018-12-17
• Images Analyzed: 1,965
• Unique Labels for Detected Objects: 891
Label Count
Outdoors 900
Nature 891
Building 581
Night* 392
Indoors 356
Astronomy* 354
Universe 347
Space* 347
Outer Space* 347
Urban 307
Top 10 LabelsScope
Privacy Concerns
0
20
40
60
80
100
120
140
160
180
Results: Webcam – Object Detection
Label Confidence
Building 98.88651
Factory 98.6945
Brewery 95.17644
Lighting 77.66161
Transportation 65.89301
Train 65.89301
Vehicle 65.89301
Barrel 63.07454
Architecture 60.08447
Urban 56.75611
AnalysisXX.XXX.XX.247:80
Results: Webcam – Object Detection
Label Confidence
Nature 99.83994
Outdoors 99.47083
Piste 98.90309
Person 98.90309
Sport 98.90309
Snow 98.90309
Sports 98.90309
Human 98.90309
Yard 81.48057
AnalysisXX.XXX.XX.172:80
Other Uses for Text & Obj. Det.
• TraceLabs: Capture The Flag (CTF) for missing persons
• Use facial recognition to identify missing person in photos or
video collection
• Physical Security:
• Video doorbell + video analysis + passive Wi-Fi monitoring
• Video analysis of personnel + badging
• Data Loss Prevention:
• Detect sensitive content in an image file

More Related Content

What's hot

Bypass Security Checking with Frida
Bypass Security Checking with FridaBypass Security Checking with Frida
Bypass Security Checking with FridaSatria Ady Pradana
 
External to DA, the OS X Way
External to DA, the OS X WayExternal to DA, the OS X Way
External to DA, the OS X WayStephan Borosh
 
(Training) Malware - To the Realm of Malicious Code
(Training) Malware - To the Realm of Malicious Code(Training) Malware - To the Realm of Malicious Code
(Training) Malware - To the Realm of Malicious CodeSatria Ady Pradana
 
Android pen test basics
Android pen test basicsAndroid pen test basics
Android pen test basicsOWASPKerala
 
[OPD 2019] Storm Busters: Auditing & Securing AWS Infrastructure
[OPD 2019] Storm Busters: Auditing & Securing AWS Infrastructure[OPD 2019] Storm Busters: Auditing & Securing AWS Infrastructure
[OPD 2019] Storm Busters: Auditing & Securing AWS InfrastructureOWASP
 
[OPD 2019] Web Apps vs Blockchain dApps
[OPD 2019] Web Apps vs Blockchain dApps[OPD 2019] Web Apps vs Blockchain dApps
[OPD 2019] Web Apps vs Blockchain dAppsOWASP
 
[OPD 2019] Automated Defense with Serverless computing
[OPD 2019] Automated Defense with Serverless computing[OPD 2019] Automated Defense with Serverless computing
[OPD 2019] Automated Defense with Serverless computingOWASP
 
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021Florian Roth
 
Sharpening your Threat-Hunting Program with ATTACK Framework
Sharpening your Threat-Hunting Program with ATTACK FrameworkSharpening your Threat-Hunting Program with ATTACK Framework
Sharpening your Threat-Hunting Program with ATTACK FrameworkMITRE - ATT&CKcon
 
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSFAppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSFAjin Abraham
 
Defcon 27 - Phishing in the Cloud Era
Defcon 27 - Phishing in the Cloud EraDefcon 27 - Phishing in the Cloud Era
Defcon 27 - Phishing in the Cloud EraNetskope
 
The Web Application Hackers Toolchain
The Web Application Hackers ToolchainThe Web Application Hackers Toolchain
The Web Application Hackers Toolchainjasonhaddix
 
Introduction to MITRE ATT&CK
Introduction to MITRE ATT&CKIntroduction to MITRE ATT&CK
Introduction to MITRE ATT&CKArpan Raval
 
BlueHat v18 || Tales from the soc - real-world attacks seen through azure atp...
BlueHat v18 || Tales from the soc - real-world attacks seen through azure atp...BlueHat v18 || Tales from the soc - real-world attacks seen through azure atp...
BlueHat v18 || Tales from the soc - real-world attacks seen through azure atp...BlueHat Security Conference
 
How-To Find Malicious Backdoors and Business Logic Vulnerabilities in Your Code
How-To Find Malicious Backdoors and Business Logic Vulnerabilities in Your CodeHow-To Find Malicious Backdoors and Business Logic Vulnerabilities in Your Code
How-To Find Malicious Backdoors and Business Logic Vulnerabilities in Your CodeDevOps.com
 
Fruit vs Zombies: Defeat Non-jailbroken iOS Malware by Claud Xiao
Fruit vs Zombies:  Defeat Non-jailbroken iOS Malware by Claud XiaoFruit vs Zombies:  Defeat Non-jailbroken iOS Malware by Claud Xiao
Fruit vs Zombies: Defeat Non-jailbroken iOS Malware by Claud XiaoShakacon
 
[CB16] BLE authentication design challenges on smartphone controlled IoT devi...
[CB16] BLE authentication design challenges on smartphone controlled IoT devi...[CB16] BLE authentication design challenges on smartphone controlled IoT devi...
[CB16] BLE authentication design challenges on smartphone controlled IoT devi...CODE BLUE
 
Threat Intelligence Field of Dreams
Threat Intelligence Field of DreamsThreat Intelligence Field of Dreams
Threat Intelligence Field of DreamsGreg Foss
 
From Reversing to Exploitation
From Reversing to ExploitationFrom Reversing to Exploitation
From Reversing to ExploitationSatria Ady Pradana
 

What's hot (20)

Bypass Security Checking with Frida
Bypass Security Checking with FridaBypass Security Checking with Frida
Bypass Security Checking with Frida
 
External to DA, the OS X Way
External to DA, the OS X WayExternal to DA, the OS X Way
External to DA, the OS X Way
 
(Training) Malware - To the Realm of Malicious Code
(Training) Malware - To the Realm of Malicious Code(Training) Malware - To the Realm of Malicious Code
(Training) Malware - To the Realm of Malicious Code
 
Injection flaw teaser
Injection flaw teaserInjection flaw teaser
Injection flaw teaser
 
Android pen test basics
Android pen test basicsAndroid pen test basics
Android pen test basics
 
[OPD 2019] Storm Busters: Auditing & Securing AWS Infrastructure
[OPD 2019] Storm Busters: Auditing & Securing AWS Infrastructure[OPD 2019] Storm Busters: Auditing & Securing AWS Infrastructure
[OPD 2019] Storm Busters: Auditing & Securing AWS Infrastructure
 
[OPD 2019] Web Apps vs Blockchain dApps
[OPD 2019] Web Apps vs Blockchain dApps[OPD 2019] Web Apps vs Blockchain dApps
[OPD 2019] Web Apps vs Blockchain dApps
 
[OPD 2019] Automated Defense with Serverless computing
[OPD 2019] Automated Defense with Serverless computing[OPD 2019] Automated Defense with Serverless computing
[OPD 2019] Automated Defense with Serverless computing
 
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
 
Sharpening your Threat-Hunting Program with ATTACK Framework
Sharpening your Threat-Hunting Program with ATTACK FrameworkSharpening your Threat-Hunting Program with ATTACK Framework
Sharpening your Threat-Hunting Program with ATTACK Framework
 
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSFAppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
 
Defcon 27 - Phishing in the Cloud Era
Defcon 27 - Phishing in the Cloud EraDefcon 27 - Phishing in the Cloud Era
Defcon 27 - Phishing in the Cloud Era
 
The Web Application Hackers Toolchain
The Web Application Hackers ToolchainThe Web Application Hackers Toolchain
The Web Application Hackers Toolchain
 
Introduction to MITRE ATT&CK
Introduction to MITRE ATT&CKIntroduction to MITRE ATT&CK
Introduction to MITRE ATT&CK
 
BlueHat v18 || Tales from the soc - real-world attacks seen through azure atp...
BlueHat v18 || Tales from the soc - real-world attacks seen through azure atp...BlueHat v18 || Tales from the soc - real-world attacks seen through azure atp...
BlueHat v18 || Tales from the soc - real-world attacks seen through azure atp...
 
How-To Find Malicious Backdoors and Business Logic Vulnerabilities in Your Code
How-To Find Malicious Backdoors and Business Logic Vulnerabilities in Your CodeHow-To Find Malicious Backdoors and Business Logic Vulnerabilities in Your Code
How-To Find Malicious Backdoors and Business Logic Vulnerabilities in Your Code
 
Fruit vs Zombies: Defeat Non-jailbroken iOS Malware by Claud Xiao
Fruit vs Zombies:  Defeat Non-jailbroken iOS Malware by Claud XiaoFruit vs Zombies:  Defeat Non-jailbroken iOS Malware by Claud Xiao
Fruit vs Zombies: Defeat Non-jailbroken iOS Malware by Claud Xiao
 
[CB16] BLE authentication design challenges on smartphone controlled IoT devi...
[CB16] BLE authentication design challenges on smartphone controlled IoT devi...[CB16] BLE authentication design challenges on smartphone controlled IoT devi...
[CB16] BLE authentication design challenges on smartphone controlled IoT devi...
 
Threat Intelligence Field of Dreams
Threat Intelligence Field of DreamsThreat Intelligence Field of Dreams
Threat Intelligence Field of Dreams
 
From Reversing to Exploitation
From Reversing to ExploitationFrom Reversing to Exploitation
From Reversing to Exploitation
 

Similar to Shmoocon XV - Analyzing Shodan Images with Optical Character Recognition

SANS_PentestHackfest_2022-PurpleTeam_Cloud_Identity.pptx
SANS_PentestHackfest_2022-PurpleTeam_Cloud_Identity.pptxSANS_PentestHackfest_2022-PurpleTeam_Cloud_Identity.pptx
SANS_PentestHackfest_2022-PurpleTeam_Cloud_Identity.pptxJasonOstrom1
 
Continuous Integration: Live Static Analysis with Puma Scan
Continuous Integration: Live Static Analysis with Puma ScanContinuous Integration: Live Static Analysis with Puma Scan
Continuous Integration: Live Static Analysis with Puma ScanCypress Data Defense
 
Sumo Logic Cert Jam - Security Analytics
Sumo Logic Cert Jam - Security AnalyticsSumo Logic Cert Jam - Security Analytics
Sumo Logic Cert Jam - Security AnalyticsSumo Logic
 
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Rob Fuller
 
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Chris Gates
 
Abusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec gloryAbusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec gloryPriyanka Aash
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysJoff Thyer
 
Discover advanced threats with threat intelligence - Jeremy Li
Discover advanced threats with threat intelligence - Jeremy LiDiscover advanced threats with threat intelligence - Jeremy Li
Discover advanced threats with threat intelligence - Jeremy LiJeremy Li
 
Bsidesnova- Pentesting Methodology - Making bits less complicated
Bsidesnova- Pentesting Methodology - Making bits less complicatedBsidesnova- Pentesting Methodology - Making bits less complicated
Bsidesnova- Pentesting Methodology - Making bits less complicatedOctavio Paguaga
 
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015Ajin Abraham
 
Scalable, Automated Anomaly Detection with GuardDuty, CloudTrail, & Amazon Sa...
Scalable, Automated Anomaly Detection with GuardDuty, CloudTrail, & Amazon Sa...Scalable, Automated Anomaly Detection with GuardDuty, CloudTrail, & Amazon Sa...
Scalable, Automated Anomaly Detection with GuardDuty, CloudTrail, & Amazon Sa...Amazon Web Services
 
Osint, shoelaces, bubblegum
Osint, shoelaces, bubblegumOsint, shoelaces, bubblegum
Osint, shoelaces, bubblegumJamieMcMurray
 
Intrigue Core: Scaling Assessment Automation
Intrigue Core: Scaling Assessment AutomationIntrigue Core: Scaling Assessment Automation
Intrigue Core: Scaling Assessment AutomationJonathan Cran
 
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015Ajin Abraham
 
Pentesting iOS Applications
Pentesting iOS ApplicationsPentesting iOS Applications
Pentesting iOS Applicationsjasonhaddix
 
Attacking and Defending Mobile Applications
Attacking and Defending Mobile ApplicationsAttacking and Defending Mobile Applications
Attacking and Defending Mobile ApplicationsJerod Brennen
 
Python-Assisted Red-Teaming Operation
Python-Assisted Red-Teaming OperationPython-Assisted Red-Teaming Operation
Python-Assisted Red-Teaming OperationSatria Ady Pradana
 
Blue Teaming On A Budget
Blue Teaming On A BudgetBlue Teaming On A Budget
Blue Teaming On A BudgetKevinRiley83
 

Similar to Shmoocon XV - Analyzing Shodan Images with Optical Character Recognition (20)

SANS_PentestHackfest_2022-PurpleTeam_Cloud_Identity.pptx
SANS_PentestHackfest_2022-PurpleTeam_Cloud_Identity.pptxSANS_PentestHackfest_2022-PurpleTeam_Cloud_Identity.pptx
SANS_PentestHackfest_2022-PurpleTeam_Cloud_Identity.pptx
 
Continuous Integration: Live Static Analysis with Puma Scan
Continuous Integration: Live Static Analysis with Puma ScanContinuous Integration: Live Static Analysis with Puma Scan
Continuous Integration: Live Static Analysis with Puma Scan
 
Sumo Logic Cert Jam - Security Analytics
Sumo Logic Cert Jam - Security AnalyticsSumo Logic Cert Jam - Security Analytics
Sumo Logic Cert Jam - Security Analytics
 
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
 
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
 
Abusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec gloryAbusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec glory
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
 
Discover advanced threats with threat intelligence - Jeremy Li
Discover advanced threats with threat intelligence - Jeremy LiDiscover advanced threats with threat intelligence - Jeremy Li
Discover advanced threats with threat intelligence - Jeremy Li
 
Bsidesnova- Pentesting Methodology - Making bits less complicated
Bsidesnova- Pentesting Methodology - Making bits less complicatedBsidesnova- Pentesting Methodology - Making bits less complicated
Bsidesnova- Pentesting Methodology - Making bits less complicated
 
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
 
Scalable, Automated Anomaly Detection with GuardDuty, CloudTrail, & Amazon Sa...
Scalable, Automated Anomaly Detection with GuardDuty, CloudTrail, & Amazon Sa...Scalable, Automated Anomaly Detection with GuardDuty, CloudTrail, & Amazon Sa...
Scalable, Automated Anomaly Detection with GuardDuty, CloudTrail, & Amazon Sa...
 
Osint, shoelaces, bubblegum
Osint, shoelaces, bubblegumOsint, shoelaces, bubblegum
Osint, shoelaces, bubblegum
 
Intrigue Core: Scaling Assessment Automation
Intrigue Core: Scaling Assessment AutomationIntrigue Core: Scaling Assessment Automation
Intrigue Core: Scaling Assessment Automation
 
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015
 
Pentesting iOS Applications
Pentesting iOS ApplicationsPentesting iOS Applications
Pentesting iOS Applications
 
Azure sentinel
Azure sentinelAzure sentinel
Azure sentinel
 
Attacking and Defending Mobile Applications
Attacking and Defending Mobile ApplicationsAttacking and Defending Mobile Applications
Attacking and Defending Mobile Applications
 
The Hookshot: Runtime Exploitation
The Hookshot: Runtime ExploitationThe Hookshot: Runtime Exploitation
The Hookshot: Runtime Exploitation
 
Python-Assisted Red-Teaming Operation
Python-Assisted Red-Teaming OperationPython-Assisted Red-Teaming Operation
Python-Assisted Red-Teaming Operation
 
Blue Teaming On A Budget
Blue Teaming On A BudgetBlue Teaming On A Budget
Blue Teaming On A Budget
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Shmoocon XV - Analyzing Shodan Images with Optical Character Recognition

  • 1. Analyzing Shodan Images with Optical Character Recognition Shmoocon XV, 2019/01/19 Michael Portera Product names mentioned in this document are the trademarks or registered trademarks of their respective owners and are mentioned for identification purposes only.
  • 2. About me • Primary domains include threat hunting and OSINT • B.S. and M.S. from Auburn University • Certs: OSCP, OSWP, CEH, CISSP, CRISC, Sec+, ITILv3 • Twitter: @mportatoes
  • 3. Overview • Previous Raspberry Pi projects used optimal character recognition (OCR) – how can this be applied to information security? • Create a process cost-effectively and with a low level of effort • Started applying OCR to Shodan Images in September 2018 for establishing attribution and possible third- party risk • What are other applications of this within information security?
  • 4. Mistakes Were Made query: "attention"+"encrypted"+port:3389, “Shared” query on 2019/01/01
  • 5. Simple Process Determine Volume of Screenshots on Shodan Run Shodan API script or CLI to collect images Use AWS CLI to invoke Rekognition service Write output to csv, databases, json, etc. Analyze the data
  • 6. Shodan • “Shodan is the world’s first search engine for Internet- connected devices”1 • Free “Membership” with .edu account (one-time payment of $50 otherwise, $5 during Black Friday) • Allows image downloads (10k/month) and access to images.shodan.io • Free tier if no .edu or money • No bulk downloads or access to images.shodan.io • Can still obtain screenshots via API • OCR for RDP images introduced in late December 2018 1 – According to shodan.io
  • 7. Shodan • Can use filters to determine the volume of screenshots before running scripts • has_screenshot:true org:"Amazon.com" port:3389 country:US
  • 8. Shodan • If using the Membership Tier • Easier to use the Shodan CLI • pip install shodan • shodan init YOUR_API_KEY • shodan download --limit -1 file.json.gz "has_screenshot:true port:3389" • shodan convert file.json.gz images • If using the Free Tier • Can’t download images from CLI • Use API script: https://github.com/mportatoes/shodan_ocr
  • 9. AWS Rekognition and the CLI • Rekognition • Machine learning API that performs OCR and other visual analytics like object/scene/activity detection, facial recognition, etc. • Scan 5k images per month with the Free Tier for one year • Can use local files directly with the API • AWS CLI • Setup Identity Access Management (IAM) • pip install boto3 • Update local config file with secret keys for IAM user: ~/.aws/credentials
  • 10. Automagic • Rekognition script • Available at https://github.com/mportatoes/shodan_ocr • python rekognition.py –[t,o] –d image_directory/ -s IP • t = send to text detection API • o = send to object detection API • d = directory of images to lookup in AWS • s = lookup single IP in shodan and send to Rekognition • Interpreting Line versus Word • Lines can help us determine quickly if there are multiple accounts, warning banners, etc. • Foreign characters will appear as random English characters in AWS
  • 12. Alternatives – Google Cloud Vision English and Greek JapanesePortuguese Chinese
  • 13. ICS and IoT via VNC – Text Detection Search Query: shodan download --limit -1 vnc.json.gz "has_screenshot:true port:5900,5901" • Download Date: 2019-01-02 • Query: VNC, has screenshot • Images Analyzed: 2,375 • Identified ICS & IoT devices: 319 (~13%) • Tagged by Shodan: 12 • Total New ICS and IoT: 307 (96%) Motor Power Liter/Litre On/Off Calibration Solar Plant kw, kg, mm, etc Temp Control Pump Rows of Numbers Valve Frequency Agri Thermo Light Timer Sample KeywordsScope Discovered Devices 12 256 51 0 50 100 150 200 250 300 ICS IoT Other Findings = Tagged by Shodan = New ICS and IoT Hacking Attempt - 92.63.197.[48,60]/malware.exe 1 4 6 12 0 5 10 15 Cyber Vigilante Clear-Text Passwords Email Address Hacking Attempt
  • 14. Sample Applications • Offensive: • Reconnaissance: Naming conventions of endpoints, usernames, and domains with minimal effort • Social engineering scenarios (e.g., knowing who was logged into a cloud instance in near real time) • Could be useful for other processes like analyzing massive amounts of RDP/VNC screenshots from EyeWitness or screenshots from meterpreter sessions • Defensive: • Identifying rogue/unmanaged cloud instances for the organization • Identifying third-party risk • Threat Intelligence: • Identifying ransomware victims or IPs/domains being used for malware • Other
  • 15. Webcams – Object Detection Search Query: shodan download --limit -1 obj_det.json.gz "has_screenshot:true !port:3389 !port:3388 !port:5901 !port:5900 country:US“ *Many of these were taken at night or completely blank and defaulted to these terms • Download Date: 2018-12-17 • Images Analyzed: 1,965 • Unique Labels for Detected Objects: 891 Label Count Outdoors 900 Nature 891 Building 581 Night* 392 Indoors 356 Astronomy* 354 Universe 347 Space* 347 Outer Space* 347 Urban 307 Top 10 LabelsScope Privacy Concerns 0 20 40 60 80 100 120 140 160 180
  • 16. Results: Webcam – Object Detection Label Confidence Building 98.88651 Factory 98.6945 Brewery 95.17644 Lighting 77.66161 Transportation 65.89301 Train 65.89301 Vehicle 65.89301 Barrel 63.07454 Architecture 60.08447 Urban 56.75611 AnalysisXX.XXX.XX.247:80
  • 17. Results: Webcam – Object Detection Label Confidence Nature 99.83994 Outdoors 99.47083 Piste 98.90309 Person 98.90309 Sport 98.90309 Snow 98.90309 Sports 98.90309 Human 98.90309 Yard 81.48057 AnalysisXX.XXX.XX.172:80
  • 18. Other Uses for Text & Obj. Det. • TraceLabs: Capture The Flag (CTF) for missing persons • Use facial recognition to identify missing person in photos or video collection • Physical Security: • Video doorbell + video analysis + passive Wi-Fi monitoring • Video analysis of personnel + badging • Data Loss Prevention: • Detect sensitive content in an image file