<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: James Kabingu</title>
    <description>The latest articles on DEV Community by James Kabingu (@james-kabingu).</description>
    <link>https://dev.to/james-kabingu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3935876%2F397a3190-d386-4435-96f3-399778abcc32.jpeg</url>
      <title>DEV Community: James Kabingu</title>
      <link>https://dev.to/james-kabingu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/james-kabingu"/>
    <language>en</language>
    <item>
      <title>I Built a Web3 Threat Intelligence Oracle Powered by Gemma 4</title>
      <dc:creator>James Kabingu</dc:creator>
      <pubDate>Sun, 17 May 2026 23:35:36 +0000</pubDate>
      <link>https://dev.to/james-kabingu/i-built-a-web3-threat-intelligence-oracle-powered-by-gemma-4-283p</link>
      <guid>https://dev.to/james-kabingu/i-built-a-web3-threat-intelligence-oracle-powered-by-gemma-4-283p</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-gemma-2026-05-06"&gt;Gemma 4 Challenge: Build with Gemma 4&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;OCTIO (On-Chain Threat Intelligence Oracle) is a system that monitors live phishing and malware feeds, runs each threat indicator through Gemma 4 for analysis and classification, and stores verified intelligence in a format that blockchain protocols can query before executing sensitive operations.&lt;br&gt;
The problem it solves is real. Around 80% of funds stolen from Web3 projects come not from smart contract exploits but from attacks on surrounding Web2 infrastructure such as phishing campaigns, DNS hijacking, frontend supply chain compromise, and cloud misconfiguration. The Ronin Network hack ($625 million) started with a phishing email. The Ledger Connect Kit attack ($600,000) came from a poisoned npm package. The Curve Finance DNS hijack redirected legitimate users to a malicious server for hours.&lt;br&gt;
In every case, observable signals existed before significant losses occurred. OCTIO is the infrastructure to collect, analyse, and distribute those signals with Gemma 4 at the core of the intelligence layer.&lt;/p&gt;

&lt;p&gt;What makes OCTIO different from existing oracles:&lt;br&gt;
Chainlink, API3, and Band Protocol solve the general oracle problem, they relay data from off-chain to on-chain reliably. OCTIO is not a general oracle. It is a security-specific intelligence primitive that no existing oracle network addresses.&lt;br&gt;
The key difference is the intelligence layer. Existing oracles relay data they move a number or a string from a source to a smart contract. OCTIO reasons about data. Gemma 4 identifies impersonation targets, assesses severity, explains its reasoning, and flags suspicious domains not yet in any threat feed, from domain pattern alone. When metamask-security-alert.com was queried, it was not in the registry, but Gemma 4 returned SUSPICIOUS/CAUTION from the domain structure alone. No existing oracle does this.&lt;br&gt;
The second difference is incident correlation. When a DeFi protocol queries Chainlink, it gets a data point. When it queries OCTIO, it gets a threat assessment correlated against documented historical losses from similar attack patterns, giving protocol teams the context they actually need to make decisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Demo: GitHub: github.com/OCTIO-Labs/octio&lt;/p&gt;

&lt;p&gt;Running the full system takes nine commands:&lt;br&gt;
python3 monitor.py      # fetch and classify live phishing URLs with Gemma 4&lt;br&gt;
python3 dns_monitor.py  # enrich with VirusTotal DNS data -- dual-source confidence scoring&lt;br&gt;
python3 reputation.py   # score domain reputation over time -- CONFIRMED_THREAT classification&lt;br&gt;
python3 profiles.py     # build protocol-specific risk profiles -- CRITICAL/HIGH risk ratings&lt;br&gt;
python3 prediction.py   # Gemma 4 predictive threat intelligence -- next-target prediction&lt;br&gt;
python3 web3_bridge.py  # submit verified indicators to live Sepolia contract&lt;br&gt;
python3 oracle.py       # run protocol query interface&lt;br&gt;
python3 correlation.py  # correlate against documented incidents&lt;br&gt;
python3 dashboard.py    # display full system dashboard&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9qkw45qlqg11ep2fxiu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9qkw45qlqg11ep2fxiu.png" alt="OCTIO Dashboard" width="799" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sample oracle output:&lt;br&gt;
[BLOCK  ] [CRITICAL  ] &lt;a href="http://www.dpdlocoqu.cyou/com" rel="noopener noreferrer"&gt;http://www.dpdlocoqu.cyou/com&lt;/a&gt;&lt;br&gt;
[PROCEED] [SAFE      ] &lt;a href="https://uniswap.org" rel="noopener noreferrer"&gt;https://uniswap.org&lt;/a&gt;&lt;br&gt;
[CAUTION] [SUSPICIOUS] &lt;a href="http://metamask-security-alert.com/connect" rel="noopener noreferrer"&gt;http://metamask-security-alert.com/connect&lt;/a&gt;&lt;br&gt;
[PROCEED] [SAFE      ] &lt;a href="https://aave.com" rel="noopener noreferrer"&gt;https://aave.com&lt;/a&gt;&lt;br&gt;
[BLOCK  ] [CRITICAL  ] &lt;a href="http://instagram.com.universal-api.org/" rel="noopener noreferrer"&gt;http://instagram.com.universal-api.org/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;GitHub: github.com/OCTIO-Labs/octio&lt;br&gt;
The repository includes:&lt;/p&gt;

&lt;p&gt;monitor.py: Live phishing feed monitoring with Gemma 4 threat classification.&lt;/p&gt;

&lt;p&gt;dns_monitor.py: VirusTotal DNS enrichment layer, dual-source confidence scoring.&lt;/p&gt;

&lt;p&gt;reputation.py: Cumulative domain reputation engine. Tracks how many times each domain has been flagged across runs, accumulates VirusTotal malicious votes, and produces CONFIRMED_THREAT, HIGH_RISK, SUSPICIOUS, and WATCH classifications.&lt;/p&gt;

&lt;p&gt;profiles.py: Protocol-specific risk profiles. Groups active threats by impersonated platform: MetaMask, Ledger, Google, Babylon Chain — and produces CRITICAL, HIGH, MEDIUM risk ratings per protocol based on confirmed threat count and reputation scores.&lt;/p&gt;

&lt;p&gt;prediction.py: Gemma 4 predictive threat intelligence. Analyses reputation scores and protocol profiles to predict which attack campaigns are escalating, which platforms will be targeted next, and produces a forward-looking 24-72 hour threat advisory.&lt;/p&gt;

&lt;p&gt;web3_bridge.py: Submits verified indicators directly to the live ThreatRegistry.sol contract on Sepolia.&lt;/p&gt;

&lt;p&gt;registry.py: On-chain registry simulation with keccak256 hash storage.&lt;/p&gt;

&lt;p&gt;oracle.py: DeFi protocol query interface with Gemma 4 risk assessment.&lt;/p&gt;

&lt;p&gt;correlation.py: Incident correlation against documented real-world hacks.&lt;/p&gt;

&lt;p&gt;dashboard.py: Terminal dashboard for live threat visibility&lt;br&gt;
contracts/ThreatRegistry.sol. Solidity contract for Sepolia testnet deployment.&lt;/p&gt;

&lt;p&gt;The smart contract implements the full indicator submission, validation, and query interface described in the system architecture. Target domains are stored as keccak256 hashes rather than plaintex, reducing storage costs by 60 to 90% and preventing the registry from being used as a phishing directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Used Gemma 4
&lt;/h2&gt;

&lt;p&gt;I chose the Gemma 3 27B Instruct model (google/gemma-3-27b-it) via OpenRouter. The 27B model has the reasoning depth needed to make nuanced security judgements, not just pattern matching.&lt;br&gt;
Gemma 4 powers four distinct functions inside OCTIO:&lt;/p&gt;

&lt;p&gt;(1). Threat Classification (monitor.py):&lt;br&gt;
OCTIO pulls live URLs from OpenPhish, a real phishing feed updated continuously. Each URL is sent to Gemma 4 with a structured prompt asking it to classify the threat, assess severity, identify the impersonation target, and explain its reasoning.&lt;br&gt;
Given the URL &lt;a href="http://www.dpdlocoqu.cyou/com" rel="noopener noreferrer"&gt;http://www.dpdlocoqu.cyou/com&lt;/a&gt;, Gemma 4 returned:&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  "is_threat": true,&lt;br&gt;
  "threat_type": "PHISHING",&lt;br&gt;
  "severity": "HIGH",&lt;br&gt;
  "target": "DPD (Delivery Service)",&lt;br&gt;
  "reasoning": "The URL uses a misspelling of DPD and a suspicious domain extension to impersonate the legitimate delivery service, likely to steal credentials potentially leading to crypto access."&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;This is not keyword matching. Gemma 4 understood the typosquatting pattern, identified the impersonated brand, and connected it to the crypto threat context from the URL alone.&lt;/p&gt;

&lt;p&gt;(2). Risk Assessment (oracle.py):&lt;br&gt;
When a protocol queries the oracle, Gemma 4 produces a final risk assessment combining registry data with its own domain pattern analysis. For &lt;a href="http://metamask-security-alert.com/connect" rel="noopener noreferrer"&gt;http://metamask-security-alert.com/connect&lt;/a&gt;, which was not in the registry, Gemma 4 returned SUSPICIOUS/CAUTION based on the domain pattern alone. A rule-based system would have returned CLEAN. Gemma 4 understood the social engineering intent from the URL structure.&lt;/p&gt;

&lt;p&gt;(3). Incident Correlation (correlation.py):&lt;br&gt;
Gemma 4 analyses the current indicator set against a database of documented real-world Web3 hacks. Given five live phishing URLs, it correctly correlated them with the Ronin Network hack ($625M), Curve Finance DNS hijack ($570K), and MyEtherWallet BGP attack ($17M), and produced actionable recommendations for DeFi protocols.&lt;/p&gt;

&lt;p&gt;(4). Predictive Threat Intelligence (prediction.py):&lt;br&gt;
Gemma 4 analyses the accumulated reputation scores and protocol risk profiles to predict what comes next. Given current data showing Google/Gmail at CRITICAL risk with a reputation score of 306, Gemma 4 predicted Microsoft/Outlook and MetaMask as the next likely targets, a forward-looking inference no rule-based system can make.&lt;/p&gt;

&lt;p&gt;Why the 27B model:&lt;br&gt;
The 27B model was necessary for this task. Smaller models returned surface-level classifications without the reasoning depth needed to distinguish between a legitimate security alert and a phishing site designed to look like one. What Gemma 4 unlocked was a system that gets smarter as the threat landscape evolves, without retraining or updating rule sets.&lt;/p&gt;

&lt;p&gt;Update: May 19, 2026: Bridge is live&lt;br&gt;
Since publishing this post, the Web3 bridge is complete and the system is fully connected end-to-end.&lt;br&gt;
web3_bridge.py now takes validated indicators from Gemma 4 and submits them directly to the live ThreatRegistry.sol contract on Sepolia. Over 70 verified phishing indicators are now on-chain across multiple monitoring runs.&lt;br&gt;
Proof of one of the five transactions:&lt;br&gt;
0x1768792ee102b834eea9a7a5ecccece0341892200b56fe28b140227e12434eca&lt;br&gt;
View the live contract:&lt;br&gt;
&lt;a href="https://sepolia.etherscan.io/address/0xb0F4ae6f47eE001804d933dc8AD4b34969C91A69" rel="noopener noreferrer"&gt;https://sepolia.etherscan.io/address/0xb0F4ae6f47eE001804d933dc8AD4b34969C91A69&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Limitations and Next Steps
&lt;/h1&gt;

&lt;p&gt;OCTIO is a working end-to-end system. The contract is live, verified, and populated on Sepolia. The following limitations are worth being clear about for anyone evaluating it for production use:&lt;br&gt;
ThreatRegistry.sol is deployed and verified on Sepolia. Submitter authorisation is currently manual, the governance layer (ValidationPool.sol) is the next milestone. A live deployment requires testnet ETH and a Foundry deployment script.&lt;br&gt;
Primary monitoring source is OpenPhish - VirusTotal DNS enrichment added for dual-source confidence scoring. Certstream and npm audit feeds planned.&lt;br&gt;
Indicators are validated by both Gemma 4 and VirusTotal for dual-source confidence scoring. A multi-party governance layer where registered researchers vote on submitted indicators is planned but not yet implemented.&lt;br&gt;
Gemma 4 can produce false positives. The reputation engine mitigates this, domains must accumulate score across multiple runs before reaching CONFIRMED_THREAT status. Human review remains recommended for production deployments.&lt;br&gt;
The oracle interface simulates Chainlink integration. A real deployment requires a running Chainlink node and a registered External Adapter.&lt;br&gt;
Despite these limitations, the core thesis is demonstrated: Gemma 4 can perform nuanced threat classification, catch suspicious domains not yet in any registry, and correlate current indicators against historical incidents, all in real time. The prototype shows the system works. The remaining work is engineering, not concept validation.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
      <category>security</category>
    </item>
    <item>
      <title>PicoCTF General Skills - 5 Challenge Walkthrough (Beginner Friendly)</title>
      <dc:creator>James Kabingu</dc:creator>
      <pubDate>Sun, 17 May 2026 08:16:27 +0000</pubDate>
      <link>https://dev.to/james-kabingu/picoctf-general-skills-5-challenge-walkthrough-beginner-friendly-23cb</link>
      <guid>https://dev.to/james-kabingu/picoctf-general-skills-5-challenge-walkthrough-beginner-friendly-23cb</guid>
      <description>&lt;p&gt;I've been working through PicoCTF challenges as part of building my cyber-security foundation. These are my notes from the General Skills category, five challenges that cover the core terminal skills every CTF player needs. I'll show exactly what I ran, what came back, and what it means.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Nice netcat:
The server sends back a wall of numbers, one per line:
112
105
99
111&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;My first instinct was to look them up one by one in an ASCII table. That works, but there's a faster way. Each number is a decimal ASCII value. 112 is p, 105 is i, 99 is c, 111 is o. Once I saw the pattern I piped the output straight through Python:&lt;/p&gt;

&lt;p&gt;nc -w 2 wily-courier.picoctf.net 53619 | python3 -c "import sys; print(''.join(chr(int(n)) for n in sys.stdin.read().split()))"&lt;/p&gt;

&lt;p&gt;The -w 2 flag tells netcat (nc) to close after 2 seconds of silence, which lets the pipe complete. chr(int(n)) converts each decimal to its character. Flag prints immediately.&lt;/p&gt;

&lt;p&gt;What I learned: when a server returns a list of numbers, assume ASCII first. Three anchor points worth memorising: 48 is 0, 65 is A, 97 is a.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Magikarp Ground Mission:
SSH into a server, navigate between directories, and collect three parts of a flag. The instructions are literally in the files themselves.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;ssh &lt;a href="mailto:ctf-player@wily-courier.picoctf.net"&gt;ctf-player@wily-courier.picoctf.net&lt;/a&gt; -p 55070&lt;br&gt;
ls&lt;br&gt;
cat 1of3.flag.txt&lt;br&gt;
cat instructions-to-2of3.txt&lt;br&gt;
cd /&lt;br&gt;
cat 2of3.flag.txt&lt;br&gt;
cat instructions-to-3of3.txt&lt;br&gt;
cd ~&lt;br&gt;
cat 3of3.flag.txt&lt;/p&gt;

&lt;p&gt;The three files contain picoCTF{xxsh_, then 0ut_0f_//4t3r_, then 0b24fc4f}. Put together: picoCTF{xxsh_0ut_0f_//4t3r_0b24fc4f}&lt;br&gt;
What I learned: cd / is root, cd ~ is home. Flags are sometimes split across locations deliberately to teach navigation.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;First Find:
An archive with a file called uber-secret.txt buried somewhere inside. The directory tree is deep and one of the folders is hidden.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;wget &lt;a href="https://artifacts.picoctf.net/c/502/files.zip" rel="noopener noreferrer"&gt;https://artifacts.picoctf.net/c/502/files.zip&lt;/a&gt;&lt;br&gt;
unzip files.zip&lt;br&gt;
find . -name "uber-secret.txt"&lt;/p&gt;

&lt;p&gt;output: ./files/adequate_books/more_books/.secret/deeper_secrets/deepest_secrets/uber-secret.txt&lt;/p&gt;

&lt;p&gt;cat ./files/adequate_books/more_books/.secret/deeper_secrets/deepest_secrets/uber-secret.txt&lt;/p&gt;

&lt;p&gt;Flag: picoCTF{f1nd_15_f457_ab443fd1}&lt;/p&gt;

&lt;p&gt;What I learned: find . -name searches recursively and goes into hidden directories that ls won't show you. Get comfortable with this command.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Static ain't always noise:
A binary file and a bash script called ltdis.sh. I read the script before running it. It does two things: disassembles the binary with objdump and extracts readable text with strings.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;chmod +x ltdis.sh&lt;br&gt;
./ltdis.sh static&lt;br&gt;
grep "picoCTF" static.ltdis.strings.txt&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
3020 picoCTF{d15a5m_t34s3r_20335e41}&lt;/p&gt;

&lt;p&gt;What I learned: binaries often contain embedded readable strings. strings extracts them all. grep finds the one you want. This combination comes up constantly in reverse engineering.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Plumbing:
The server floods you with output. The flag is somewhere in there.
bash nc fickle-tempest.picoctf.net 49418 | grep "picoCTF"
Flag prints immediately: picoCTF{digital_plumb3r_A01Bc3eC}
What I learned: the pipe operator passes one command's output directly into another without saving anything to disk. command | grep "pattern" is probably the most used one-liner in CTF general skills challenges.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Tools used across these five challenges&lt;br&gt;
nc, python3, ssh, find, strings, grep, and the pipe operator&lt;/p&gt;

&lt;p&gt;I'm continuing through PicoCTF. Next up is the Cryptography category. Follow if you want the writeups as they come.&lt;/p&gt;

</description>
      <category>security</category>
      <category>ctf</category>
      <category>beginners</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
