際際滷

際際滷Share a Scribd company logo
ASYNCHRONICITY
19.7.2019 HACKERS¨ PARTY 2019
thread by adkeno06 on flickr, CC-BY-NC 2.0
ASYNCHRONICITY
WHO WE ARE
? Takahiro Yoshimura (@alterakey)?
Monolith Works Inc.?
Co-founder
? Shinya Kuroda (@ameOtoko)?
Monolith Works Inc.?
Security Analyst
ASYNCHRONICITY
WHAT WE DO
? Security research and development
? iOS/Android Apps?
★Financial, Games, IoT related, etc. (>200)?
★trueseeing: Non-decompiling Android Application
Vulnerability Scanner [2017]
? Windows/Mac/Web/HTML5 Apps?
★POS, RAD tools etc.
? Network/Web penetration testing?
★PCI-DSS etc.
? Search engine reconnaissance?
(aka. Google Hacking)
? Whitebox testing
? Forensic analysis
? Research?
★Clairvoyance: concurrent lip reader [2019]
ASYNCHRONICITY
WHAT WE DO
? CTF
? Enemy10, Sutegoma2
? METI CTFCJ 2012 Qual.: 1st
? METI CTFCJ 2012: 3rd
? DEF CON 21 CTF: 6th
? DEF CON 22 OpenCTF: 4th
? Talks:?
DEF CON 25 Demo Labs?
CODE BLUE 2017?
DEF CON 27 AI Village etc.
DEFCON 2016 by Wiyre Media on flickr, CC-BY 2.0
GRABBING
CAPTCHA
ACT. 1
screened by new 1llminati on flickr, CC-BY 2.0
ASYNCHRONICITY
ORDINAL GRAB..
? Grabbing CAPTCHAs
? in order to destroy them
? Let¨s review Dream Market case?
! seems that they are ^Nightmare ̄
ASYNCHRONICITY
ORDINAL GRAB.. NOT!
? Simple serial scraping strategy
? Loop and scrape
ASYNCHRONICITY
ORDINAL GRAB.. NOT!
? Horrid RTTs
? Normal strategy would take ages!
? Fail
FAIL
ASYNCHRONICITY
BRANCHING INTO BACKGROUND
? Forking into thread pool, with
venerable concurrent.futures.TPE?
(ThreadPoolExecutor)
? You have 2 executors:
? ThreadPoolExecutor
? ProcessPoolExecutor
ASYNCHRONICITY
BRANCHING INTO BACKGROUND
? GIL ! Global Interpreter Lock
? OS threads do not scale well
? OS processes can scale, but they
often have huge overhead?
(and require tasks to be pickled)?
! hence, we have used TPEs
? OS threads have cost?
- memory and context switches
? Suboptimal ! Needs more work..
ASYNCHRONICITY
DESYNCHRONIZED BEAUTY
? Pack as coroutines and stack up
with asyncio.gather et al.
? async / await (Python 3.5+)
? async def marks coroutines
? await runs and wait coroutines?
! hence, ^voluntary handoff ̄
? Cooperative threading
ASYNCHRONICITY
DESYNCHRONIZED BEAUTY
? Asynchronous, event based run
? Uses only one OS thread?
! just wait and handle events?
! uvloop gives us even more boost
? Negligible cost?
! A single fd in this case:?
only your limit is max open ?les?
! Async super parallel grabber!
? Optimal ! 12% better in this case
ASYNCHRONICITY
DESYNCHRONIZED BEAUTY
? Stubborn synchronous operations?
? Run them in TPEs through
BEL.run_in_executor!
? You can even combine PPEs to
sidestep GIL as needed
ASYNCHRONICITY
AN EXCELLENT NETWORK STACK, UVLOOP
? The heart of node.js
ASYNCHRONICITY
AN EXCELLENT NETWORK STACK, UVLOOP
? The heart of node.js
? Can go faster than node.js itself
ASYNCHRONICITY
AIOHTTP: ASYNCHRONOUS HTTP STACK
? Asynchronous HTTP stack
? Parser is not so fast (nor async.)?
! thanks for GIL
? httptools is more faster?
(and a bit low level)
ASYNCHRONICITY
LIMITING CONCURRENCY
? Tor DoS protection kicks in around
100 concurrent connections
? Enforcing concurrency?
- asyncio.Semaphore in coroutines?
- limit in connector (aiohttp)
MASS SCRAPING
ACT. 2
scrape by Katie McMahon on flickr, CC-BY-NC 2.0
ASYNCHRONICITY
CHASING FOR THE WIDTH
? Can we mass-scrape Web pages??
Say, 100 domains, from tor?
? Of course we can ;)
walker getting scraped off by Caffeinatrix on flickr, CC-BY-NC-ND 2.0
ASYNCHRONICITY
BASIC STRATEGY
? WebDriver (headless Firefox)
? Scenario:?
Save screenshot of the front page?
(from the dark web of course)
? You may feel like limit concurrency?
! WD will easily swamp you!
Wolf Pack by Neil McIntosh on flickr, CC-BY 2.0
ASYNCHRONICITY
LURKING IN THE DARKNESS
? Yes, WD can use tor
? Set up a custom pro?le
? network.proxy.type=1
network.proxy.socks=127.0.0.1?
network.proxy.socks_port=9150?
network.proxy.socks_version=5?
network.proxy.socks_remote_dns=t?
network.h.m-p-c-p-p=256?
network.h.p.v=1.1
ASYNCHRONICITY
SCRAPE THE DARKNESS
? Corpse: OnionDir
? 198 services
? RTT is horrid as always
ASYNCHRONICITY
SCRAPABLE!
? Normal scraping with WebDriver?
~2.5h @ 198 services
? Desynchronized WebDrivers?
~13m @ 198 services
? Feasible: 1000%~ better
Asynchronicity
ASYNCHRONICITY
SCRAPABLE? - CLEARWEB CASE
? Corpse: ?
Some of SANS Suspicious Domains?
(Medium Sensitivity Level)
? Colorful 150 domains
Hazards by El Bingle on flickr, CC-BY-NC 2.0
ASYNCHRONICITY
FACTS
? Normal scraping?
~30m @ 150 domains
? Desynchronized?
~8m @ 150 domains
Asynchronicity
Q?
FIN.
19.7.2019 MONOLITH WORKS INC.
Ad

Recommended

PDF
????????SNS ????????
?? ?
?
PDF
2017?? ???? ??
?? ?
?
PDF
Create a RESTful API with NodeJS, Express and MongoDB
Hengki Sihombing
?
ODP
Nodejs
Anupom Syam
?
PDF
Real time web
Medhat Dawoud
?
KEY
node.js dao
Vladimir Miguro
?
PDF
Building web apps with node.js, socket.io, knockout.js and zombie.js - Codemo...
Ivan Loire
?
PDF
Real timeninja - Codemotion 2015 Roma
MeanMilan
?
PPT
18_Node.js.ppt
KhalilSalhi7
?
PPT
18_Node.js.ppt
MaulikShah516542
?
PPT
Scalability using Node.js
ratankadam
?
PDF
Developing Async Sense
Nemanja Stojanovic
?
PPTX
Node.js: A Guided Tour
cacois
?
PDF
The art of concurrent programming
Iskren Chernev
?
PDF
Node.js Presentation
Exist
?
KEY
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Kyle Drake
?
PPTX
Async ... Await C concurrency in java script
Athman Gude
?
PPTX
Node.js Test
Maksym Kovalko
?
PDF
Nodejs a-practical-introduction-oredev
Felix Geisend?rfer
?
PDF
Why Node.js
guileen
?
PDF
Why Nodejs Guilin Shanghai
Jackson Tian
?
KEY
node.js: Javascript's in your backend
David Padbury
?
PDF
ESUG 2019: Concurrency
ESUG
?
PPT
Introduction to node.js aka NodeJS
JITENDRA KUMAR PATEL
?
PDF
I see deadlocks : Matt Ellis - Techorama NL 2024
citizenmatt
?
PDF
Node js internal
Chinh Ngo Nguyen
?
PPTX
Beginners Node.js
Khaled Mosharraf
?
PDF
酷#囂冱斤呟化殻會譜柴議屶隔
jeffz
?
PDF
Looking Back 2023
Takahiro Yoshimura
?
PDF
Fill In The Blank
Takahiro Yoshimura
?

More Related Content

Similar to Asynchronicity (20)

PPT
18_Node.js.ppt
KhalilSalhi7
?
PPT
18_Node.js.ppt
MaulikShah516542
?
PPT
Scalability using Node.js
ratankadam
?
PDF
Developing Async Sense
Nemanja Stojanovic
?
PPTX
Node.js: A Guided Tour
cacois
?
PDF
The art of concurrent programming
Iskren Chernev
?
PDF
Node.js Presentation
Exist
?
KEY
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Kyle Drake
?
PPTX
Async ... Await C concurrency in java script
Athman Gude
?
PPTX
Node.js Test
Maksym Kovalko
?
PDF
Nodejs a-practical-introduction-oredev
Felix Geisend?rfer
?
PDF
Why Node.js
guileen
?
PDF
Why Nodejs Guilin Shanghai
Jackson Tian
?
KEY
node.js: Javascript's in your backend
David Padbury
?
PDF
ESUG 2019: Concurrency
ESUG
?
PPT
Introduction to node.js aka NodeJS
JITENDRA KUMAR PATEL
?
PDF
I see deadlocks : Matt Ellis - Techorama NL 2024
citizenmatt
?
PDF
Node js internal
Chinh Ngo Nguyen
?
PPTX
Beginners Node.js
Khaled Mosharraf
?
PDF
酷#囂冱斤呟化殻會譜柴議屶隔
jeffz
?
18_Node.js.ppt
KhalilSalhi7
?
18_Node.js.ppt
MaulikShah516542
?
Scalability using Node.js
ratankadam
?
Developing Async Sense
Nemanja Stojanovic
?
Node.js: A Guided Tour
cacois
?
The art of concurrent programming
Iskren Chernev
?
Node.js Presentation
Exist
?
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Kyle Drake
?
Async ... Await C concurrency in java script
Athman Gude
?
Node.js Test
Maksym Kovalko
?
Nodejs a-practical-introduction-oredev
Felix Geisend?rfer
?
Why Node.js
guileen
?
Why Nodejs Guilin Shanghai
Jackson Tian
?
node.js: Javascript's in your backend
David Padbury
?
ESUG 2019: Concurrency
ESUG
?
Introduction to node.js aka NodeJS
JITENDRA KUMAR PATEL
?
I see deadlocks : Matt Ellis - Techorama NL 2024
citizenmatt
?
Node js internal
Chinh Ngo Nguyen
?
Beginners Node.js
Khaled Mosharraf
?
酷#囂冱斤呟化殻會譜柴議屶隔
jeffz
?

More from Takahiro Yoshimura (20)

PDF
Looking Back 2023
Takahiro Yoshimura
?
PDF
Fill In The Blank
Takahiro Yoshimura
?
PDF
Ticket To The Dark World
Takahiro Yoshimura
?
PDF
Looking back 2022
Takahiro Yoshimura
?
PDF
Hazy Datagrams
Takahiro Yoshimura
?
PDF
Wartime Pigeons
Takahiro Yoshimura
?
PDF
Securing Supply Chains
Takahiro Yoshimura
?
PDF
Looking Back: CIS on Managed K8S
Takahiro Yoshimura
?
PDF
Beijing Report 2022
Takahiro Yoshimura
?
PDF
Outsmarting Smartphone Apps 2
Takahiro Yoshimura
?
PDF
Outsmarting Smartphone Apps 2
Takahiro Yoshimura
?
PDF
Outsmarting Smartphone Apps
Takahiro Yoshimura
?
PDF
Drawing Dataflow On Dalvik Bytecodes
Takahiro Yoshimura
?
PDF
Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
Takahiro Yoshimura
?
PDF
10 (about make 10 with 4 numbers challenge)
Takahiro Yoshimura
?
PDF
Go goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Takahiro Yoshimura
?
PDF
Android Wear: Good Parts
Takahiro Yoshimura
?
PDF
DEFCON21〜S2 REPORT
Takahiro Yoshimura
?
KEY
司擇について #スクエアフリ`セミナ` #yochiand
Takahiro Yoshimura
?
KEY
GroovyなAndroidテスト #atest_hack
Takahiro Yoshimura
?
Looking Back 2023
Takahiro Yoshimura
?
Fill In The Blank
Takahiro Yoshimura
?
Ticket To The Dark World
Takahiro Yoshimura
?
Looking back 2022
Takahiro Yoshimura
?
Hazy Datagrams
Takahiro Yoshimura
?
Wartime Pigeons
Takahiro Yoshimura
?
Securing Supply Chains
Takahiro Yoshimura
?
Looking Back: CIS on Managed K8S
Takahiro Yoshimura
?
Beijing Report 2022
Takahiro Yoshimura
?
Outsmarting Smartphone Apps 2
Takahiro Yoshimura
?
Outsmarting Smartphone Apps 2
Takahiro Yoshimura
?
Outsmarting Smartphone Apps
Takahiro Yoshimura
?
Drawing Dataflow On Dalvik Bytecodes
Takahiro Yoshimura
?
Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
Takahiro Yoshimura
?
10 (about make 10 with 4 numbers challenge)
Takahiro Yoshimura
?
Go goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Takahiro Yoshimura
?
Android Wear: Good Parts
Takahiro Yoshimura
?
DEFCON21〜S2 REPORT
Takahiro Yoshimura
?
司擇について #スクエアフリ`セミナ` #yochiand
Takahiro Yoshimura
?
GroovyなAndroidテスト #atest_hack
Takahiro Yoshimura
?
Ad

Recently uploaded (20)

PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
?
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
?
PDF
The Growing Value and Application of FME & GenAI
Safe Software
?
PDF
UiPath Agentic AI ile Ak?ll? Otomasyonun Yeni ?a??
UiPathCommunity
?
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
?
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
?
PDF
^Scaling i.MX Applications Processors¨ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
?
PDF
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
?
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
?
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
?
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
?
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
?
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
?
PDF
Kubernetes - Architecture & Components.pdf
geethak285
?
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
?
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
?
PPTX
Simplifica la seguridad en la nube y la detecci┏n de amenazas con FortiCNAPP
Cristian Garcia G.
?
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
?
PPTX
UserCon Belgium: Honey, VMware increased my bill
stijn40
?
PDF
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
?
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
?
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
?
The Growing Value and Application of FME & GenAI
Safe Software
?
UiPath Agentic AI ile Ak?ll? Otomasyonun Yeni ?a??
UiPathCommunity
?
My Journey from CAD to BIM: A True Underdog Story
Safe Software
?
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
?
^Scaling i.MX Applications Processors¨ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
?
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
?
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
?
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
?
Why aren't you using FME Flow's CPU Time?
Safe Software
?
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
?
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
?
Kubernetes - Architecture & Components.pdf
geethak285
?
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
?
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
?
Simplifica la seguridad en la nube y la detecci┏n de amenazas con FortiCNAPP
Cristian Garcia G.
?
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
?
UserCon Belgium: Honey, VMware increased my bill
stijn40
?
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
?
Ad

Asynchronicity