Make a jpeg or gif run php or javascript

 

Results 1 to 7 of 7
Has anyone heard of a way to get a jpeg to run a line of ...
  1. #1
    frenchsquared is offline Registered Member
    Join Date
    Jun 2010
    Posts
    51
    Thanks
    2
    Thanked 4 Times in 3 Posts

    Default Make a jpeg or gif run php or javascript

    Has anyone heard of a way to get a jpeg to run a line of php or javascript.
    I don't want to hack a server. I need a way to have an image set a cookie.
    I just want a way to verify if a user loaded my image.

    Clearly the image isnt hosted on my server or this would be easy.

    I need the image to actually run some other code from a different domain
    to set the cookie.

    Think re-targeting advertising... not hacking...

    I have googled this, for weeks. I don't want to exploit getimagesize();




  2. #2
    divok's Avatar
    divok is offline Power Member
    Join Date
    Jul 2010
    Location
    Behind You. Turn and See.
    Posts
    625
    Thanks
    209
    Thanked 326 Times in 208 Posts
    Blog Entries
    1

    Default Re: Make a jpeg or gif run php or javascript

    i think you could use JavaScript to kick in when a image finally loads and then set cookie using javascript .
    Edit :
    my bad i didnt rad the JS part .
    I think that's not possible , jpeg is just a format

  3. #3
    frenchsquared is offline Registered Member
    Join Date
    Jun 2010
    Posts
    51
    Thanks
    2
    Thanked 4 Times in 3 Posts

    Default Re: Make a jpeg or gif run php or javascript

    it is super easy if you have access to the server the image will be on, or if you could us a php image
    neither of these are an option. I have to upload the image to one of the larger advertising networks.
    they distribute the image to there networks. So I have no idea where the images would end up.

    But... If I could set a cookie... I could do lots of re-targeting advertising.

    Basically, I need a hack that can add a virus to an image. Only this isn't a real virus
    since it does not replicate or do any damage.

  4. #4
    Ricky Roma's Avatar
    Ricky Roma is offline Regular Member
    Join Date
    Sep 2011
    Posts
    225
    Thanks
    238
    Thanked 309 Times in 106 Posts
    Blog Entries
    4

    Default Re: Make a jpeg or gif run php or javascript

    You want to upload pic to fb and cs all visitors of your fan page. Am I right?
    It cant be done.

  5. #5
    hellnation's Avatar
    hellnation is offline Regular Member
    Join Date
    Feb 2013
    Location
    Quebec, Canada
    Age
    37
    Posts
    280
    Thanks
    104
    Thanked 58 Times in 43 Posts

    Default Re: Make a jpeg or gif run php or javascript

    you would need to find a massive exploit in a browser / or a major flaw in an image standard.

    this stuff is so widely used and scrutinized, its a very hard thing to do.

    you won't find a wordpress plugin for that =)

  6. #6
    kvhnuke's Avatar
    kvhnuke is offline Junior Member
    Join Date
    Jan 2010
    Posts
    117
    Thanks
    9
    Thanked 34 Times in 13 Posts

    Default Re: Make a jpeg or gif run php or javascript

    <?php
    $imgPng = imageCreateFromPng($strImagePath);
    imageAlphaBlending($imgPng, true);
    imageSaveAlpha($imgPng, true);


    /* Output image to browser */
    header("Content-type: image/png");
    setcookie("TestCookie", $value, time()+3600, "/~rasmus/", "example.com", 1);
    imagePng($imgPng);
    ?>


    This will output a png while setting the cookie just call the php script on your html like following
    <img src="link/to/your/phpfile.php"/>

  7. #7
    hellnation's Avatar
    hellnation is offline Regular Member
    Join Date
    Feb 2013
    Location
    Quebec, Canada
    Age
    37
    Posts
    280
    Thanks
    104
    Thanked 58 Times in 43 Posts

    Default Re: Make a jpeg or gif run php or javascript

    if you are serious about this type of stuff, follow security mailing lists, everyday there are 0 days exploits/bugs reported that can be used toward your purpose.

    but you need to know your stuff, and this stuff tend to get patched pretty quickly, the window of opportunity is small.


Similar Threads

  1. shitjustgotreal.jpeg
    By erickishere in forum Blogging
    Replies: 8
    Last Post: 04-08-2013, 01:24 AM
  2. Make $1k a week. I need a Javascript pro!
    By matthewajumper in forum Affiliate Programs
    Replies: 0
    Last Post: 08-30-2011, 01:41 AM
  3. Can you Make me a Jpeg/Gif Banner?
    By TonyDavis202 in forum Hire a Freelancer
    Replies: 9
    Last Post: 11-12-2009, 04:05 PM
  4. Make JavaScript Click a Link..??
    By x5g7j9l3x in forum Cloaking and Content Generators
    Replies: 5
    Last Post: 10-03-2009, 06:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




BlackHatWorld on Twitter BlackHatWorld on FaceBook


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98