aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/gethostbyname.c
diff options
context:
space:
mode:
authorEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-10-23 01:20:02 -0500
committerEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-10-23 01:20:02 -0500
commit8c542d83091f9ba5ccb095fad730651f8e6c1eef (patch)
treead26b5a7686d7b78888fa052226551255e3d8633 /src/bin/gethostbyname.c
parent12201178a5950eecd9537e642b1246011490b499 (diff)
downloadmisc-8c542d83091f9ba5ccb095fad730651f8e6c1eef.tar.gz
misc-8c542d83091f9ba5ccb095fad730651f8e6c1eef.zip
fixed gopherd's LFI and added excuting files.
httpd had flushing issues. realpath is new! does what it says. gives absolute path of a file. deddos, peerip, peerip.pl, were laying around elsewhere. gethostbyname got a new trick. can do decimal addresses among other things. hop0 is a shell script that gets what IP will be put on the source address of outgoing packets sent to $1. rtfs.
Diffstat (limited to 'src/bin/gethostbyname.c')
-rw-r--r--src/bin/gethostbyname.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bin/gethostbyname.c b/src/bin/gethostbyname.c
index 646bf0a..b670b1e 100644
--- a/src/bin/gethostbyname.c
+++ b/src/bin/gethostbyname.c
@@ -1,10 +1,18 @@
#include <stdio.h>
#include <netdb.h>
+#include <arpa/inet.h>
int main(int argc,char *argv[]) {
int i;
if(argc < 2) return 1;
- struct hostent *he=gethostbyname(argv[1]);
+ char *addr;
+ struct in_addr saddr;
+ if(inet_aton(argv[1],&saddr))
+ addr=inet_ntoa(saddr);
+ else
+ addr=argv[1];
+ struct hostent *he=gethostbyname(addr);
+
for(i=0;he->h_addr_list[i];i++) {
printf("%u.%u.%u.%u\n",
(unsigned char)he->h_addr_list[i][0],