skepticfx / arpjs Goto Github PK
View Code? Open in Web Editor NEWSend ARP packets and read ARP tables using Javascript
License: MIT License
Send ARP packets and read ARP tables using Javascript
License: MIT License
This is not working for me on MacOSX (10.10.3) using Node.js v0.12.2 and trying to spoof an android device.
Hi - in Wireshark my ARP packets all have a broadcast destination. In packet.js should pkt.dst also be set to macToArr(pktObj.dst_mac) as pkt.dst_mac is?
Thanks!
groshev@groshev:/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib$
i get tish error whjen i run arpjs... please hepl
[email protected] install /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/socketwatcher
node-gyp rebuild
make: Entering directory /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/socketwatcher/build' CXX(target) Release/obj.target/socketwatcher/socket_watcher.o In file included from ../node_modules/nan/nan_new.h:190:0, from ../node_modules/nan/nan.h:80, from ../socket_watcher.hpp:8, from ../socket_watcher.cpp:5: ../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static NanIntern::FactoryBase<v8::Signature>::return_t NanIntern::Factory<v8::Signature>::New(NanIntern::Factory<v8::Signature>::FTH, int, NanIntern::Factory<v8::Signature>::FTH*)’: ../node_modules/nan/nan_implementation_12_inl.h:181:76: error: no matching function for call to ‘v8::Signature::New(v8::Isolate*, NanIntern::Factory<v8::Signature>::FTH&, int&, NanIntern::Factory<v8::Signature>::FTH*&)’ return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv); ^ ../node_modules/nan/nan_implementation_12_inl.h:181:76: note: candidate is: In file included from /home/groshev/.node-gyp/5.0.0/include/node/node.h:42:0, from ../node_modules/nan/nan.h:24, from ../socket_watcher.hpp:8, from ../socket_watcher.cpp:5: /home/groshev/.node-gyp/5.0.0/include/node/v8.h:4674:27: note: static v8::Local<v8::Signature> v8::Signature::New(v8::Isolate*, v8::Local<v8::FunctionTemplate>) static Local<Signature> New( ^ /home/groshev/.node-gyp/5.0.0/include/node/v8.h:4674:27: note: candidate expects 2 arguments, 4 provided In file included from ../socket_watcher.hpp:8:0, from ../socket_watcher.cpp:5: ../node_modules/nan/nan.h: At global scope: ../node_modules/nan/nan.h:171:25: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’ NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) { ^ ../node_modules/nan/nan.h:166:25: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) { ^ ../node_modules/nan/nan.h:564:13: error: ‘node::smalloc’ has not been declared , node::smalloc::FreeCallback callback ^ ../node_modules/nan/nan.h:564:35: error: expected ‘,’ or ‘...’ before ‘callback’ , node::smalloc::FreeCallback callback ^ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’: ../node_modules/nan/nan.h:568:50: error: ‘callback’ was not declared in this scope v8::Isolate::GetCurrent(), data, length, callback, hint); ^ ../node_modules/nan/nan.h:568:60: error: ‘hint’ was not declared in this scope v8::Isolate::GetCurrent(), data, length, callback, hint); ^ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’: ../node_modules/nan/nan.h:575:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous return node::Buffer::New(v8::Isolate::GetCurrent(), data, size); ^ ../node_modules/nan/nan.h:575:67: note: candidates are: In file included from ../node_modules/nan/nan.h:25:0, from ../socket_watcher.hpp:8, from ../socket_watcher.cpp:5: /home/groshev/.node-gyp/5.0.0/include/node/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match> NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, ^ /home/groshev/.node-gyp/5.0.0/include/node/node_buffer.h:31:40: note: no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’ /home/groshev/.node-gyp/5.0.0/include/node/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match> NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, ^ /home/groshev/.node-gyp/5.0.0/include/node/node_buffer.h:43:40: note: no known conversion for argument 2 from ‘const char*’ to ‘char*’ In file included from ../socket_watcher.hpp:8:0, from ../socket_watcher.cpp:5: ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’: ../node_modules/nan/nan.h:579:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), size)’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’ return node::Buffer::New(v8::Isolate::GetCurrent(), size); ^ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’: ../node_modules/nan/nan.h:586:12: error: ‘Use’ is not a member of ‘node::Buffer’ return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size); ^ make: *** [Release/obj.target/socketwatcher/socket_watcher.o] Error 1 make: Leaving directory
/usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/socketwatcher/build'
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.16.0-52-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/socketwatcher
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: node-gyp rebuild
npm WARN install:[email protected] Exit status 1
groshev@groshev:/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib$ sudo apt-get install build-essential
I'm using this module as a lib in a new project.
I think we should avoid printing log on the stdout:
packet.js:L35
It would be better to use a module like visionmedia/debug.
$ npm install arpjs -g
> [email protected] preinstall C:\Users\inf3rno\AppData\Roaming\npm\node_modules\arpjs\node_modules\typechecker
> node ./cyclic.js
> [email protected] install C:\Users\inf3rno\AppData\Roaming\npm\node_modules\arpjs\node_modules\pcap
> node-gyp rebuild
C:\Users\inf3rno\AppData\Roaming\npm\node_modules\arpjs\node_modules\pcap>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
pcap_binding.cc
pcap_session.cc
win_delay_load_hook.cc
..\pcap_binding.cc(2): fatal error C1083: Cannot open include file: 'pcap/pcap.h': No such file or directory [C:\Users\inf3rno\AppData\Roaming\npm\node_modules\arpjs\node_modules\pcap\build\pcap_binding.vcxproj]
..\pcap_session.cc(2): fatal error C1083: Cannot open include file: 'pcap/pcap.h': No such file or directory [C:\Users\inf3rno\AppData\Roaming\npm\node_modules\arpjs\node_modules\pcap\build\pcap_binding.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\inf3rno\AppData\Roaming\npm\node_modules\arpjs\node_modules\pcap
gyp ERR! node -v v8.1.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\inf3rno\AppData\Roaming\npm-cache\_logs\2017-06-20T16_02_40_905Z-debug.log
$ git clone https://github.com/skepticfx/arpjs
$ cd arpjs/
$ npm install
--
CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
../socket_watcher.cpp:77:8: warning: 'MakeCallback' is deprecated
[-Wdeprecated-declarations]
Nan::MakeCallback(watcher->handle(), callback, argc, argv);
^
../../nan/nan.h:929:3: note: 'MakeCallback' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../socket_watcher.cpp:104:37: error: no matching member function for call to 'NewInstance'
info.GetReturnValue().Set(cons->NewInstance());
~~~~~~^~~~~~~~~~~
--
Node version: v10.4
NPM version: v6.1.0
Compiler version:
Apple LLVM version 10.0.0 (clang-1000.10.25.5)
Target: x86_64-apple-darwin17.6.0
I found this issue when I install kickthemout, and it depend on arpjs.
I thought the root cause is socketwatcher
like this? ?
If the output from arp is long for example (256 lines), the on 'data' for stdout is called multiple times and the complete arp table is not returned.
I have a fix for it this pull request #5
I'm having this error on Node v.4.4.7:
module.js:434
return process.dlopen(module, path._makeLong(filename));
^
Error: Module version mismatch. Expected 46, got 48.
at Error (native)
at Object.Module._extensions..node (module.js:434:18)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/user/Desktop/PROVE/pcap-test/node_modules/pcap/pcap.js:3:21)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
In the arp.table
function can we also return the host name (e.g.jbis-imac.router.home
)? If the hostname is ?
it wasn't found so maybe store that as null
?
jbis-imac.router.home (192.168.1.159) at XX:XX:XX:XX:XX:XX on en1 ifscope permanent [ethernet]
Trying to install using:
npm install arpjs --save
Using Windows 10,
Node v7.4.0,
NPM v4.0.5
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.