mirror of
https://github.com/drk1wi/portspoof.git
synced 2024-06-28 09:41:36 +00:00
add. fixed.
This commit is contained in:
parent
81576d734c
commit
c5c21813d0
11
DOCS
11
DOCS
@ -4,9 +4,9 @@ Portspoof documentation notes
|
||||
|
||||
1. Compile the software:
|
||||
|
||||
$./configure
|
||||
$ ./configure (use )
|
||||
$ make
|
||||
$ sudo make install
|
||||
$ make install
|
||||
|
||||
|
||||
2. Configure your firewall rules:
|
||||
@ -16,14 +16,17 @@ Portspoof documentation notes
|
||||
Configure iptables:
|
||||
|
||||
# iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 1:65535 -j REDIRECT --to-ports 4444
|
||||
# iptables-restore < iptables-config (system_files directory) # remember to change the interface name!
|
||||
# iptables-restore < iptables-config (system_files directory) # Note: remember to change the interface name to yours!
|
||||
|
||||
Run Portspoof with service emulation:
|
||||
Run Portspoof with service emulation in daemon mode:
|
||||
$ portspoof -c /etc/portspoof.conf -s /etc/portspoof_signatures -D
|
||||
|
||||
This mode will generate and feed port scanners with bogus service signatures.
|
||||
|
||||
Run Portspoof in daemon "open port" mode:
|
||||
$ portspoof -D
|
||||
|
||||
This mode will just return OPEN state for every connection attempt.
|
||||
|
||||
3. Add portspoof invocation to your system's startup scripts.
|
||||
|
||||
|
@ -297,7 +297,7 @@ bool Configuration::processSignatureFile()
|
||||
|
||||
// set random mapping
|
||||
srand((unsigned)time(0));
|
||||
for(int i=0;i<MAX_PORTS;i++)
|
||||
for(int i=0;i<=MAX_PORTS;i++)
|
||||
{
|
||||
portsignatureemap.insert(make_pair(i,process_signature(rawsignatures[rand()%rawsignatures.size()])));
|
||||
//portsignatureemap.insert(make_pair(i,process_signature(rawsignatures[i%rawsignatures.size()])));
|
||||
@ -313,8 +313,9 @@ bool Configuration::processSignatureFile()
|
||||
bool Configuration::generateBufferSize()
|
||||
{
|
||||
srand((unsigned)time(0));
|
||||
for(int i=0;i<MAX_PORTS;i++)
|
||||
portbuffermap.insert(make_pair(i,rand()%MAX_BUFFER_SIZE))
|
||||
for(int i=0;i<=MAX_PORTS;i++)
|
||||
portbuffermap.insert(make_pair(i,rand()%MAX_BUFFER_SIZE));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ void* process_connection(void *arg)
|
||||
else
|
||||
{
|
||||
buffer_size=configuration->mapPort2Buffer(original_port);
|
||||
n = recv(threads[tid].clients[i], buffer,buffer_size, 0);
|
||||
n = recv(threads[tid].clients[i],buffer,buffer_size, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -149,6 +149,7 @@ void* process_connection(void *arg)
|
||||
if(configuration->getConfigValue(OPT_DEBUG))
|
||||
fprintf(stdout,"Thread nr. %d : client %d closed connection\n",tid, threads[tid].clients[i]);
|
||||
|
||||
//shutdown(threads[tid].clients[i],SHUT_WR);
|
||||
close(threads[tid].clients[i]);
|
||||
|
||||
pthread_mutex_lock(&new_connection_mutex);
|
||||
@ -266,6 +267,7 @@ void* process_connection(void *arg)
|
||||
if(send(threads[tid].clients[i], buffertosend, buffertosendsize,0)==-1)
|
||||
perror("Send to socket failed");
|
||||
|
||||
|
||||
close(threads[tid].clients[i]);
|
||||
|
||||
free(buffertosend);
|
||||
|
@ -67,7 +67,7 @@
|
||||
|
||||
#define SO_ORIGINAL_DST 80
|
||||
#define TCPSTATES
|
||||
#define MAX_BUFFER_SIZE 1000
|
||||
#define MAX_BUFFER_SIZE 65536
|
||||
|
||||
extern pthread_cond_t new_connection_cond;
|
||||
extern pthread_mutex_t new_connection_mutex;
|
||||
|
Loading…
Reference in New Issue
Block a user