DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Last post Author Topic: ZIP to PHP converter  (Read 73,692 times)

scancode

  • I will eat Cody someday.
  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
    • Cody Award
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • DJ Badge - DJ
ZIP to PHP converter
« on: January 05, 2010, 10:17 AM »
This is a small application that converts a ZIP file into a self-extracting PHP file. Simply upload it to your webserver, call it once, then delete it.

zip2php.PNG

Requested by icekin on teh IRC channel.
« Last Edit: April 04, 2017, 10:01 PM by scancode »

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,321
    • Gathering Badge
Re: ZIP to PHP converter
« Reply #1 on: January 05, 2010, 12:45 PM »
This is a very cool idea! Can it cope with tarballs (.tar or .tar.gz) as well?

gjehle

  • lonesome linux warrior
  • Member
  • Joined in 2006
  • **
  • Posts: 286
    • Gathering Badge
Re: ZIP to PHP converter
« Reply #2 on: January 05, 2010, 12:45 PM »
you, sir, are awesome.
this is simply ingenious.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: ZIP to PHP converter
« Reply #3 on: January 05, 2010, 03:15 PM »
But what's the point?

Are there hosts which allow you to run PHP scripts but don't give FTP access? And don't allow .zip files from web-based upload forms? O_o
- carpe noctem

scancode

  • I will eat Cody someday.
  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
    • Cody Award
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • DJ Badge - DJ
Re: ZIP to PHP converter
« Reply #4 on: January 05, 2010, 04:01 PM »
This is a very cool idea! Can it cope with tarballs (.tar or .tar.gz) as well?

Not yet, mebbe I should add it.

you, sir, are awesome.
this is simply ingenious.

Thanks.

But what's the point?

Are there hosts which allow you to run PHP scripts but don't give FTP access? And don't allow .zip files from web-based upload forms? O_o

The problem is not uploading the zips, but unzipping them server-side.
Uploading a crapload of small files takes ages over FTP.
« Last Edit: January 05, 2010, 04:11 PM by scancode »

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: ZIP to PHP converter
« Reply #5 on: January 05, 2010, 07:01 PM »
But what's the point?

Are there hosts which allow you to run PHP scripts but don't give FTP access? And don't allow .zip files from web-based upload forms? O_o

The problem is not uploading the zips, but unzipping them server-side.
Uploading a crapload of small files takes ages over FTP.
Ooooh, duh! - I thought self-extracting meant "generate .zip output". Facepalm, more coffee to me - this could be pretty darn useful when you don't have shell support :)
- carpe noctem

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 9,827
    • Participated in NANY Challenge Eight Times
    • Cody Award
Re: ZIP to PHP converter
« Reply #6 on: January 06, 2010, 12:11 AM »
That looks pretty awesome!

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: ZIP to PHP converter
« Reply #7 on: January 06, 2010, 12:24 AM »
Any chance that could be done with .asp also (e.g. zip2asp)?

Tuxman

  • OMG not him again!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,522
    • Participated in NANY Challenge Seven Times
Re: ZIP to PHP converter
« Reply #8 on: January 06, 2010, 01:35 AM »
Now I needed this a few weeks ago.  ;D
Maybe it could be useful on next Wordpress update... thank you!

:Thmbsup:
I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 9,827
    • Participated in NANY Challenge Eight Times
    • Cody Award
Re: ZIP to PHP converter
« Reply #9 on: January 06, 2010, 02:41 AM »
Any chance you can do this with exe too? :P Just kidding.

Again, awesome utility here. :Thmbsup:

scancode

  • I will eat Cody someday.
  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
    • Cody Award
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • DJ Badge - DJ
Re: ZIP to PHP converter
« Reply #10 on: January 06, 2010, 02:59 AM »
Any chance you can do this with exe too? :P Just kidding.

Again, awesome utility here. :Thmbsup:

EXE: use your favourite archiver. WinRAR, WinZIP, WinACE, 7Zip all do SFXs
As soon as I get ASP to work there will be an ASP version (will prolly involve two files instead of one tho)

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 9,827
    • Participated in NANY Challenge Eight Times
    • Cody Award
Re: ZIP to PHP converter
« Reply #11 on: January 06, 2010, 03:04 AM »
Any chance you can do this with exe too? :P Just kidding.

Again, awesome utility here. :Thmbsup:

EXE: use your favourite archiver. WinRAR, WinZIP, WinACE, 7Zip all do SFXs
As soon as I get ASP to work there will be an ASP version (will prolly involve two files instead of one tho)

Er.. What I meant was EXE2PHP. So I could execute an executable on a server via PHP. But like I said it was a joke. ;)

scancode

  • I will eat Cody someday.
  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
    • Cody Award
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • DJ Badge - DJ
Re: ZIP to PHP converter
« Reply #12 on: January 06, 2010, 03:10 AM »
Any chance you can do this with exe too? :P Just kidding.

Again, awesome utility here. :Thmbsup:

EXE: use your favourite archiver. WinRAR, WinZIP, WinACE, 7Zip all do SFXs
As soon as I get ASP to work there will be an ASP version (will prolly involve two files instead of one tho)

Er.. What I meant was EXE2PHP. So I could execute an executable on a server via PHP. But like I said it was a joke. ;)
Ever heard of system()?

VictorM

  • Participant
  • Joined in 2009
  • *
  • Posts: 16
Re: ZIP to PHP converter
« Reply #13 on: January 07, 2010, 11:22 AM »
afraid I can see how this can be used together with a successful injection attack to deploy on a single session. yet, very interesting.
When in doubt, use Google

Tuxman

  • OMG not him again!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,522
    • Participated in NANY Challenge Seven Times
Re: ZIP to PHP converter
« Reply #14 on: January 07, 2010, 11:33 AM »
Injecting files is not actually dangerous yet.
I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: ZIP to PHP converter
« Reply #15 on: January 07, 2010, 03:51 PM »
Injecting files is not actually dangerous yet.
:huh: :huh: :huh:
- carpe noctem

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: ZIP to PHP converter
« Reply #16 on: January 07, 2010, 04:56 PM »
Injecting files is not actually dangerous yet.
:huh: :huh: :huh:
ROFL (I had same reaction)

Tuxman

  • OMG not him again!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,522
    • Participated in NANY Challenge Seven Times
Re: ZIP to PHP converter
« Reply #17 on: January 07, 2010, 06:57 PM »
Unpacking a ZIP file on the server does not automatically cause any danger. How?
I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: ZIP to PHP converter
« Reply #18 on: January 07, 2010, 09:34 PM »
Unpacking a ZIP file on the server does not automatically cause any danger. How?
Kinda depends on what's in the file...

...Sure the server isn't in any danger (unless you count reputation) but the visitors..?

Tuxman

  • OMG not him again!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,522
    • Participated in NANY Challenge Seven Times
Re: ZIP to PHP converter
« Reply #19 on: January 07, 2010, 09:40 PM »
The visitors need a link to the file anyway. Where should that be?
I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: ZIP to PHP converter
« Reply #20 on: January 07, 2010, 11:54 PM »
The visitors need a link to the file anyway. Where should that be?
You're kidding, right?

Tuxman

  • OMG not him again!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,522
    • Participated in NANY Challenge Seven Times
Re: ZIP to PHP converter
« Reply #21 on: January 07, 2010, 11:56 PM »
No, why?
I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: ZIP to PHP converter
« Reply #22 on: January 08, 2010, 12:04 AM »
The visitors need a link to the file anyway. Where should that be?
*facepalm*

If you have the possibility to inject a zippedfile.php on a server and then run it... what harm could you possibly do? Nobody would think of putting index.php in that sfx-zip, of course no... and certainly nobody would put a connect-back shell, would they? Definitely harmless :)
- carpe noctem

Tuxman

  • OMG not him again!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,522
    • Participated in NANY Challenge Seven Times
Re: ZIP to PHP converter
« Reply #23 on: January 08, 2010, 12:11 AM »
Depends. Does unzipping always overwrite files? It actually shouldn't. (So who cares about index.php?)
I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: ZIP to PHP converter
« Reply #24 on: January 08, 2010, 12:14 AM »
Depends. Does unzipping always overwrite files? It actually shouldn't.
For the intended use of this program (as I understand it: upgrading websites, especially pre-fab systems), it should.

(So who cares about index.php?)
Ask any website owner who has his site defaced :)
- carpe noctem

Original address: https://www.donationcoder.com/forum/index.php?topic=21287.0