XeusNguyen
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Dode ascisCTF (Misc/Forensics) ###### tags: `ctf` `exploits` `find information on image` Description: It is Doge, or not??? Attact: https://drive.google.com/file/d/118LNaIH6gzj1F7r0TPHv9VLB1v9rTet9/view?usp=sharing ## First sight - Thinking :thinking_face: ![](https://i.imgur.com/dp8jiPD.jpg) - Yeah, on the first side i think it little bit about easily challenge but not :smiley: - So typically, i do basic stego with that image like *aprisolve, zsteg, binwalk, exiftool and moretool to stegography*. But i receive zero information about that image. What the heck !!! i think. :weary: - So next step, i usually use *steghide* for extract something from image and i receive something already strange different from the others challenge stego and i know i need to explain this. The core item will bring my struggle away :sweat_smile: ## Exploit - First of all, i need so you something about strange i meet on using steghide ![](https://i.imgur.com/NR2KtLH.png) and watch out in the 0xc4 it will really dangerous position i will save it in bottom heart. - So i don't know `Corrupt JPEG data: 3463 extraneous bytes before marker 0xc4` have what they mean it look like some thing bytes is added in front of byte `0xc4`, so i try thinking it will be or should be relative with the hex header on the **f dode picture** :angry: and i try reopen it with python because it will give me some strange thing i thinks it so try with basicly openCV is open and show that in the monitor. ``` import cv2 image = cv2.imread('6uecny.jpg') cv2.imshow('image', image) cv2.waitKey(0) ``` - you think what i think, the processing open okay but warning return again and one time i meet it `Corrupt JPEG data: 3463 extraneous bytes before marker 0xc4` so i need it to check header right now because it make cost much of time i have on contest to check what the instruction of image `JPEG OR JPG.` oh no my scared :cold_sweat: - So i use the basic hexeditor on window to open that with [HxD](https://mh-nexus.de/en/hxd/) for Windows and just hexeditor like xxd on the Linux. ### That all of exploit for this image because importance we need to know what image say something ## Google and Searching - The first thing u need to know something is finding the description or theory of it and it work with anysituation so i google and find jpeg construct so don't like me read to fast and skip importance thing cause effect on flag finding processing - [Wiki](https://en.wikipedia.org/wiki/JPEG) is not make me disapointed it have enough to dig in with that. - So i continous to reach wrong way first and i will talk about my return on this challenge. It will relate some skill delete and recover the image. - So in the first time, i think it will be some kind we will replace or delete something in byte 0xc4 or cover that, so i don't know what the byte meaning so go wikitag and see and they said it `DHT 0xFF, 0xC4 variable size Define Huffman Table(s) Specifies one or more Huffman tables.` and it have meaning image have that to see what the image say so onething can be use we will not need to touch of that because the image will die ![](https://i.imgur.com/ZB35jf3.png) - So basiclly look hex it contain 10 position 0xC4 and what the heck right position is similar with the corrupt talk - And i will talk about the magicbyte the byte you see on that 0xC4 is magic byte it is factor to construct the image. Image is series of magic byte and it alive on byte and it have start and end on the image, basically like that but some situation Author will custom that to change some thing effect on the magic byte and it will cause the changing in the image - And i will relate jpeg or jpg which structure of one will be like this![](https://i.imgur.com/FfD0x1I.png) so it start with `FF D8` for header and it first magic we need to know that be start postion of image and not be data and what the heck on that postion don't touch that i will be earase something u want ![](https://i.imgur.com/nUijWpr.png) and more magic byte like that for each image or audio or anything building on the pc and internet - So long theory back again the challenge, will check it contain 10 magic byte `0xFF 0xC4` and not touch on that and we will find byte `0xFF 0xDA` to see what we got and yet we got bunch of that ![](https://i.imgur.com/c7nyxR2.png) so like i say hecking wrong on the image why it contain to much readable thing - So i try erase series before byte `0xFF 0xDA` and it not right what i think i image will contain in each of data with readable but i wrong the image i bunch of subsample of image - so it like they but the more and more image to bring some *kind high resolution image like SRGAN* in **DEEP LEARNING**. :hand_with_index_and_middle_fingers_crossed: No no i think a long way but the Symbiotic of my action is try put the corrupt thing because it thing we need or anyone will do because the warning is annoy me skip the first wrong way, reach to second wrong way :smiley: - I find the method to pass this corrupt situation and i found it ImageMagick tool will be perfect with stego CTF or stego on real life because it such powerful tool and can do anything with that. So i am try using [mogrify](https://imagemagick.org/script/mogrify.php) and done i do erase something importance like flag in image because of the image over come normally image so i contain magicbyte `0xC4, 0xC0` to change the size of image and data with such a one of that ### Timeup and get the experience for next time :smiley: ## Reach the true thing :smirk: - Because thinking wrong way bring me to struggle and not find any kind thing so i hear that it relate some kind stretching image like change width and height of image but but it change in the hex not perform that in the image because you will not receive anything - So try again i read the doc of jpeg and finding the relate with new some doc useful for this situation - a new way exploit image but i not knowing is change the heigh and width of image to hide infomation - [The blog](https://blog.cyberhacktics.com/hiding-information-by-changing-an-images-height/) is the thing talk which contain some kind of way to reach that hiding information and someking of that have on CTF in XmasCTF2018 ![](https://i.imgur.com/xMfdwoI.png) and try on that on the image i have but it not have `0xC0` because if we i change `0xC0` will appear but on that situation it have not so i read again and find some kind like true ending for f*king game - ![](https://i.imgur.com/1AKNAiL.png) and we have two kind of SOF is start of frame and with S0F0 it depend on the baseline DCT (idk what the heck this mean) but with S0F2 it progessive DCT (like it upgrade of S0F0) and it start with byte `0xFF 0xC2` and i found it ![](https://i.imgur.com/EKfg5u6.png) just 1 of that in the image so la la la we reach of the true. - ![](https://i.imgur.com/MVBx849.png) because of same structure with S0F0 the upgrade S0F2 will similar and it just change that on 4 end of postion with 2 of front for height and other for width. - Using [cyberChef](https://gchq.github.io/CyberChef/) - power tool - so convert image to hex and copy all on that in input and cho reverse covert to image will we do the action change the height of image - ![](https://i.imgur.com/8BZMzXZ.png) this is thing we need to change but don't touch first of five because it not be good so touch 02 6c on the hex so if you change `02` if you decrease that it will decrease the height of image but i don't have anything ![](https://i.imgur.com/pf6BWyb.png) - The image is being cut off but not anything behind of this so try to increase the high with increase byte `02` equal `06` and yeah we found it the hiding ![](https://i.imgur.com/KgvKE2B.png) > flag: ASCIS{b47_Ng0_cHU4_b4_D4!!!} ### So new way to exploit image the new experience with CTF on this challenge LOL. Now keeping cool your mind and see what we got :smiley:. It ain gonna fun challenge but you miss something and go wrong. Reach to next CTF :necktie: and write up will come :sailboat:. Happy hacking !!!

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully