# problem with seq



## yeikel (Dec 1, 2011)

Hi , I know there is a comand that can be used for seq at FreeBsd FreeBSD, called "jot" but I just want to know how to install seq on FreeBsd FreeBSD.

When I try to run a seq I get this: 

```
seq: Command not found.
```


```
CLASA=$1
sh run "`for i in $(seq 0 100); do echo -n $CLASA.$i\ ;done`"
```

run file 


```
#!/bin/bash
LIST=$1
for i in $LIST; do
	sh runner -h $i.
done
```

And If I try "jot" I get 
	
	



```
Out of space
```
 when I can run it normally in another system like Ubuntu.

Thanks


----------



## yeikel (Dec 1, 2011)

Sorry I forget to say that my version is "FreeBSD 7.2-RELEASE-p8 "


----------



## phoenix (Dec 1, 2011)

Perhaps you are looking for this: misc/seq2


----------



## yeikel (Dec 1, 2011)

I used to use *./run*  but I get error at freebsd FreeBSD. It is correct to change it for "sh", right?


----------



## wblock@ (Dec 1, 2011)

On FreeBSD, sh is sh.  On Linux, sh is bash.  See sh(1) about the -c option.


----------



## mix_room (Dec 2, 2011)

I have used the seq command before. 
There is probably a slight syntax difference between bash and sh.


----------



## SirDice (Dec 2, 2011)

mix_room said:
			
		

> I have used the seq command before.
> There is probably a slight syntax difference between bash and sh.



While there are indeed quite some differences between bash and sh, seq is not a builtin command.


----------



## jem (Dec 2, 2011)

How are you invoking 'jot'?

`$ jot 0 100`
would seem to do what you want.

Although in bash you can also use brace expansion to generate sequences of numbers:

[CMD="bash$"]for i in {0..99}; do echo $i; done[/CMD]


Also, is there a reason you're using two scripts to do what can easily be achieved with one?


```
#!/usr/local/bin/bash

CLASA=$1

for i in ${CLASA}.{0..99}; do
	sh runner -h $i
done
```

You might need to install shells/bash before you can use these bashisms.


----------



## yeikel (Dec 2, 2011)

phoenix said:
			
		

> Perhaps you are looking for this: misc/seq2



I have installed it but I keept getting "seq not found" 










			
				jem said:
			
		

> How are you invoking 'jot'?
> 
> `$ jot 0 100`
> would seem to do what you want.
> ...



I tried that but I get 
	
	



```
Syntax error: word unexpected
```


----------



## yeikel (Dec 2, 2011)

phoenix said:
			
		

> Perhaps you are looking for this: misc/seq2



I did it but I keept getting the error


----------



## yeikel (Dec 2, 2011)

*Syntax error: "(" unexpected*

Hi I am trying to run this scanner : 


```
scanner -h 80.0.0/16 -u users -p pass -t 6 -c 20 -o log -d -k -C
```

At ubuntu it starts normally but at FreeBsd I get this 
	
	



```
Syntax error: "(" unexpected
```

What does it mean?

thanks


----------



## phoenix (Dec 2, 2011)

Is "scanner" a shell script?


----------



## jb_fvwm2 (Dec 2, 2011)

```
rehash && which seq2
```
... seq2 is installed by that port.


----------



## wblock@ (Dec 2, 2011)

Yes, please describe the script and what it scans.


----------



## Alt (Dec 3, 2011)

deleted


----------



## fluca1978 (Dec 3, 2011)

Please give us some information anout the script. And try it running using bash (which is the default shell on ubuntu installation):

`$ bash scanner <your option here>`


----------



## yeikel (Dec 3, 2011)

jb_fvwm2 said:
			
		

> ```
> rehash && which seq2
> ```
> ... seq2 is installed by that port.



I did : 


```
ks309492# rehash && which seq2
/usr/local/bin/seq2
```

But when I try to run it : 

```
ks309492# seq
seq: Command not found.
```


----------



## yeikel (Dec 3, 2011)

fluca1978 said:
			
		

> Please give us some information anout the script. And try it running using bash (which is the default shell on ubuntu installation):
> 
> `$ bash scanner <your option here>`



I tried but I get this : 


```
cannot execute binary file
```

The script that I am trying to run is this : 


```
/*
        Multi-thread FTP scanner v0.2.5 by Inode <inode@wayreth.eu.org>
	
	This software is a simple multithread scanner for ftp with an
	integrated dictionary bruteforce.

	In the password file use the keyword "null" (with quotes) for check
	null passwords.

	You can download the latest version at: http://www.wayreth.eu.org

	Thanks Megat0n for programming support

	Tested on:
		Linux Slackware 8.0 (i386)
		OpenBSD 3.3 (i386)
		SunOS 5.8 (sparc)

	Compile:
		- Linux / OpenBSD
			gcc -O2 -o ftp_scanner ftp_scanner.c -lpthread
		- FreeBSD
			gcc -O2 -o ftp_scanner ftp_scanner.c -pthread
		- SunOS
			gcc -O2 -o ftp_scanner ftp_scanner.c -DSOLARIS -lpthread -lxnet

	Changes 0.2.5
		- Added option -C (check if command RMD exist, else can be
		  like a printer and doesn't log it) 

	Changes 0.2.4
		- Programmed again connect routines
		- Rebuild the log file 

	Changes 0.2.3
		- Added SSH and Telnet check
		- Fix SIGPIPE (maybe?)

	 $ver=v0.2.5 $name=ftp_scanner 


*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <fcntl.h>
#include <pthread.h>
#include <sys/time.h>

#define MAX_THREAD 50 
#define DEF_THREAD 30
#define TIMEOUT 5
#define PORT 21
#define PORT_TELNET 3389
#define PORT_SSH 25

// Structure 
struct users_list {
	char username[100];
	struct users_list * next;
};

struct password_list {
	char password[100];
        struct password_list * next;
};      

// Global variables
FILE * OUTFILE;
int verbose = 0;
int drop = 0;
int timeout = 0;
int banner = 0;
int strange = 0;
int ssh_telnet = 0;
int rm_dir = 0;

// Address 
unsigned long current_ip;
unsigned long end_ip;

// Mutex variables
pthread_mutex_t input_queue;
pthread_mutex_t user_list;
pthread_mutex_t output_file;

// Main lists pointers
struct users_list * first_user = NULL;
struct password_list * first_pass = NULL;

// Functions prototipes
void * scan(void * data);
void usage(char * argv);
void load_users( char * in_file );
void load_password( char * in_file );
int check_ftp_reply( char * string );
void connect_ip(unsigned long ip);
int check_user( int sock, char * user, char * pass,char * buffer, int lbuffer );
int check_telssh( unsigned long ip );
int check_port( unsigned long ip , int port );
```

Note: Cant add the whole code because it exceeds the 1000 char limit

Which is based in 2 files: 

0-100 (for scan to 0-100)


```
#!/bin/bash
CLASA=$1
./run "`for i in $(seq 0 100); do echo -n $CLASA.$i\ ;done`"
```

and Run


```
#!/bin/bash
LIST=$1
for i in $LIST; do
	./ftp_scanner -h $i.0.0/16 -u users -p pass -t 6 -c 20 -o log -d -k -C &
done
```

I am trying to adapt it to FreeBSD because it have been made for Linux but can be compiled at freebsd so should work.


----------



## yeikel (Dec 3, 2011)

And if I try 

[CMD=]bash scanner <your option here>[/CMD]

I am getting


```
cannot execute binary file
```


----------



## yeikel (Dec 3, 2011)

I am sorry for 2 reply , here is the full script , tested and working for Ubuntu and some time ago It worked for me at freebsd just using sh 0-100 instead of make any change at code x(



Link : http://www.multiupload.com/4QC0GQKBVZ


----------



## yeikel (Dec 3, 2011)

*Script dont work*

I am making a new topic because there are two topics about this problem I can't get any fix yet.

http://forums.freebsd.org/showthread.php?t=28102
http://forums.freebsd.org/showthread.php?t=28078

I am new at FreeBsd FreeBSD so I have some problems trying to use my scripts at this OS. The script that I am trying to run is this (ftp scanner) : http://www.multiupload.com/4QC0GQKBVZ

It normally works at FreeBsd FreeBSD just changing ./ for sh but I don't know what is the problem now with this version of FreeBsd FreeBSD (maybe I need a port or related).

The usage used to be : 0-100 90 , and it will scan all the ftp servers with vulns at 90.0.0.0/16.

I tested it in Linux 2.6 and Ubuntu and it works perfect so I dont know why I am getting all that problems :S

Thanks for the reply and sorry so much for making all the topics..


----------



## Alt (Dec 3, 2011)

yeikel said:
			
		

> I am making a new topic because there are 2 topics about this problem I cant get any fix yet


I hope you will get a 1 month ban for each extra topic


----------



## wblock@ (Dec 3, 2011)

Just to be sure: you are asking for help to get a bruteforce password attack script running?


----------



## Alt (Dec 3, 2011)

Script kiddiez attack


----------



## fonz (Dec 3, 2011)

yeikel said:
			
		

> I Did :
> 
> 
> ```
> ...


`$  seq2`
If having to type the 2 bothers you, you can of course use an alias or a symlink

Fonz

P.S. Why are you using PHP tags?

P.P.S. Why are you working as root?


----------



## DutchDaemon (Dec 4, 2011)

Merged all of these needless topics back together. I'm losing my patience with the crappy formatting and the refusal to write FreeBSD correctly. Clean up your act, and wrap this topic up. Before we go any further, explain why you need this 'scanner'. Do you own the network you are scanning?


----------



## yeikel (Dec 4, 2011)

DutchDaemon said:
			
		

> Merged all of these needless topics back together. I'm losing my patience with the crappy formatting and the refusal to write FreeBSD correctly. Clean up your act, and wrap this topic up. Before we go any further, explain why you need this 'scanner'. Do you own the network you are scanning?



I am an student of PenTesting and I am just testing the tool , but I cant make it work at FreeBSD , that its the problem .


----------



## fluca1978 (Dec 6, 2011)

yeikel said:
			
		

> I am an student of PenTesting and I am just testing the tool , but I cant make it work at FreeBSD , that its the problem .



I think the problem is you don't [know|understand] the difference between a script and an executable, and that is a problem.

I think you do not want to learn the basis about FreeBSD, and that is the problem.

I think you cannot do a penetration attack if you don't know what you are doing, and that is the problem.

Apart this, the community will be glad to help you when you will be able to express the real problem you are getting.


----------

