Open zhang12574 opened 1 year ago
can u try to save the output in another file/location rather than custom logs? The behavior seems correct overall. Check also the system logs as I suppose you need to configure the cron daemon to send logs to a different destination editing syslog configuration located at /etc/rsyslog.conf or /etc/syslog.conf,
I've just tried both saving the output through zmap -o parameter and redirection, like this
* * * * * zmap -M ipv6_tcp_synopt -p "80" --ipv6-source-ip=2402:f000:4:1001:809:ba4f:f163:1925 -B 100M --max-runtime=36 --output-module=csv -o "/home/zhangy/zmap_scanning/output2.csv" --ipv6-target-file=/home/zhangy/zmap_scanning/responsive-addresses.txt
* * * * * zmap -M ipv6_tcp_synopt -p "80" --ipv6-source-ip=2402:f000:4:1001:809:ba4f:f163:1925 -B 100M --max-runtime=36 --ipv6-target-file=/home/zhangy/zmap_scanning/responsive-addresses.txt >> /home/zhangy/zmap_scanning/log2.log
and neither of them give a valid output, for redirection, the log file is empty, and for -o parameter, there is no file output.csv.
I checked the syslog related with zmap and get:
May 7 14:25:50 zhangy-System-Product-Name zmap: recv: unsuccessful responses will be excluded from output
May 7 14:25:50 zhangy-System-Product-Name zmap: zmap: 1 sender threads spawned
May 7 14:25:50 zhangy-System-Product-Name zmap: zmap: Pinning a send thread to core 1
May 7 14:25:50 zhangy-System-Product-Name zmap: zmap: Pinning monitor thread to core 2
May 7 14:25:50 zhangy-System-Product-Name zmap: send: send thread started
May 7 14:25:50 zhangy-System-Product-Name zmap: send: source MAC address fc:34:97:e2:07:52
May 7 14:25:51 zhangy-System-Product-Name zmap: send: send thread 0 finished (max targets of 10000 reached)
May 7 14:25:51 zhangy-System-Product-Name zmap: send: thread 0 cleanly finished
May 7 14:25:51 zhangy-System-Product-Name zmap: zmap: senders finished
May 7 14:26:01 zhangy-System-Product-Name CRON[11004]: (root) CMD (zmap -B 10M -p 80 -n 10000 >> /home/zhangy/zmap_scanning/log3.log)
May 7 14:26:01 zhangy-System-Product-Name CRON[11003]: (root) CMD (echo "hello" >> /home/zhangy/zmap_scanning/l2.log)
May 7 14:26:01 zhangy-System-Product-Name CRON[11005]: (zhangy) CMD (echo "hello" >> /home/zhangy/zmap_scanning/l.log)
May 7 14:27:01 zhangy-System-Product-Name CRON[11153]: (root) CMD (zmap -B 10M -p 80 -n 10000 >> /home/zhangy/zmap_scanning/log3.log)
May 7 14:27:01 zhangy-System-Product-Name CRON[11154]: (root) CMD (echo "hello" >> /home/zhangy/zmap_scanning/l2.log)
May 7 14:27:01 zhangy-System-Product-Name CRON[11155]: (zhangy) CMD (echo "hello" >> /home/zhangy/zmap_scanning/l.log)
May 7 14:28:01 zhangy-System-Product-Name CRON[11319]: (root) CMD (echo "hello" >> /home/zhangy/zmap_scanning/l2.log)
May 7 14:28:01 zhangy-System-Product-Name CRON[11320]: (root) CMD (zmap -B 10M -p 80 -n 10000 >> /home/zhangy/zmap_scanning/log3.log)
May 7 14:28:01 zhangy-System-Product-Name CRON[11321]: (zhangy) CMD (echo "hello" >> /home/zhangy/zmap_scanning/l.log)
May 7 14:29:01 zhangy-System-Product-Name CRON[11465]: (root) CMD (zmap -B 10M -p 80 -n 10000 >> /home/zhangy/zmap_scanning/log3.log)
May 7 14:29:01 zhangy-System-Product-Name CRON[11466]: (root) CMD (echo "hello" >> /home/zhangy/zmap_scanning/l2.log)
and noticed that running zmap command by hand, I get a series of syslogs about it (the upper part of log), while running zmap with cronjob, there're no such logs, only some cron service logs (like the lower part of log).
I don't know whether it's related with the failure
I have tried to set cronjob configurations by both using command
crontab -e
andsudo crontab -e
And set the config line as:
* * * * * zmap -M ipv6_tcp_synopt -p "80" --ipv6-source-ip=2402:f000:4:1001:809:ba4f:f163:1925 -B 100M --max-runtime=30 --ipv6-target-file=/home/zhangy/zmap_scanning/responsive-addresses.txt >> /home/zhangy/zmap_scanning/log.log
But to find that the redirected output file log.log is empty.
Using command
service cron status
to check the running status get the result:It shows that the cron commands are really executed, and the command
echo "hello" >> l.log
can normally run and outputAnd the zmap command is runned both in user mode and root mode I think, so I guess authority is not the problem.